hi,
i am working on low power mode, here i using the freertos functionality vPortSupressTicksandSleep() ot make the harware sleep and wakeup after a interrupt given, for using this function i need to define #define configUSE_TICKLESS_IDLE 1
i am having few queries over this macro enabling:
can i know,if this macro is enabled and the device reboots, the presleep and post sleep will be called continously?
before this function it is given as: #if (configUSE_TICKLESS_IDLE ==1 )
i want to execute this function only when the device tries to go to sleep, but when i define #define configUSE_TICKLESS_IDLE 1
in the file where the sleep mode is configured, it does not enable this function.
can u please share any logic for enabling this function?
in the file where the sleep mode is configured, it does not enable this
function.
Which function? Assuming you are using a Cortex-M3, M4F or M7 port,
then setting configUSE_TICKLESS_IDLE is 1 will the ‘supportess ticks and
yield’ macro is called, which by default, calls
vPortSuppressTicksAndSleep() defined in the FreeRTOS port.c file.
Hi,
Thank you Richard for the reply.
I am referring to the function called vPortSupressTicksandSleep() and I am
using cortex M7.
Now the issue:
If I make the macro defined to 1, I would observed that the presleep and
post sleep called continuously, is the behaviour expected or not?
in the file where the sleep mode is configured, it does not enable this
function.
Which function? Assuming you are using a Cortex-M3, M4F or M7 port,
then setting configUSE_TICKLESS_IDLE is 1 will the ‘supportess ticks and
yield’ macro is called, which by default, calls
vPortSuppressTicksAndSleep() defined in the FreeRTOS port.c file.
In the source code you will see that vPortSuppressTicksAndSleep() is
called if the expected idle time goes above a threshold you configure
using the configEXPECTED_IDLE_TIME_BEFORE_SLEEP constant
FreeRTOSConfig.h - then inside vPortSuppressTicksAndSleep() you have the
following code which is where the pre and post sleep functions (which
are defined by the application) are executed.