Fix warning and FRAM code on system page

This commit is contained in:
Thomas Hooge 2025-01-21 09:28:53 +01:00
parent 569273519c
commit b9356c9ae8
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -3,7 +3,7 @@
#include "Pagedata.h"
#include "OBP60Extensions.h"
#include "images/logo64.xbm"
#include <esp_clk.h>
#include <esp32/clk.h>
#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