Compare commits

..

No commits in common. "15ca3614bafb664e57715b6f214cbbc927f23e1d" and "cf305e9f5a08ac160e0296478954be1e557acee4" have entirely different histories.

4 changed files with 18 additions and 71 deletions

View File

@ -47,6 +47,9 @@
class PageSystem : public Page
{
private:
GwConfigHandler *config;
GwLog *logger;
// NVRAM config options
String flashLED;
@ -69,8 +72,6 @@ private:
double homelat;
double homelon;
Nmea2kTwai *NMEA2000;
char mode = 'N'; // (N)ormal, (S)ettings, (C)onfiguration, (D)evice list, c(A)rd
int8_t editmode = -1; // marker for menu/edit/set function
@ -92,7 +93,6 @@ private:
} else {
mode = 'N';
}
if (hasFRAM) fram.write(FRAM_SYSTEM_MODE, mode);
}
void decMode() {
@ -111,7 +111,6 @@ private:
} else {
mode = 'D';
}
if (hasFRAM) fram.write(FRAM_SYSTEM_MODE, mode);
}
void displayModeNormal() {
@ -192,29 +191,6 @@ private:
}
#endif
// Uptime
int64_t uptime = esp_timer_get_time() / 1000000;
String uptime_unit;
if (uptime < 120) {
uptime_unit = " seconds";
} else {
if (uptime < 2 * 3600) {
uptime /= 60;
uptime_unit = " minutes";
} else if (uptime < 2 * 3600 * 24) {
uptime /= 3600;
uptime_unit = " hours";
} else {
uptime /= 86400;
uptime_unit = " days";
}
}
epd->setCursor(8, y0 + 80);
epd->print("Uptime:");
epd->setCursor(90, y0 + 80);
epd->print(uptime);
epd->print(uptime_unit);
// CPU speed config / active
epd->setCursor(202, y0);
epd->print("CPU speed:");
@ -405,10 +381,6 @@ private:
epd->setCursor(20, 100);
epd->print("TxD: ");
epd->print(String(commonData->status.n2kTx));
epd->setCursor(20, 140);
epd->printf("N2k source address: %d", NMEA2000->GetN2kSource());
}
void storeConfig() {
@ -421,10 +393,9 @@ public:
config = commonData->config;
logger = commonData->logger;
logger->logDebug(GwLog::LOG, "Instantiate PageSystem");
logger->logDebug(GwLog::LOG,"Instantiate PageSystem");
if (hasFRAM) {
mode = fram.read(FRAM_SYSTEM_MODE);
logger->logDebug(GwLog::LOG, "Loaded mode '%c' from FRAM", mode);
}
flashLED = common.config->getString(common.config->flashLED);
@ -481,6 +452,7 @@ public:
commonData->logger->logDebug(GwLog::LOG, "System keyboard handler");
if (key == 2) {
incMode();
if (hasFRAM) fram.write(FRAM_SYSTEM_MODE, mode);
return 0;
}
#ifdef BOARD_OBP60S3
@ -546,15 +518,9 @@ public:
}
}
void displayNew(PageData &pageData){
};
int displayPage(PageData &pageData){
// GwConfigHandler *config = commonData->config;
// GwLog *logger = commonData->logger;
NMEA2000 = pageData.api->getNMEA2000();
logger->logDebug(GwLog::LOG, "PageSystem: N2k source address=%d", NMEA2000->GetN2kSource());
GwConfigHandler *config = commonData->config;
GwLog *logger = commonData->logger;
// Optical warning by limit violation (unused)
if(flashLED == "Limit Violation"){
@ -563,11 +529,11 @@ public:
}
// Logging page information
logger->logDebug(GwLog::LOG,"Drawing at PageSystem, Mode=%c", mode);
LOG_DEBUG(GwLog::LOG,"Drawing at PageSystem, Mode=%c", mode);
// Get references from API
// NMEA2000 = pageData.api->getNMEA2000();
// LOG_DEBUG(GwLog::LOG,"N2k source address=%d", NMEA2000->GetN2kSource());
Nmea2kTwai *NMEA2000 = pageData.api->getNMEA2000();
LOG_DEBUG(GwLog::LOG,"N2k source address=%d", NMEA2000->GetN2kSource());
// Set display in partial refresh mode
epd->setPartialWindow(0, 0, epd->width(), epd->height());

View File

@ -1,19 +0,0 @@
- fix unstable accesspoint availability
- page refresh after page change and not connected to key codes
- fix sd card code
- config: getFloat, getDouble
- dseg7 font to new version
- new pages: ais, autopilot, epropulsion
- automate config.json generation with extra_task.py
- extend boatdata: ais, waypoints, alarms
- page clock: sunrise / sunset in local time or UTC
- implement alerts

View File

@ -45,7 +45,7 @@ void OBP60Init(GwApi *api){
String devicename = api->getConfig()->getConfigItem(api->getConfig()->deviceName,true)->asString();
api->getConfig()->setValue(GwConfigDefinitions::systemName, devicename, GwConfigInterface::ConfigType::HIDDEN);
logger->logDebug(GwLog::LOG,"obp60init running");
api->getLogger()->logDebug(GwLog::LOG,"obp60init running");
// Check I2C devices
@ -54,7 +54,7 @@ void OBP60Init(GwApi *api){
// Init power
String powermode = api->getConfig()->getConfigItem(api->getConfig()->powerMode,true)->asString();
logger->logDebug(GwLog::DEBUG,"Power Mode is: %s", powermode.c_str());
api->getLogger()->logDebug(GwLog::DEBUG,"Power Mode is: %s", powermode.c_str());
powerInit(powermode);
#ifdef BOARD_OBP40S3
@ -77,7 +77,7 @@ void OBP60Init(GwApi *api){
break;
}
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
logger->logDebug(GwLog::LOG,"SD card type %s of size %d MB detected", sdtype, cardSize);
LOG_DEBUG(GwLog::LOG,"SD card type %s of size %d MB detected", sdtype, cardSize);
}
}
@ -89,7 +89,7 @@ void OBP60Init(GwApi *api){
// Settings for e-paper display
String fastrefresh = api->getConfig()->getConfigItem(api->getConfig()->fastRefresh,true)->asString();
logger->logDebug(GwLog::DEBUG,"Fast Refresh Mode is: %s", fastrefresh.c_str());
api->getLogger()->logDebug(GwLog::DEBUG,"Fast Refresh Mode is: %s", fastrefresh.c_str());
#ifdef DISPLAY_GDEY042T81
if(fastrefresh == "true"){
static const bool useFastFullUpdate = true; // Enable fast full display update only for GDEY042T81
@ -108,11 +108,11 @@ void OBP60Init(GwApi *api){
// Get CPU speed
int freq = getCpuFrequencyMhz();
logger->logDebug(GwLog::LOG,"CPU speed at boot: %i MHz", freq);
api->getLogger()->logDebug(GwLog::LOG,"CPU speed at boot: %i MHz", freq);
// Settings for backlight
String backlightMode = api->getConfig()->getConfigItem(api->getConfig()->backlight,true)->asString();
logger->logDebug(GwLog::DEBUG,"Backlight Mode is: %s", backlightMode.c_str());
api->getLogger()->logDebug(GwLog::DEBUG,"Backlight Mode is: %s", backlightMode.c_str());
uint brightness = uint(api->getConfig()->getConfigItem(api->getConfig()->blBrightness,true)->asInt());
String backlightColor = api->getConfig()->getConfigItem(api->getConfig()->blColor,true)->asString();
if(String(backlightMode) == "On"){
@ -127,7 +127,7 @@ void OBP60Init(GwApi *api){
// Settings flash LED mode
String ledMode = api->getConfig()->getConfigItem(api->getConfig()->flashLED,true)->asString();
logger->logDebug(GwLog::DEBUG,"LED Mode is: %s", ledMode.c_str());
api->getLogger()->logDebug(GwLog::DEBUG,"LED Mode is: %s", ledMode.c_str());
if(String(ledMode) == "Off"){
setBlinkingLED(false);
}

View File

@ -30,7 +30,7 @@ lib_deps =
Update
[env]
platform = espressif32 @ 6.11.0
platform = espressif32 @ 6.9.0
framework = arduino
;platform_packages=
; framework-arduinoespressif32 @ 3.20017.0