cancel
Showing results for 
Search instead for 
Did you mean: 

Differences in port.c [FreeRTOS vs STM32CubeMX portings]

Martin.Sergio
Associate III
Posted on April 26, 2018 at 10:16

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
1 REPLY 1
Barry.Richard
Associate III
Posted on April 26, 2018 at 17:15

https://www.freertos.org/low-power-ARM-cortex-rtos.html#using_mcu_specific_features

 are macros, not functions, so are inlined with the calling code.  The parameter, xModifieableIdleTime, is therefore accessible directly inline, not as a function parameter.  Therefore the addition of the '&' is not necessary, even if the address of the variable is needed, as the address of the variable can be directly accessed in the implementation of the macro instead of where the variable is passed as a parameter to the macro.