1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-27 06:11:25 +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:
Harald Barth 2022-07-26 12:32:18 +02:00
parent 0373f060fb
commit 6e8929c89e

View File

@ -71,11 +71,12 @@ class DCCTimer {
// So even if all of the heap is freed, the reported minimum free
// memory will not increase.
//
static void inline updateMinimumFreeMemoryISR(unsigned char extraBytes=0) {
int spare = freeMemory()-extraBytes;
if (spare < 0) spare = 0;
if (spare < minimum_free_memory) minimum_free_memory = spare;
}
static void inline updateMinimumFreeMemoryISR(unsigned char extraBytes=0)
__attribute__((always_inline)) {
int spare = freeMemory()-extraBytes;
if (spare < 0) spare = 0;
if (spare < minimum_free_memory) minimum_free_memory = spare;
};
static int getMinimumFreeMemory();
static void reset();