I am using a Mega 2560 for a gps application. The program size is 18,000 bytes and there are 258k byte maximum.
extern int __heap_start, *__brkval;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
This reports only 6982 bytes free. I would have suspected 200k+. What is correct routine I should be using or does this need modifying?