Change default state of bms_Status to INACTIVE and only switch to ACTIVE upon reception of SOC from battery.

- Change default state of bms_Status to INACTIVE
- switch to ACTIVE upon reception of SOC from battery.
- Do not change bms_mode to ACTIVE upon reception of info/warning/debug event.
- Reset bms_mode to INACTIVE and CAN_battery_still_alive when resetting all events
This commit is contained in:
mvgalen 2024-12-21 21:02:43 +01:00
parent dccfca17ea
commit f6c73e9481
26 changed files with 61 additions and 2 deletions

View file

@ -255,6 +255,9 @@ void reset_all_events() {
events.entries[i].MQTTpublished = false; // Not published by default
}
events.level = EVENT_LEVEL_INFO;
datalayer.battery.status.CAN_battery_still_alive = CAN_STILL_ALIVE;
datalayer.battery.status.bms_status = INACTIVE;
update_bms_status();
}
@ -495,7 +498,6 @@ static void update_bms_status(void) {
case EVENT_LEVEL_INFO:
case EVENT_LEVEL_WARNING:
case EVENT_LEVEL_DEBUG:
datalayer.battery.status.bms_status = ACTIVE;
break;
case EVENT_LEVEL_UPDATE:
datalayer.battery.status.bms_status = UPDATING;