I am in the process of enabling RTOS tickless idle mode in my project and i found that INCLUDE_vTaskSuspend is mandatory for tickless idle mode. In all my projects i have kept INCLUDE_vTaskSuspend as 0.
As per my understanding, by including INCLUDE_vTaskSuspend causes a new state list is used where suspended tasks listed. A task is suspended if it doesn’t have a timeout or timeout is portMAX_DELAY. If this list was not included then tasks will be placed in delayed or blocked list. so this list is not mandatory ( i also acknowledge the fact that a task can get unblocked when current time exceeds current time plus portMAX_DELAY and this can be addressed by checking return values).
I tried disabling the sanity check pasted below in FreeRTOS.h:
#if( configUSE_TICKLESS_IDLE != 0 )
#if( INCLUDE_vTaskSuspend != 1 )
#error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0
#endif /* INCLUDE_vTaskSuspend /
#endif / configUSE_TICKLESS_IDLE */
while compiling its showing error in eTaskConfirmSleepModeStatus() API.
eTaskConfirmSleepModeStatus() checks for suspended list.
/* If all the tasks are in the suspended list (which might mean they have an infinite block time rather than actually being suspended) then it is safe to turn all clocks off and just wait for external interrupts. */ if( listCURRENT_LIST_LENGTH( &xSuspendedTaskList ) == ( uxCurrentNumberOfTasks - uxNonApplicationTasks ) ) { eReturn = eNoTasksWaitingTimeout; }
- Is there any reason not to keep the above lines of code under (INCLUDE_vTaskSuspend == 1) check.
- Is it ok to enable tickless idle with INCLUDE_vTaskSuspend as 0.
Regards,
Pramith