Skip to content

Commit 459db30

Browse files
committed
Remove unnecessary type TaskRunning_t
1 parent af2904b commit 459db30

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

tasks.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,11 @@
259259
#define taskEVENT_LIST_ITEM_VALUE_IN_USE 0x8000000000000000ULL
260260
#endif
261261

262-
/* Task state. */
263-
typedef BaseType_t TaskRunning_t;
264-
265262
/* Indicates that the task is not actively running on any core. */
266-
#define taskTASK_NOT_RUNNING ( TaskRunning_t ) ( -1 )
263+
#define taskTASK_NOT_RUNNING ( BaseType_t ) ( -1 )
267264

268265
/* Indicates that the task is actively running but scheduled to yield. */
269-
#define taskTASK_YIELDING ( TaskRunning_t ) ( -2 )
266+
#define taskTASK_YIELDING ( BaseType_t ) ( -2 )
270267

271268
/* Returns pdTRUE if the task is actively running and not scheduled to yield. */
272269
#if ( configNUMBER_OF_CORES == 1 )
@@ -313,7 +310,7 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to
313310
UBaseType_t uxPriority; /**< The priority of the task. 0 is the lowest priority. */
314311
StackType_t * pxStack; /**< Points to the start of the stack. */
315312
#if ( configNUMBER_OF_CORES > 1 )
316-
volatile TaskRunning_t xTaskRunState; /**< Used to identify the core the task is running on, if the task is running. Otherwise, identifies the task's state - not running or yielding. */
313+
volatile BaseType_t xTaskRunState; /**< Used to identify the core the task is running on, if the task is running. Otherwise, identifies the task's state - not running or yielding. */
317314
UBaseType_t uxTaskAttributes; /**< Task's attributes - currently used to identify the idle tasks. */
318315
#endif
319316
char pcTaskName[ configMAX_TASK_NAME_LEN ]; /**< Descriptive name given to the task when created. Facilitates debugging only. */ /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
@@ -986,7 +983,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
986983
#if ( configUSE_CORE_AFFINITY == 1 )
987984
pxPreviousTCB = pxCurrentTCBs[ xCoreID ];
988985
#endif
989-
pxTCB->xTaskRunState = ( TaskRunning_t ) xCoreID;
986+
pxTCB->xTaskRunState = ( BaseType_t ) xCoreID;
990987
pxCurrentTCBs[ xCoreID ] = pxTCB;
991988
xTaskScheduled = pdTRUE;
992989
}
@@ -1000,7 +997,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
1000997
#endif
1001998
{
1002999
/* The task is already running on this core, mark it as scheduled. */
1003-
pxTCB->xTaskRunState = ( TaskRunning_t ) xCoreID;
1000+
pxTCB->xTaskRunState = ( BaseType_t ) xCoreID;
10041001
xTaskScheduled = pdTRUE;
10051002
}
10061003
}
@@ -2003,7 +2000,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
20032000
/* Force a reschedule if the task that has just been deleted was running. */
20042001
if( ( xSchedulerRunning != pdFALSE ) && ( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) )
20052002
{
2006-
if( pxTCB->xTaskRunState == ( TaskRunning_t ) portGET_CORE_ID() )
2003+
if( pxTCB->xTaskRunState == ( BaseType_t ) portGET_CORE_ID() )
20072004
{
20082005
configASSERT( uxSchedulerSuspended == 0 );
20092006
vTaskYieldWithinAPI();
@@ -2708,7 +2705,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
27082705
TCB_t * pxTCB;
27092706

27102707
#if ( configNUMBER_OF_CORES > 1 )
2711-
TaskRunning_t xTaskRunningOnCore;
2708+
BaseType_t xTaskRunningOnCore;
27122709
#endif
27132710

27142711
taskENTER_CRITICAL();
@@ -2831,7 +2828,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
28312828
{
28322829
if( xSchedulerRunning != pdFALSE )
28332830
{
2834-
if( xTaskRunningOnCore == ( TaskRunning_t ) portGET_CORE_ID() )
2831+
if( xTaskRunningOnCore == ( BaseType_t ) portGET_CORE_ID() )
28352832
{
28362833
/* The current task has just been suspended. */
28372834
configASSERT( uxSchedulerSuspended == 0 );

0 commit comments

Comments
 (0)