GomSpace/libcsp — Issue #18: CSP_MEMFREE gives wrong answer on freertos AVR due to truncation
Author: jlars07
Created: 2011-11-22 19:08:02+00:00
State: open

csp_service_handler gives wrong answer on the CSP_MEMFREE port for freertos on AVR.

This is due to truncation of the argument given to malloc. Malloc takes type size_t, which is only two bytes on AVR. The value of 'size' is initialized to 1000000 and is thus truncated in the call to malloc.

Setting the initialized value of 'size' and 'max' to a value below UINT16_MAX results in the right answer.