Browse Source

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

Jason Smith 4 years ago
parent
commit
f2b9be6e70
No account linked to committer's email address
1 changed files with 2 additions and 10 deletions
  1. 2
    10
      Marlin/src/HAL/STM32F1/HAL.h

+ 2
- 10
Marlin/src/HAL/STM32F1/HAL.h View File

202
 
202
 
203
 extern "C" char* _sbrk(int incr);
203
 extern "C" char* _sbrk(int incr);
204
 
204
 
205
-/*
206
-static int freeMemory() {
207
-  volatile int top;
208
-  top = (int)((char*)&top - reinterpret_cast<char*>(_sbrk(0)));
209
-  return top;
210
-}
211
-*/
212
-
213
-static int freeMemory() {
205
+static inline int freeMemory() {
214
   volatile char top;
206
   volatile char top;
215
-  return &top - reinterpret_cast<char*>(_sbrk(0));
207
+  return &top - _sbrk(0);
216
 }
208
 }
217
 
209
 
218
 #if GCC_VERSION <= 50000
210
 #if GCC_VERSION <= 50000

Loading…
Cancel
Save