This seems to work for me:



uint32_t FreeMem(){ // for Teensy 3.0
uint32_t stackTop;
uint32_t heapTop;

// current position of the stack.
stackTop = (uint32_t) &stackTop;