fix(color): Return actual free memory avail from 'malloc/new' calls in 'availableMemory' (#3512)

This commit is contained in:
philmoz
2023-05-07 11:14:01 +10:00
committed by GitHub
parent 140c700e1e
commit cea26d1247
2 changed files with 18 additions and 8 deletions
+1 -8
View File
@@ -469,14 +469,7 @@ extern uint8_t mixerCurrentFlightMode;
extern uint8_t lastFlightMode;
extern uint8_t flightModeTransitionLast;
#if defined(SIMU)
inline int availableMemory() { return 1000; }
#else
extern unsigned char *heap;
extern int _end;
extern int _heap_end;
#define availableMemory() ((unsigned int)((unsigned char *)&_heap_end - heap))
#endif
extern uint32_t availableMemory();
void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms);