mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-14 22:43:07 +01:00
Fix warning and FRAM code on system page
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
// FRAM address reservations 32kB: 0x0000 - 0x7FFF
|
// FRAM address reservations 32kB: 0x0000 - 0x7FFF
|
||||||
// 0x0000 - 0x03ff: single variables
|
// 0x0000 - 0x03ff: single variables
|
||||||
#define FRAM_PAGE_NO 0x0002
|
#define FRAM_PAGE_NO 0x0002
|
||||||
|
#define FRAM_SYSTEM_MODE 0x009
|
||||||
// Voltage page
|
// Voltage page
|
||||||
#define FRAM_VOLTAGE_AVG 0x000A
|
#define FRAM_VOLTAGE_AVG 0x000A
|
||||||
#define FRAM_VOLTAGE_TREND 0x000B
|
#define FRAM_VOLTAGE_TREND 0x000B
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "Pagedata.h"
|
#include "Pagedata.h"
|
||||||
#include "OBP60Extensions.h"
|
#include "OBP60Extensions.h"
|
||||||
#include "images/logo64.xbm"
|
#include "images/logo64.xbm"
|
||||||
#include <esp_clk.h>
|
#include <esp32/clk.h>
|
||||||
|
|
||||||
#define STRINGIZE_IMPL(x) #x
|
#define STRINGIZE_IMPL(x) #x
|
||||||
#define STRINGIZE(x) STRINGIZE_IMPL(x)
|
#define STRINGIZE(x) STRINGIZE_IMPL(x)
|
||||||
@@ -31,6 +31,9 @@ public:
|
|||||||
PageSystem(CommonData &common){
|
PageSystem(CommonData &common){
|
||||||
commonData = &common;
|
commonData = &common;
|
||||||
common.logger->logDebug(GwLog::LOG,"Instantiate PageSystem");
|
common.logger->logDebug(GwLog::LOG,"Instantiate PageSystem");
|
||||||
|
if (hasFRAM) {
|
||||||
|
mode = fram.read(FRAM_SYSTEM_MODE);
|
||||||
|
}
|
||||||
chipid = ESP.getEfuseMac();
|
chipid = ESP.getEfuseMac();
|
||||||
simulation = common.config->getBool(common.config->useSimuData);
|
simulation = common.config->getBool(common.config->useSimuData);
|
||||||
buzzer_mode = common.config->getString(common.config->buzzerMode);
|
buzzer_mode = common.config->getString(common.config->buzzerMode);
|
||||||
@@ -60,7 +63,7 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
mode = 'N';
|
mode = 'N';
|
||||||
}
|
}
|
||||||
if (hasFRAM) fram.write(FRAM_VOLTAGE_MODE, mode);
|
if (hasFRAM) fram.write(FRAM_SYSTEM_MODE, mode);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// grab cursor keys to disable page navigation
|
// grab cursor keys to disable page navigation
|
||||||
|
|||||||
Reference in New Issue
Block a user