diff --git a/CommandStation-EX.ino b/CommandStation-EX.ino index e9b33eb..36b4660 100644 --- a/CommandStation-EX.ino +++ b/CommandStation-EX.ino @@ -18,17 +18,8 @@ #include "DIAG.h" #include "DCCEXParser.h" #include "version.h" -#ifdef WIFI_ON #include "WifiInterface.h" -#endif -#if ENABLE_FREE_MEM_WARNING -#include "freeMemory.h" -int ramLowWatermark = 32767; // This figure gets overwritten dynamically in loop() -#endif - -#if defined(ARDUINO_ARCH_MEGAAVR) #include -#endif @@ -222,6 +213,8 @@ void loop() // Optionally report any decrease in memory (will automatically trigger on first call) #if ENABLE_FREE_MEM_WARNING + static int ramLowWatermark = 32767; // replaced on first loop + int freeNow = freeMemory(); if (freeNow < ramLowWatermark) { diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 282237b..7433576 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -23,9 +23,7 @@ #include "DCCEXParser.h" #include "DCC.h" #include "DCCWaveform.h" -#ifdef WIFI_ON #include "WifiInterface.h" -#endif #include "Turnouts.h" #include "Outputs.h" #include "Sensors.h"