Differences between in port.c [FreeRTOS vs STM32CubeMX portings]

sergiomartin wrote on Thursday, April 26, 2018:

Hi,

The port.c file for the same FreeRTOS version [8.2.3] have a difference.

In the Official FreeRTOS release:
configPRE_SLEEP_PROCESSING( xModifiableIdleTime );
configPOST_SLEEP_PROCESSING( xExpectedIdleTime );

In the STM32CubeMX
configPRE_SLEEP_PROCESSING( &xModifiableIdleTime );
configPOST_SLEEP_PROCESSING( &xExpectedIdleTime );

Why this difference? It is wrong in the Cube?

Best Regards,

  Sergio

rtel wrote on Thursday, April 26, 2018:

I could say as I’m not familiar with the ST code, however I would guess
it is either a mistake or otherwise it is not necessary.
configPRE_SLEEP_PROCESSINIG() and configPOST_SLEEP_PROCESSING() are both
macros, so the parameter passed in is accessed directly inline in the
code, not as a parameter would be in a function call. Therefore, if the
address of xModifiableIdleTime was needed you can put the ‘&’ on the
variable inside the macro, not when you pass the variable into the
macro. From a previous post it seems there are some issues in the
implementation of ST’s tickless idle code.