Fix STM32F1 'freeMemory()' warnings (#20319)

This commit is contained in:
Jason Smith 2020-11-29 12:57:05 -08:00 committed by GitHub
parent 39abda8743
commit f2b9be6e70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -202,17 +202,9 @@ extern "C" {
extern "C" char* _sbrk(int incr); extern "C" char* _sbrk(int incr);
/* static inline int freeMemory() {
static int freeMemory() {
volatile int top;
top = (int)((char*)&top - reinterpret_cast<char*>(_sbrk(0)));
return top;
}
*/
static int freeMemory() {
volatile char top; volatile char top;
return &top - reinterpret_cast<char*>(_sbrk(0)); return &top - _sbrk(0);
} }
#if GCC_VERSION <= 50000 #if GCC_VERSION <= 50000