mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-30 03:26:13 +01:00
Force inline because we do not want to use stack space for this function even if compiler has other preferences
This commit is contained in:
parent
0373f060fb
commit
6e8929c89e
11
DCCTimer.h
11
DCCTimer.h
|
@ -71,11 +71,12 @@ class DCCTimer {
|
||||||
// So even if all of the heap is freed, the reported minimum free
|
// So even if all of the heap is freed, the reported minimum free
|
||||||
// memory will not increase.
|
// memory will not increase.
|
||||||
//
|
//
|
||||||
static void inline updateMinimumFreeMemoryISR(unsigned char extraBytes=0) {
|
static void inline updateMinimumFreeMemoryISR(unsigned char extraBytes=0)
|
||||||
int spare = freeMemory()-extraBytes;
|
__attribute__((always_inline)) {
|
||||||
if (spare < 0) spare = 0;
|
int spare = freeMemory()-extraBytes;
|
||||||
if (spare < minimum_free_memory) minimum_free_memory = spare;
|
if (spare < 0) spare = 0;
|
||||||
}
|
if (spare < minimum_free_memory) minimum_free_memory = spare;
|
||||||
|
};
|
||||||
|
|
||||||
static int getMinimumFreeMemory();
|
static int getMinimumFreeMemory();
|
||||||
static void reset();
|
static void reset();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user