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 chrisjenda committed Apr 5, 2021
1 parent cf43a3d commit c79eb61
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 @@ -200,17 +200,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);
}

#pragma GCC diagnostic pop
Expand Down

0 comments on commit c79eb61

Please sign in to comment.