Page 1 of 1

Add CAN_ENFORCE_USE_CALLBACKS in halconf.h

Posted: Sat Mar 17, 2018 1:20 am
by faisal
Can we get CAN_ENFORCE_USE_CALLBACKS added to halconf.h templates, and have a default configuration option in hal_can.h

Re: Add CAN_ENFORCE_USE_CALLBACKS in halconf.h

Posted: Sat Mar 17, 2018 10:04 am
by Giovanni
Hi,

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

Giovanni

Re: Add CAN_ENFORCE_USE_CALLBACKS in halconf.h

Posted: Sun Mar 18, 2018 3:20 am
by faisal
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).

Re: Add CAN_ENFORCE_USE_CALLBACKS in halconf.h

Posted: Sun Mar 18, 2018 9:05 am
by Giovanni
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