From f7ae6d3117529df394de261515654904f6c0dd00 Mon Sep 17 00:00:00 2001 From: Felix Rusu Date: Thu, 30 Jul 2020 12:46:42 -0400 Subject: [PATCH] freeRAM fix (SAMD) --- Examples/PiGateway/PiGateway.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Examples/PiGateway/PiGateway.ino b/Examples/PiGateway/PiGateway.ino index d8c9002..929d532 100644 --- a/Examples/PiGateway/PiGateway.ino +++ b/Examples/PiGateway/PiGateway.ino @@ -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(sbrk(0)); #else extern int __heap_start, *__brkval;