Created
May 22, 2015 16:02
-
-
Save StuffAndyMakes/8aeb195539c530d53ca2 to your computer and use it in GitHub Desktop.
Quick free available RAM function for Arduino/AVR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// found at https://learn.adafruit.com/memories-of-an-arduino/measuring-free-memory | |
int freeRam () { | |
extern int __heap_start, *__brkval; | |
int v; | |
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment