1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-03-28 18:06:37 +01:00

Code rework at page system. Preparation for config menu.

This commit is contained in:
2025-07-31 11:39:23 +02:00
parent 588008e370
commit f4d88f1b8b
4 changed files with 374 additions and 263 deletions

View File

@@ -54,31 +54,13 @@ void OBP60Init(GwApi *api){
// Check I2C devices
// Init hardware
hardwareInit(api);
// Init power rail 5.0V
// Init power
String powermode = api->getConfig()->getConfigItem(api->getConfig()->powerMode,true)->asString();
api->getLogger()->logDebug(GwLog::DEBUG,"Power Mode is: %s", powermode.c_str());
if(powermode == "Max Power" || powermode == "Only 5.0V"){
#ifdef HARDWARE_V21
setPortPin(OBP_POWER_50, true); // Power on 5.0V rail
#endif
#ifdef BOARD_OBP40S3
setPortPin(OBP_POWER_EPD, true);// Power on ePaper display
setPortPin(OBP_POWER_SD, true); // Power on SD card
#endif
}
else{
#ifdef HARDWARE_V21
setPortPin(OBP_POWER_50, false); // Power off 5.0V rail
#endif
#ifdef BOARD_OBP40S3
setPortPin(OBP_POWER_EPD, false);// Power off ePaper display
setPortPin(OBP_POWER_SD, false); // Power off SD card
#endif
}
powerInit(powermode);
#ifdef BOARD_OBP40S3
bool sdcard = config->getBool(config->useSDCard);