Fix undervoltage detection, format error
This commit is contained in:
parent
ba6c1038af
commit
175f525bcd
|
@ -493,19 +493,19 @@ 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 && deltaV < 4.15){
|
||||
sensors.BatteryChargeStatus = 1; // Charging active
|
||||
}
|
||||
if(deltaV < -0.04 || deltaV >= 4,15){ // Charging stops by grater than 4,15V
|
||||
if(deltaV < -0.04 || deltaV >= 4.15){ // Charging stops by grater than 4,15V
|
||||
sensors.BatteryChargeStatus = 0; // Discharging
|
||||
}
|
||||
}
|
||||
// Lower limits for higher voltages
|
||||
else{
|
||||
if(deltaV > 0.03 && deltaV < 4,15){
|
||||
if(deltaV > 0.03 && deltaV < 4.15){
|
||||
sensors.BatteryChargeStatus = 1; // Charging active
|
||||
}
|
||||
if(deltaV < -0.03 || deltaV >= 4,15){ // Charging stops by grater than 4,15V
|
||||
if(deltaV < -0.03 || deltaV >= 4.15){ // Charging stops by grater than 4,15V
|
||||
sensors.BatteryChargeStatus = 0; // Discharging
|
||||
}
|
||||
}
|
||||
|
|
|
@ -337,7 +337,7 @@ void underVoltageDetection(GwApi *api, CommonData &common){
|
|||
getdisplay().print("Undervoltage");
|
||||
getdisplay().setFont(&Ubuntu_Bold8pt7b);
|
||||
getdisplay().setCursor(65, 175);
|
||||
getdisplay().print("Charge battery and restart");
|
||||
getdisplay().print("Charge battery and restart system");
|
||||
getdisplay().nextPage(); // Partial update
|
||||
getdisplay().powerOff(); // Display power off
|
||||
setPortPin(OBP_POWER_EPD, false); // Power off ePaper display
|
||||
|
|
Loading…
Reference in New Issue