Skip to content

Commit 024fc35

Browse files
committed
Add configCONTROL_INFINITE_LOOP in FreeRTOS.h
1 parent 3efa03a commit 024fc35

File tree

4 files changed

+13
-25
lines changed

4 files changed

+13
-25
lines changed

include/FreeRTOS.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,6 +2872,12 @@
28722872
#define configRUN_ADDITIONAL_TESTS 0
28732873
#endif
28742874

2875+
/* The following config allows infinite loop control. For example, control the
2876+
* infinite loop in idle task function when performing unit tests. */
2877+
#ifndef configCONTROL_INFINITE_LOOP
2878+
#define configCONTROL_INFINITE_LOOP()
2879+
#endif
2880+
28752881
/* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using
28762882
* dynamically allocated RAM, in which case when any task is deleted it is known
28772883
* that both the task's stack and TCB need to be freed. Sometimes the

queue.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@
4848
* correct privileged Vs unprivileged linkage and placement. */
4949
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
5050

51-
/* Code below here allows infinite loop controlling, especially for the infinite loop
52-
* in idle task function (for example when performing unit tests). */
53-
#ifndef INFINITE_LOOP
54-
#define INFINITE_LOOP()
55-
#endif
56-
5751
/* Constants used with the cRxLock and cTxLock structure members. */
5852
#define queueUNLOCKED ( ( int8_t ) -1 )
5953
#define queueLOCKED_UNMODIFIED ( ( int8_t ) 0 )
@@ -961,7 +955,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
961955
/*lint -save -e904 This function relaxes the coding standard somewhat to
962956
* allow return statements within the function itself. This is done in the
963957
* interest of execution time efficiency. */
964-
for( ; INFINITE_LOOP(); )
958+
for( ; configCONTROL_INFINITE_LOOP(); )
965959
{
966960
taskENTER_CRITICAL();
967961
{
@@ -1525,7 +1519,7 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
15251519
/*lint -save -e904 This function relaxes the coding standard somewhat to
15261520
* allow return statements within the function itself. This is done in the
15271521
* interest of execution time efficiency. */
1528-
for( ; INFINITE_LOOP(); )
1522+
for( ; configCONTROL_INFINITE_LOOP(); )
15291523
{
15301524
taskENTER_CRITICAL();
15311525
{
@@ -1681,7 +1675,7 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
16811675
/*lint -save -e904 This function relaxes the coding standard somewhat to allow return
16821676
* statements within the function itself. This is done in the interest
16831677
* of execution time efficiency. */
1684-
for( ; INFINITE_LOOP(); )
1678+
for( ; configCONTROL_INFINITE_LOOP(); )
16851679
{
16861680
taskENTER_CRITICAL();
16871681
{
@@ -1899,7 +1893,7 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
18991893
/*lint -save -e904 This function relaxes the coding standard somewhat to
19001894
* allow return statements within the function itself. This is done in the
19011895
* interest of execution time efficiency. */
1902-
for( ; INFINITE_LOOP(); )
1896+
for( ; configCONTROL_INFINITE_LOOP(); )
19031897
{
19041898
taskENTER_CRITICAL();
19051899
{

tasks.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,6 @@
317317
#define portDECREMENT_CRITICAL_NESTING_COUNT() ( pxCurrentTCBs[ portGET_CORE_ID() ]->uxCriticalNesting-- )
318318
#endif /* #if ( ( configNUMBER_OF_CORES > 1 ) && ( portCRITICAL_NESTING_IN_TCB == 1 ) ) */
319319

320-
/* Code below here allows infinite loop controlling, especially for the infinite loop
321-
* in idle task function (for example when performing unit tests). */
322-
#ifndef INFINITE_LOOP
323-
#define INFINITE_LOOP()
324-
#endif
325-
326320
#define taskBITS_PER_BYTE ( ( size_t ) 8 )
327321

328322
#if ( configNUMBER_OF_CORES > 1 )
@@ -5359,7 +5353,7 @@ void vTaskMissedYield( void )
53595353

53605354
taskYIELD();
53615355

5362-
for( ; INFINITE_LOOP(); )
5356+
for( ; configCONTROL_INFINITE_LOOP(); )
53635357
{
53645358
#if ( configUSE_PREEMPTION == 0 )
53655359
{
@@ -5444,7 +5438,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
54445438
}
54455439
#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
54465440

5447-
for( ; INFINITE_LOOP(); )
5441+
for( ; configCONTROL_INFINITE_LOOP(); )
54485442
{
54495443
/* See if any tasks have deleted themselves - if so then the idle task
54505444
* is responsible for freeing the deleted task's TCB and stack. */

timers.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@
4949
* correct privileged Vs unprivileged linkage and placement. */
5050
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e9021 !e961 !e750. */
5151

52-
/* Code below here allows infinite loop controlling, especially for the infinite loop
53-
* in idle task function (for example when performing unit tests). */
54-
#ifndef INFINITE_LOOP
55-
#define INFINITE_LOOP()
56-
#endif
57-
5852
/* This entire source file will be skipped if the application is not configured
5953
* to include software timer functionality. This #if is closed at the very bottom
6054
* of this file. If you want to include software timer functionality then ensure
@@ -714,7 +708,7 @@
714708
}
715709
#endif /* configUSE_DAEMON_TASK_STARTUP_HOOK */
716710

717-
for( ; INFINITE_LOOP(); )
711+
for( ; configCONTROL_INFINITE_LOOP(); )
718712
{
719713
/* Query the timers list to see if it contains any timers, and if so,
720714
* obtain the time at which the next timer will expire. */

0 commit comments

Comments
 (0)