freeRAM fix (SAMD)

This commit is contained in:
Felix Rusu 2020-07-30 12:46:42 -04:00
parent 4853b54e31
commit f7ae6d3117
1 changed files with 2 additions and 1 deletions

View File

@ -417,9 +417,10 @@ void handleSerialData() {
}
//returns # of unfragmented free RAM bytes (free end of heap)
extern "C" char *sbrk(int i);
int freeRAM() {
#ifdef __arm__
char top;
char top=0;
return &top - reinterpret_cast<char*>(sbrk(0));
#else
extern int __heap_start, *__brkval;