diff --git a/lib/obp60task/OBPSensorTask.cpp b/lib/obp60task/OBPSensorTask.cpp index 445fb21..a6d112c 100644 --- a/lib/obp60task/OBPSensorTask.cpp +++ b/lib/obp60task/OBPSensorTask.cpp @@ -493,22 +493,26 @@ void sensorTask(void *param){ float deltaV = sensors.batteryVoltage - sensors.batteryVoltage10; // Higher limits for lower voltages if(sensors.batteryVoltage10 < 4.0){ - if(deltaV > 0.045 && deltaV < 4.15){ + if(deltaV > 0.045){ sensors.BatteryChargeStatus = 1; // Charging active } - if(deltaV < -0.04 || deltaV >= 4.15){ // Charging stops by grater than 4,15V + if(deltaV < -0.04){ sensors.BatteryChargeStatus = 0; // Discharging } } // Lower limits for higher voltages else{ - if(deltaV > 0.03 && deltaV < 4.15){ + if(deltaV > 0.03){ sensors.BatteryChargeStatus = 1; // Charging active } - if(deltaV < -0.03 || deltaV >= 4.15){ // Charging stops by grater than 4,15V + if(deltaV < -0.03){ sensors.BatteryChargeStatus = 0; // Discharging } } + // Charging stops by grater than 4,15V + if(sensors.batteryVoltage10 > 4.15){ + sensors.BatteryChargeStatus = 0; // Discharging + } // Send to NMEA200 bus as instance 10 if(!isnan(sensors.batteryVoltage)){ SetN2kDCBatStatus(N2kMsg, 10, sensors.batteryVoltage, N2kDoubleNA, N2kDoubleNA, 0); diff --git a/lib/obp60task/obp60task.cpp b/lib/obp60task/obp60task.cpp index 1b4b936..d92454b 100644 --- a/lib/obp60task/obp60task.cpp +++ b/lib/obp60task/obp60task.cpp @@ -78,8 +78,7 @@ void OBP60Init(GwApi *api){ } #ifdef BOARD_OBP40S3 -// String sdcard = config->getConfigItem(config->useSDCard, true)->asString(); - String sdcard = "on"; + String sdcard = config->getConfigItem(config->useSDCard, true)->asString(); if (sdcard == "on") { SPIClass SD_SPI = SPIClass(HSPI); SD_SPI.begin(SD_SPI_CLK, SD_SPI_MISO, SD_SPI_MOSI); @@ -413,8 +412,7 @@ void OBP60Task(GwApi *api){ String fastrefresh = api->getConfig()->getConfigItem(api->getConfig()->fastRefresh,true)->asString(); uint fullrefreshtime = uint(api->getConfig()->getConfigItem(api->getConfig()->fullRefreshTime,true)->asInt()); #ifdef BOARD_OBP40S3 -// bool syspage_enabled = config->getBool(config->systemPage); - bool syspage_enabled = true; + bool syspage_enabled = config->getBool(config->systemPage); #endif #ifdef DISPLAY_GDEY042T81