Add CAN_ENFORCE_USE_CALLBACKS in halconf.h Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

Add CAN_ENFORCE_USE_CALLBACKS in halconf.h  Topic is solved

Postby faisal » Sat Mar 17, 2018 1:20 am

Can we get CAN_ENFORCE_USE_CALLBACKS added to halconf.h templates, and have a default configuration option in hal_can.h

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Add CAN_ENFORCE_USE_CALLBACKS in halconf.h

Postby Giovanni » Sat Mar 17, 2018 10:04 am

Hi,

I modified the option in a proper switch and regenerated all halconf.h files.

Giovanni

faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

Re: Add CAN_ENFORCE_USE_CALLBACKS in halconf.h

Postby faisal » Sun Mar 18, 2018 3:20 am

In hal_can_lld.h, it doesn't check the TRUE/FALSE value of the switch. It just checks if it is defined. It should check the value, similar to how CAN_USE_SLEEP_MODE is checked (I'm looking at STM32/LLD/CANv1/hal_can_lld.h).

Also, in hal_can_lld.h it checks sleep mode like this:
#if (CAN_USE_SLEEP_MODE == TRUE) || defined (__DOXYGEN__)

.. and just above that, it checks it like this:
#if CAN_USE_SLEEP_MODE || defined (__DOXYGEN__)

If believe the latter way is more consistent with the rest of the file(s).

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Add CAN_ENFORCE_USE_CALLBACKS in halconf.h

Postby Giovanni » Sun Mar 18, 2018 9:05 am

Hi,

Fixed, the comparison with the constant is required by the MISRA checker, I am switching to that style gradually in LLDs. High level parts consistently use that already.

Giovanni


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 2 guests