mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Remove tickless idle mode dependency with include v task suspend (#422)
* Fix Remove tickless idle feature dependency with INCLUDE_vTaskSuspend * fix unused variable warning * Fix CI fomatting check Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> Authored-by: pramithkv <pramit@lifesignals.com>
This commit is contained in:
parent
052e364686
commit
4c4089b154
|
@ -924,12 +924,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Sanity check the configuration. */
|
/* Sanity check the configuration. */
|
||||||
#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 */
|
|
||||||
|
|
||||||
#if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
|
#if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )
|
||||||
#error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
|
#error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -169,7 +169,9 @@ typedef enum
|
||||||
{
|
{
|
||||||
eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPRESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
|
eAbortSleep = 0, /* A task has been made ready or a context switch pended since portSUPPRESS_TICKS_AND_SLEEP() was called - abort entering a sleep mode. */
|
||||||
eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
|
eStandardSleep, /* Enter a sleep mode that will not last any longer than the expected idle time. */
|
||||||
|
#if ( INCLUDE_vTaskSuspend == 1 )
|
||||||
eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */
|
eNoTasksWaitingTimeout /* No tasks are waiting for a timeout so it is safe to enter a sleep mode that can only be exited by an external interrupt. */
|
||||||
|
#endif /* INCLUDE_vTaskSuspend */
|
||||||
} eSleepModeStatus;
|
} eSleepModeStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
11
tasks.c
11
tasks.c
|
@ -3529,8 +3529,11 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
||||||
|
|
||||||
eSleepModeStatus eTaskConfirmSleepModeStatus( void )
|
eSleepModeStatus eTaskConfirmSleepModeStatus( void )
|
||||||
{
|
{
|
||||||
|
#if ( INCLUDE_vTaskSuspend == 1 )
|
||||||
/* The idle task exists in addition to the application tasks. */
|
/* The idle task exists in addition to the application tasks. */
|
||||||
const UBaseType_t uxNonApplicationTasks = 1;
|
const UBaseType_t uxNonApplicationTasks = 1;
|
||||||
|
#endif /* INCLUDE_vTaskSuspend */
|
||||||
|
|
||||||
eSleepModeStatus eReturn = eStandardSleep;
|
eSleepModeStatus eReturn = eStandardSleep;
|
||||||
|
|
||||||
/* This function must be called from a critical section. */
|
/* This function must be called from a critical section. */
|
||||||
|
@ -3551,21 +3554,21 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
||||||
* because the scheduler is suspended. */
|
* because the scheduler is suspended. */
|
||||||
eReturn = eAbortSleep;
|
eReturn = eAbortSleep;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
#if ( INCLUDE_vTaskSuspend == 1 )
|
||||||
|
else if( listCURRENT_LIST_LENGTH( &xSuspendedTaskList ) == ( uxCurrentNumberOfTasks - uxNonApplicationTasks ) )
|
||||||
{
|
{
|
||||||
/* If all the tasks are in the suspended list (which might mean they
|
/* If all the tasks are in the suspended list (which might mean they
|
||||||
* have an infinite block time rather than actually being suspended)
|
* have an infinite block time rather than actually being suspended)
|
||||||
* then it is safe to turn all clocks off and just wait for external
|
* then it is safe to turn all clocks off and just wait for external
|
||||||
* interrupts. */
|
* interrupts. */
|
||||||
if( listCURRENT_LIST_LENGTH( &xSuspendedTaskList ) == ( uxCurrentNumberOfTasks - uxNonApplicationTasks ) )
|
|
||||||
{
|
|
||||||
eReturn = eNoTasksWaitingTimeout;
|
eReturn = eNoTasksWaitingTimeout;
|
||||||
}
|
}
|
||||||
|
#endif /* INCLUDE_vTaskSuspend */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return eReturn;
|
return eReturn;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue