Skip to content

Commit 1eae231

Browse files
authored
Merge branch 'main' into ARM_CRx_MPU
2 parents 5929dc7 + 8cfa715 commit 1eae231

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

include/FreeRTOS.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,9 +2799,9 @@
27992799

28002800
#ifndef configSTACK_DEPTH_TYPE
28012801

2802-
/* Defaults to uint16_t for backward compatibility, but can be overridden
2803-
* in FreeRTOSConfig.h if uint16_t is too restrictive. */
2804-
#define configSTACK_DEPTH_TYPE uint16_t
2802+
/* Defaults to StackType_t for backward compatibility, but can be overridden
2803+
* in FreeRTOSConfig.h if StackType_t is too restrictive. */
2804+
#define configSTACK_DEPTH_TYPE StackType_t
28052805
#endif
28062806

28072807
#ifndef configRUN_TIME_COUNTER_TYPE

tasks.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3208,6 +3208,8 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
32083208

32093209
#if ( configNUMBER_OF_CORES == 1 )
32103210
{
3211+
UBaseType_t uxCurrentListLength;
3212+
32113213
if( xSchedulerRunning != pdFALSE )
32123214
{
32133215
/* Reset the next expected unblock time in case it referred to the
@@ -3236,7 +3238,13 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
32363238
/* The scheduler is not running, but the task that was pointed
32373239
* to by pxCurrentTCB has just been suspended and pxCurrentTCB
32383240
* must be adjusted to point to a different task. */
3239-
if( listCURRENT_LIST_LENGTH( &xSuspendedTaskList ) == uxCurrentNumberOfTasks )
3241+
3242+
/* Use a temp variable as a distinct sequence point for reading
3243+
* volatile variables prior to a comparison to ensure compliance
3244+
* with MISRA C 2012 Rule 13.2. */
3245+
uxCurrentListLength = listCURRENT_LIST_LENGTH( &xSuspendedTaskList );
3246+
3247+
if( uxCurrentListLength == uxCurrentNumberOfTasks )
32403248
{
32413249
/* No other tasks are ready, so set pxCurrentTCB back to
32423250
* NULL so when the next task is created pxCurrentTCB will

0 commit comments

Comments
 (0)