Dual CANbus monitor and instrumentation cluster
Embed:
(wiki syntax)
Show/hide line numbers
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 13 2022 09:43:57 by 1.7.2