From 969911b7c2473a24c941cf376040104196236451 Mon Sep 17 00:00:00 2001 From: Krzysztof Bociurko Date: Fri, 17 Nov 2017 13:05:54 +0100 Subject: [PATCH] freertos: enabled use of pxTaskGetStackStart and cleaned up it's implementation Merges #1298 --- .../freertos/include/freertos/FreeRTOSConfig.h | 1 + components/freertos/tasks.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/components/freertos/include/freertos/FreeRTOSConfig.h b/components/freertos/include/freertos/FreeRTOSConfig.h index 5f5cebc6ba..37912a66ce 100644 --- a/components/freertos/include/freertos/FreeRTOSConfig.h +++ b/components/freertos/include/freertos/FreeRTOSConfig.h @@ -253,6 +253,7 @@ int xt_clock_freq(void) __attribute__((deprecated)); #define INCLUDE_uxTaskGetStackHighWaterMark 1 #define INCLUDE_pcTaskGetTaskName 1 #define INCLUDE_xTaskGetIdleTaskHandle 1 +#define INCLUDE_pxTaskGetStackStart 1 #define INCLUDE_xSemaphoreGetMutexHolder 1 diff --git a/components/freertos/tasks.c b/components/freertos/tasks.c index bdfe1086c9..ff549183a1 100644 --- a/components/freertos/tasks.c +++ b/components/freertos/tasks.c @@ -3814,14 +3814,17 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask ) /*-----------------------------------------------------------*/ #if (INCLUDE_pxTaskGetStackStart == 1) - uint8_t* pxTaskGetStackStart( TaskHandle_t xTask) - { - TCB_t *pxTCB; - UBaseType_t uxReturn; - pxTCB = prvGetTCBFromHandle( xTask ); - return ( uint8_t * ) pxTCB->pxStack; - } + uint8_t* pxTaskGetStackStart( TaskHandle_t xTask) + { + TCB_t *pxTCB; + uint8_t* uxReturn; + + pxTCB = prvGetTCBFromHandle( xTask ); + uxReturn = (uint8_t*)pxTCB->pxStack; + + return uxReturn; + } #endif /* INCLUDE_pxTaskGetStackStart */ /*-----------------------------------------------------------*/