mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 13:01:57 -04:00
Add configCONTROL_INFINITE_LOOP for loop control in unit test (#783)
* Add configCONTROL_INFINITE_LOOP in FreeRTOS.h * Use configCONTROL_INFINITE_LOOP in tasks.c and timer.c --------- Co-authored-by: Soren Ptak <ptaksoren@gmail.com> Co-authored-by: kar-rahul-aws <118818625+kar-rahul-aws@users.noreply.github.com>
This commit is contained in:
parent
97d48ba94a
commit
d442d7908a
|
@ -2872,6 +2872,12 @@
|
|||
#define configRUN_ADDITIONAL_TESTS 0
|
||||
#endif
|
||||
|
||||
/* The following config allows infinite loop control. For example, control the
|
||||
* infinite loop in idle task function when performing unit tests. */
|
||||
#ifndef configCONTROL_INFINITE_LOOP
|
||||
#define configCONTROL_INFINITE_LOOP()
|
||||
#endif
|
||||
|
||||
/* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using
|
||||
* dynamically allocated RAM, in which case when any task is deleted it is known
|
||||
* that both the task's stack and TCB need to be freed. Sometimes the
|
||||
|
|
10
tasks.c
10
tasks.c
|
@ -317,12 +317,6 @@
|
|||
#define portDECREMENT_CRITICAL_NESTING_COUNT() ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxCriticalNesting-- )
|
||||
#endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( portCRITICAL_NESTING_IN_TCB == 1 ) ) */
|
||||
|
||||
/* Code below here allows infinite loop controlling, especially for the infinite loop
|
||||
* in idle task function (for example when performing unit tests). */
|
||||
#ifndef INFINITE_LOOP
|
||||
#define INFINITE_LOOP() 1
|
||||
#endif
|
||||
|
||||
#define taskBITS_PER_BYTE ( ( size_t ) 8 )
|
||||
|
||||
#if ( configNUMBER_OF_CORES > 1 )
|
||||
|
@ -5374,7 +5368,7 @@ void vTaskMissedYield( void )
|
|||
|
||||
taskYIELD();
|
||||
|
||||
for( ; INFINITE_LOOP(); )
|
||||
for( ; configCONTROL_INFINITE_LOOP(); )
|
||||
{
|
||||
#if ( configUSE_PREEMPTION == 0 )
|
||||
{
|
||||
|
@ -5459,7 +5453,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
|
|||
}
|
||||
#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
|
||||
|
||||
for( ; INFINITE_LOOP(); )
|
||||
for( ; configCONTROL_INFINITE_LOOP(); )
|
||||
{
|
||||
/* See if any tasks have deleted themselves - if so then the idle task
|
||||
* is responsible for freeing the deleted task's TCB and stack. */
|
||||
|
|
Loading…
Reference in a new issue