diff --git a/lib/obp60task/OBP60Extensions.h b/lib/obp60task/OBP60Extensions.h index 972d148..fa80cc9 100644 --- a/lib/obp60task/OBP60Extensions.h +++ b/lib/obp60task/OBP60Extensions.h @@ -10,6 +10,7 @@ // FRAM address reservations 32kB: 0x0000 - 0x7FFF // 0x0000 - 0x03ff: single variables #define FRAM_PAGE_NO 0x0002 +#define FRAM_SYSTEM_MODE 0x009 // Voltage page #define FRAM_VOLTAGE_AVG 0x000A #define FRAM_VOLTAGE_TREND 0x000B diff --git a/lib/obp60task/PageSystem.cpp b/lib/obp60task/PageSystem.cpp index b69cd25..7beb13d 100644 --- a/lib/obp60task/PageSystem.cpp +++ b/lib/obp60task/PageSystem.cpp @@ -3,7 +3,7 @@ #include "Pagedata.h" #include "OBP60Extensions.h" #include "images/logo64.xbm" -#include +#include #define STRINGIZE_IMPL(x) #x #define STRINGIZE(x) STRINGIZE_IMPL(x) @@ -31,6 +31,9 @@ public: PageSystem(CommonData &common){ commonData = &common; common.logger->logDebug(GwLog::LOG,"Instantiate PageSystem"); + if (hasFRAM) { + mode = fram.read(FRAM_SYSTEM_MODE); + } chipid = ESP.getEfuseMac(); simulation = common.config->getBool(common.config->useSimuData); buzzer_mode = common.config->getString(common.config->buzzerMode); @@ -60,7 +63,7 @@ public: } else { mode = 'N'; } - if (hasFRAM) fram.write(FRAM_VOLTAGE_MODE, mode); + if (hasFRAM) fram.write(FRAM_SYSTEM_MODE, mode); return 0; } // grab cursor keys to disable page navigation