Created
October 19, 2012 14:56
-
-
Save mepunit/3918648 to your computer and use it in GitHub Desktop.
Get Free SRAM available in AVR
This file contains 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
extern void __bss_end; | |
extern void *__brkval; | |
int get_free_memory() | |
{ | |
int free_memory; | |
if((int)__brkval == 0) | |
free_memory = ((int)&free_memory) - ((int)&__bss_end); | |
else | |
free_memory = ((int)&free_memory) - ((int)__brkval); | |
return free_memory; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment