Skip to content

Commit ddeb6b5

Browse files
committed
tasks.c: Hanndle tskSTATICALLY_ALLOCATED_STACK_ONLY case in xTaskGetStaticBuffers
1 parent 0fce066 commit ddeb6b5

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

tasks.c

+16-5
Original file line numberDiff line numberDiff line change
@@ -2503,16 +2503,27 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery ) /*lint !e971 Unqualified char
25032503

25042504
pxTCB = prvGetTCBFromHandle( xTask );
25052505

2506-
if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB )
2506+
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 )
2507+
if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB )
2508+
#endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 */
25072509
{
25082510
*ppuxStackBuffer = pxTCB->pxStack;
25092511
*ppxTaskBuffer = ( StaticTask_t * ) pxTCB;
25102512
xReturn = pdTRUE;
25112513
}
2512-
else
2513-
{
2514-
xReturn = pdFALSE;
2515-
}
2514+
2515+
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 )
2516+
else if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_ONLY )
2517+
{
2518+
*ppuxStackBuffer = pxTCB->pxStack;
2519+
*ppxTaskBuffer = NULL;
2520+
xReturn = pdTRUE;
2521+
}
2522+
else
2523+
{
2524+
xReturn = pdFALSE;
2525+
}
2526+
#endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 */
25162527

25172528
return xReturn;
25182529
}

0 commit comments

Comments
 (0)