Skip to main content
Martin.Sergio
Associate III
April 26, 2018
Question

Differences in port.c [FreeRTOS vs STM32CubeMX portings]

  • April 26, 2018
  • 1 reply
  • 551 views
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
    This topic has been closed for replies.

    1 reply

    Barry.Richard
    Visitor II
    April 26, 2018
    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.