Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 19E042PIM_T3_2020_0639
mbedUtils.cpp
00001 00002 #include "mbedUtils.h" 00003 00004 #include "mbed.h" 00005 00006 00007 int getFreeMemory() 00008 { 00009 // Return the difference between the heap pointer and stack pointer. 00010 char stackVar = '\0'; 00011 char* stackPtr = &stackVar; 00012 char* heapPtr = (char*)malloc(sizeof(char)); 00013 int memFree = stackPtr - heapPtr; 00014 free(heapPtr); 00015 return memFree; 00016 }
Generated on Wed Jul 27 2022 18:22:14 by
