FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [June 2012 Threads] uxTaskGetStackHighWaterMark return typePosted by Toan Pham on June 5, 2012 Hi, i am running freertos an a 8bit xmega processor. I am trying to find the size of the unused stack space by using call to uxTaskGetStackHighWaterMark. However, uxTaskGetStackHighWaterMark returns portBASE_TYPE which is defined as unsigned char in portmacro.h. This is not good, for example if the total unused space is more than 255, calls to uxTaskGetStackHighWaterMark is subjected to rollover, and is inaccurate.
I looked further into uxTaskGetStackHighWaterMark and it makes another call to check unused stack size, which returns unsigned short, but get casted to port_BASE_TYPE in uxTaskGetStackHighWaterMark. Would it be better if uxTaskGetStackHighWaterMark returns unsigned short instead?
thanks
RE: uxTaskGetStackHighWaterMark return typePosted by Richard on June 5, 2012 Yes - my bad - there is a change request on exactly that point already but I have not implemented it yet. For now, it is easy enough to edit the source code so a size_t is returned instead, but long term you don't want to be editing anything in the source code (maintenance nightmare when FreeRTOS changes) so I really need to do this in the main line. Apologies for not doing so already.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|