From ddeb6b5c0a57a196523aac666f3a604ae565012e Mon Sep 17 00:00:00 2001 From: Paul Bartell Date: Tue, 14 Mar 2023 16:52:04 -0700 Subject: [PATCH] tasks.c: Hanndle tskSTATICALLY_ALLOCATED_STACK_ONLY case in xTaskGetStaticBuffers --- tasks.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tasks.c b/tasks.c index 687bee51854..ecdddce05ca 100644 --- a/tasks.c +++ b/tasks.c @@ -2503,16 +2503,27 @@ 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; }