From d3fd7c18fc7be4feac9f22bedb0efb69d66448a2 Mon Sep 17 00:00:00 2001 From: Ching-Hsin Lee Date: Wed, 21 Jun 2023 17:55:00 +0800 Subject: [PATCH 1/3] Add ePendingReady state for task in a pending ready list * Add ePendingReady state for task in a pending ready list --- include/task.h | 3 ++- tasks.c | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/task.h b/include/task.h index 702f74dce9..f8d15c38bb 100644 --- a/include/task.h +++ b/include/task.h @@ -96,7 +96,8 @@ typedef BaseType_t (* TaskHookFunction_t)( void * ); typedef enum { eRunning = 0, /* A task is querying the state of itself, so must be running. */ - eReady, /* The task being queried is in a ready or pending ready list. */ + eReady, /* The task being queried is in a ready list. */ + ePendingReady,/* The task being queried is in a pending ready list. */ eBlocked, /* The task being queried is in the Blocked state. */ eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */ eDeleted, /* The task being queried has been deleted, but its TCB has not yet been freed. */ diff --git a/tasks.c b/tasks.c index 5bdfff58d6..f5585413cc 100644 --- a/tasks.c +++ b/tasks.c @@ -1376,10 +1376,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) if( pxEventList == &xPendingReadyList ) { - /* The task has been placed on the pending ready list, so its - * state is eReady regardless of what list the task's state list - * item is currently placed on. */ - eReturn = eReady; + /* The task has been placed on the pending ready list. */ + eReturn = ePendingReady; } else if( ( pxStateList == pxDelayedList ) || ( pxStateList == pxOverflowedDelayedList ) ) { @@ -1442,7 +1440,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) else /*lint !e525 Negative indentation is intended to make use of pre-processor clearer. */ { /* If the task is not in any other state, it must be in the - * Ready (including pending ready) state. */ + * Ready state. */ eReturn = eReady; } } From 2190569e08238cf6543aa0eec5c6a7ae4b77636b Mon Sep 17 00:00:00 2001 From: Ching-Hsin Lee Date: Mon, 26 Jun 2023 13:20:40 +0800 Subject: [PATCH 2/3] Fix lexicon --- .github/lexicon.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/lexicon.txt b/.github/lexicon.txt index 1a7d4852dc..677ea79c7c 100644 --- a/.github/lexicon.txt +++ b/.github/lexicon.txt @@ -607,6 +607,7 @@ epage epc epclear epeds +ependingready ependofwr epint epread From e710d38abf79a5a68d560480eb88d2707837bc9c Mon Sep 17 00:00:00 2001 From: Ching-Hsin Lee Date: Mon, 26 Jun 2023 13:23:08 +0800 Subject: [PATCH 3/3] Fix format --- include/task.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/task.h b/include/task.h index f8d15c38bb..3909ed66e1 100644 --- a/include/task.h +++ b/include/task.h @@ -95,13 +95,13 @@ typedef BaseType_t (* TaskHookFunction_t)( void * ); /* Task states returned by eTaskGetState. */ typedef enum { - eRunning = 0, /* A task is querying the state of itself, so must be running. */ - eReady, /* The task being queried is in a ready list. */ - ePendingReady,/* The task being queried is in a pending ready list. */ - eBlocked, /* The task being queried is in the Blocked state. */ - eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */ - eDeleted, /* The task being queried has been deleted, but its TCB has not yet been freed. */ - eInvalid /* Used as an 'invalid state' value. */ + eRunning = 0, /* A task is querying the state of itself, so must be running. */ + eReady, /* The task being queried is in a ready list. */ + ePendingReady, /* The task being queried is in a pending ready list. */ + eBlocked, /* The task being queried is in the Blocked state. */ + eSuspended, /* The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */ + eDeleted, /* The task being queried has been deleted, but its TCB has not yet been freed. */ + eInvalid /* Used as an 'invalid state' value. */ } eTaskState; /* Actions that can be performed when vTaskNotify() is called. */