mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 19:42:08 +02:00
Improve handling of bms_status for DOUBLE_BATTERY
This commit is contained in:
parent
f6c73e9481
commit
7d431f688d
2 changed files with 32 additions and 7 deletions
|
@ -258,6 +258,10 @@ void reset_all_events() {
|
||||||
|
|
||||||
datalayer.battery.status.CAN_battery_still_alive = CAN_STILL_ALIVE;
|
datalayer.battery.status.CAN_battery_still_alive = CAN_STILL_ALIVE;
|
||||||
datalayer.battery.status.bms_status = INACTIVE;
|
datalayer.battery.status.bms_status = INACTIVE;
|
||||||
|
#ifdef DOUBLE_BATTERY
|
||||||
|
datalayer.battery2.status.CAN_battery_still_alive = CAN_STILL_ALIVE;
|
||||||
|
datalayer.battery2.status.bms_status = INACTIVE;
|
||||||
|
#endif
|
||||||
update_bms_status();
|
update_bms_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,9 +505,15 @@ static void update_bms_status(void) {
|
||||||
break;
|
break;
|
||||||
case EVENT_LEVEL_UPDATE:
|
case EVENT_LEVEL_UPDATE:
|
||||||
datalayer.battery.status.bms_status = UPDATING;
|
datalayer.battery.status.bms_status = UPDATING;
|
||||||
|
#ifdef DOUBLE_BATTERY
|
||||||
|
datalayer.battery2.status.bms_status = UPDATING;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case EVENT_LEVEL_ERROR:
|
case EVENT_LEVEL_ERROR:
|
||||||
datalayer.battery.status.bms_status = FAULT;
|
datalayer.battery.status.bms_status = FAULT;
|
||||||
|
#ifdef DOUBLE_BATTERY
|
||||||
|
datalayer.battery2.status.bms_status = FAULT;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -932,13 +932,28 @@ String processor(const String& var) {
|
||||||
}
|
}
|
||||||
content += "<h4>Temperature max: " + String(tempMaxFloat, 1) + " C</h4>";
|
content += "<h4>Temperature max: " + String(tempMaxFloat, 1) + " C</h4>";
|
||||||
content += "<h4>Temperature min: " + String(tempMinFloat, 1) + " C</h4>";
|
content += "<h4>Temperature min: " + String(tempMinFloat, 1) + " C</h4>";
|
||||||
if (datalayer.battery.status.bms_status == ACTIVE) {
|
content += "<h4>System status: ";
|
||||||
content += "<h4>System status: OK </h4>";
|
switch (datalayer.battery2.status.bms_status) {
|
||||||
} else if (datalayer.battery.status.bms_status == UPDATING) {
|
case ACTIVE:
|
||||||
content += "<h4>System status: UPDATING </h4>";
|
content += String("OK");
|
||||||
} else {
|
break;
|
||||||
content += "<h4>System status: FAULT </h4>";
|
case UPDATING:
|
||||||
|
content += String("UPDATING");
|
||||||
|
break;
|
||||||
|
case FAULT:
|
||||||
|
content += String("FAULT");
|
||||||
|
break;
|
||||||
|
case INACTIVE:
|
||||||
|
content += String("INACTIVE");
|
||||||
|
break;
|
||||||
|
case STANDBY:
|
||||||
|
content += String("STANDBY");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
content += String("??");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
content += "</h4>";
|
||||||
if (datalayer.battery2.status.current_dA == 0) {
|
if (datalayer.battery2.status.current_dA == 0) {
|
||||||
content += "<h4>Battery idle</h4>";
|
content += "<h4>Battery idle</h4>";
|
||||||
} else if (datalayer.battery2.status.current_dA < 0) {
|
} else if (datalayer.battery2.status.current_dA < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue