1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 13:21:23 +01:00

Update freeMemory.cpp

This commit is contained in:
Neil McKechnie 2021-03-09 10:27:38 +00:00
parent fab05bac79
commit 7954c85b7d

View File

@ -50,9 +50,9 @@ int freeMemory() {
// by estimation or inspection, that may be used by other
// called subroutines.
int updateMinimumFreeMemory(unsigned char extraBytes) {
int spare = freeMemory()-extraBytes;
byte sreg_save = SREG;
noInterrupts();
int spare = freeMemory()-extraBytes;
if (spare < minimum_free_memory) minimum_free_memory = spare;
int returnValue = minimum_free_memory;
SREG = sreg_save;