Skip to content

Commit

Permalink
Fix STM32F1 'freeMemory()' warnings (MarlinFirmware#20319)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjasonsmith authored and dpreed committed Feb 5, 2021
1 parent 1378e2d commit 704d065
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions Marlin/src/HAL/STM32F1/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,9 @@ extern "C" {

extern "C" char* _sbrk(int incr);

/*
static int freeMemory() {
volatile int top;
top = (int)((char*)&top - reinterpret_cast<char*>(_sbrk(0)));
return top;
}
*/

static int freeMemory() {
static inline int freeMemory() {
volatile char top;
return &top - reinterpret_cast<char*>(_sbrk(0));
return &top - _sbrk(0);
}

#if GCC_VERSION <= 50000
Expand Down

0 comments on commit 704d065

Please sign in to comment.