Skip to content

Commit 0b3509a

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

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

tasks.c

+15-5
Original file line numberDiff line numberDiff line change
@@ -2503,16 +2503,26 @@ 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+
#if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 )
2515+
else if( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_ONLY )
2516+
{
2517+
*ppuxStackBuffer = pxTCB->pxStack;
2518+
*ppxTaskBuffer = NULL;
2519+
xReturn = pdTRUE;
2520+
}
2521+
else
2522+
{
2523+
xReturn = pdFALSE;
2524+
}
2525+
#endif /* tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE == 1 */
25162526

25172527
return xReturn;
25182528
}

0 commit comments

Comments
 (0)