Hi, I’m using FreeRTOS 8.1.2 with tickless enabled via setting configUSE_TICKLESS_IDLE to 1. There is a condition that my task is waiting an expected event in nearly future. If I put my task into suspend, then freertos may enter sleep and make my task missing this event. Here is possible solutions I’ve tried:
(1) Redefine macro configPRE_SLEEP_PROCESSING and make it skip sleep if my task is waiting event. This is not a proper solution because this makes the tick count incorrect.
(2) Redefine macro configEXPECTED_IDLE_TIME_BEFORE_SLEEP as a function and return a huge number if my task is waiting event. But it’s build fail in size check in FreeRTOS.h
Thus I think this condition need a feature like wake lock that if some process acquire wake lock then the system won’t enter sleep. Is there a elegant way to achieve this feature without rewrite vPortSuppressTicksAndSleep or portTASK_FUNCTION()?