diff --git a/Software/src/battery/RJXZS-BMS.cpp b/Software/src/battery/RJXZS-BMS.cpp index 47ab5b2c..4a2909e8 100644 --- a/Software/src/battery/RJXZS-BMS.cpp +++ b/Software/src/battery/RJXZS-BMS.cpp @@ -82,11 +82,11 @@ void update_values_battery() { //SOC% not available. Raise warning event if we go too long without SOC timespent_without_soc++; if (timespent_without_soc > FIVE_MINUTES) { - set_event(EVENT_SOC_PLAUSIBILITY_ERROR, 0); + set_event(EVENT_SOC_UNAVAILABLE, 0); } } else { //SOC is available, stop counting and clear error timespent_without_soc = 0; - clear_event(EVENT_SOC_PLAUSIBILITY_ERROR); + clear_event(EVENT_SOC_UNAVAILABLE); } datalayer.battery.status.soh_pptt; // This BMS does not have a SOH% formula diff --git a/Software/src/devboard/utils/events.cpp b/Software/src/devboard/utils/events.cpp index edaa046f..7ed7b121 100644 --- a/Software/src/devboard/utils/events.cpp +++ b/Software/src/devboard/utils/events.cpp @@ -145,6 +145,7 @@ void init_events(void) { events.entries[EVENT_DISCHARGE_LIMIT_EXCEEDED].level = EVENT_LEVEL_INFO; events.entries[EVENT_12V_LOW].level = EVENT_LEVEL_WARNING; events.entries[EVENT_SOC_PLAUSIBILITY_ERROR].level = EVENT_LEVEL_ERROR; + events.entries[EVENT_SOC_UNAVAILABLE].level = EVENT_LEVEL_WARNING; events.entries[EVENT_KWH_PLAUSIBILITY_ERROR].level = EVENT_LEVEL_INFO; events.entries[EVENT_BATTERY_EMPTY].level = EVENT_LEVEL_INFO; events.entries[EVENT_BATTERY_FULL].level = EVENT_LEVEL_INFO; @@ -255,6 +256,8 @@ const char* get_event_message_string(EVENTS_ENUM_TYPE event) { return "12V battery source below required voltage to safely close contactors. Inspect the supply/battery!"; case EVENT_SOC_PLAUSIBILITY_ERROR: return "ERROR: SOC% reported by battery not plausible. Restart battery!"; + case EVENT_SOC_UNAVAILABLE: + return "Warning: SOC% not sent by BMS. Calibrate BMS via app."; case EVENT_KWH_PLAUSIBILITY_ERROR: return "Info: kWh remaining reported by battery not plausible. Battery needs cycling."; case EVENT_BATTERY_EMPTY: diff --git a/Software/src/devboard/utils/events.h b/Software/src/devboard/utils/events.h index 34ce9282..b536790f 100644 --- a/Software/src/devboard/utils/events.h +++ b/Software/src/devboard/utils/events.h @@ -6,7 +6,7 @@ // #define INCLUDE_EVENTS_TEST // Enable to run an event test loop, see events_test_on_target.cpp -#define EE_MAGIC_HEADER_VALUE 0x0011 // 0x0000 to 0xFFFF +#define EE_MAGIC_HEADER_VALUE 0x0012 // 0x0000 to 0xFFFF #define GENERATE_ENUM(ENUM) ENUM, #define GENERATE_STRING(STRING) #STRING, @@ -38,6 +38,7 @@ XX(EVENT_WATER_INGRESS) \ XX(EVENT_12V_LOW) \ XX(EVENT_SOC_PLAUSIBILITY_ERROR) \ + XX(EVENT_SOC_UNAVAILABLE) \ XX(EVENT_KWH_PLAUSIBILITY_ERROR) \ XX(EVENT_BATTERY_EMPTY) \ XX(EVENT_BATTERY_FULL) \