tpham3783 wrote on Tuesday, June 05, 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