Skip to content

Commit

Permalink
bugfix: Initialize uxTaskNumber at task initialization (#374)
Browse files Browse the repository at this point in the history
* bugfix: Initialize uxTaskNumber at task initialization
  • Loading branch information
laukik-hase committed Nov 11, 2021
1 parent 4896d6b commit 683811b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/lexicon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2452,6 +2452,7 @@ uxstreambuffernumber
uxtaskgetnumberoftasks
uxtaskgetstackhighwatermark
uxtaskgetsystemstate
uxtaskgettasknumber
uxtasknumber
uxtaskpriorityget
uxtaskprioritygetfromisr
Expand Down Expand Up @@ -2601,6 +2602,7 @@ vtaskremovefromunorderedeventlist
vtaskresume
vtaskresumefromisr
vtasksetapplicationtasktag
vtasksettasknumber
vtasksettimeout
vtasksettimeoutstate
vtaskstartscheduler
Expand Down
4 changes: 4 additions & 0 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,10 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
{
/* Add a counter into the TCB for tracing only. */
pxNewTCB->uxTCBNumber = uxTaskNumber;

/* Initialize the uxTaskNumber member to zero. It is utilized by the
* application using vTaskSetTaskNumber and uxTaskGetTaskNumber APIs. */
pxNewTCB->uxTaskNumber = 0;
}
#endif /* configUSE_TRACE_FACILITY */
traceTASK_CREATE( pxNewTCB );
Expand Down

0 comments on commit 683811b

Please sign in to comment.