Skip to content

Commit

Permalink
tasks.c: Hanndle tskSTATICALLY_ALLOCATED_STACK_ONLY case in xTaskGetS…
Browse files Browse the repository at this point in the history
…taticBuffers
  • Loading branch information
paulbartell committed Mar 14, 2023
1 parent 0fce066 commit 0b3509a
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -2503,16 +2503,26 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char

pxTCB = prvGetTCBFromHandle( xTask );

if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB )
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 )
if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB )
#endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 */
{
*ppuxStackBuffer = pxTCB->pxStack;
*ppxTaskBuffer = ( StaticTask_t * ) pxTCB;
xReturn = pdTRUE;
}
else
{
xReturn = pdFALSE;
}
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 )
else if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_ONLY )
{
*ppuxStackBuffer = pxTCB->pxStack;
*ppxTaskBuffer = NULL;
xReturn = pdTRUE;
}
else
{
xReturn = pdFALSE;
}
#endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 */

return xReturn;
}
Expand Down

0 comments on commit 0b3509a

Please sign in to comment.