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 Kannix2005 committed Dec 7, 2020
1 parent 15398f0 commit ac2ce2d
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 ac2ce2d

Please sign in to comment.