mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
add PERIODIC BMS RESET Events
This commit is contained in:
parent
c4eae97cda
commit
b75d5fb20f
4 changed files with 106 additions and 106 deletions
|
@ -130,9 +130,9 @@ void setup() {
|
||||||
#ifdef PERIODIC_BMS_RESET_AT
|
#ifdef PERIODIC_BMS_RESET_AT
|
||||||
bmsResetTimeOffset = getTimeOffsetfromNowUntil(PERIODIC_BMS_RESET_AT);
|
bmsResetTimeOffset = getTimeOffsetfromNowUntil(PERIODIC_BMS_RESET_AT);
|
||||||
if (bmsResetTimeOffset == 0) {
|
if (bmsResetTimeOffset == 0) {
|
||||||
set_event(EVENT_BMS_RESET_AT_INIT_FAILED, 0);
|
set_event(EVENT_PERIODIC_BMS_RESET_AT_INIT_FAILED, 0);
|
||||||
} else {
|
} else {
|
||||||
set_event(EVENT_BMS_RESET_AT_INIT_SUCCESS, 0);
|
set_event(EVENT_PERIODIC_BMS_RESET_AT_INIT_SUCCESS, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,7 +266,7 @@ void handle_BMSpower() {
|
||||||
setBatteryPause(false, false, false, false);
|
setBatteryPause(false, false, false, false);
|
||||||
|
|
||||||
datalayer.system.status.BMS_reset_in_progress = false; // Reset the power removal flag
|
datalayer.system.status.BMS_reset_in_progress = false; // Reset the power removal flag
|
||||||
set_event(EVENT_BMS_RESET, 0);
|
set_event(EVENT_PERIODIC_BMS_RESET, 0);
|
||||||
}
|
}
|
||||||
#endif //defined(PERIODIC_BMS_RESET) || defined(REMOTE_BMS_RESET)
|
#endif //defined(PERIODIC_BMS_RESET) || defined(REMOTE_BMS_RESET)
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,9 +218,9 @@ void init_events(void) {
|
||||||
events.entries[EVENT_MQTT_DISCONNECT].level = EVENT_LEVEL_INFO;
|
events.entries[EVENT_MQTT_DISCONNECT].level = EVENT_LEVEL_INFO;
|
||||||
events.entries[EVENT_EQUIPMENT_STOP].level = EVENT_LEVEL_ERROR;
|
events.entries[EVENT_EQUIPMENT_STOP].level = EVENT_LEVEL_ERROR;
|
||||||
events.entries[EVENT_SD_INIT_FAILED].level = EVENT_LEVEL_WARNING;
|
events.entries[EVENT_SD_INIT_FAILED].level = EVENT_LEVEL_WARNING;
|
||||||
events.entries[EVENT_BMS_RESET].level = EVENT_LEVEL_INFO;
|
events.entries[EVENT_PERIODIC_BMS_RESET].level = EVENT_LEVEL_INFO;
|
||||||
events.entries[EVENT_BMS_RESET_AT_INIT_SUCCESS].level = EVENT_LEVEL_WARNING;
|
events.entries[EVENT_PERIODIC_BMS_RESET_AT_INIT_SUCCESS].level = EVENT_LEVEL_INFO;
|
||||||
events.entries[EVENT_BMS_RESET_AT_INIT_FAILED].level = EVENT_LEVEL_WARNING;
|
events.entries[EVENT_PERIODIC_BMS_RESET_AT_INIT_FAILED].level = EVENT_LEVEL_WARNING;
|
||||||
|
|
||||||
events.entries[EVENT_EEPROM_WRITE].log = false; // Don't log the logger...
|
events.entries[EVENT_EEPROM_WRITE].log = false; // Don't log the logger...
|
||||||
|
|
||||||
|
@ -449,12 +449,12 @@ const char* get_event_message_string(EVENTS_ENUM_TYPE event) {
|
||||||
return "EQUIPMENT STOP ACTIVATED!!!";
|
return "EQUIPMENT STOP ACTIVATED!!!";
|
||||||
case EVENT_SD_INIT_FAILED:
|
case EVENT_SD_INIT_FAILED:
|
||||||
return "SD card initialization failed, check hardware. Power must be removed to reset the SD card.";
|
return "SD card initialization failed, check hardware. Power must be removed to reset the SD card.";
|
||||||
case EVENT_BMS_RESET:
|
case EVENT_PERIODIC_BMS_RESET:
|
||||||
return "BMS Reset Event Completed.";
|
return "BMS Reset Event Completed.";
|
||||||
case EVENT_BMS_RESET_AT_INIT_SUCCESS:
|
case EVENT_PERIODIC_BMS_RESET_AT_INIT_SUCCESS:
|
||||||
return "Successfully Syncronised with the NTP Server BMS will reset every 24 hours at defined time";
|
return "Successfully syncronised with the NTP Server. BMS will reset every 24 hours at defined time";
|
||||||
case EVENT_BMS_RESET_AT_INIT_FAILED:
|
case EVENT_PERIODIC_BMS_RESET_AT_INIT_FAILED:
|
||||||
return "Failed to syncronise with the NTP Server BMS will reset every 24 hours from when the emulator was "
|
return "Failed to syncronise with the NTP Server. BMS will reset every 24 hours from when the emulator was "
|
||||||
"powered on";
|
"powered on";
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -116,10 +116,10 @@
|
||||||
XX(EVENT_EQUIPMENT_STOP) \
|
XX(EVENT_EQUIPMENT_STOP) \
|
||||||
XX(EVENT_AUTOMATIC_PRECHARGE_FAILURE) \
|
XX(EVENT_AUTOMATIC_PRECHARGE_FAILURE) \
|
||||||
XX(EVENT_SD_INIT_FAILED) \
|
XX(EVENT_SD_INIT_FAILED) \
|
||||||
XX(EVENT_NOF_EVENTS) \
|
XX(EVENT_PERIODIC_BMS_RESET) \
|
||||||
XX(EVENT_BMS_RESET) \
|
XX(EVENT_PERIODIC_BMS_RESET_AT_INIT_SUCCESS) \
|
||||||
XX(EVENT_BMS_RESET_AT_INIT_SUCCESS) \
|
XX(EVENT_PERIODIC_BMS_RESET_AT_INIT_FAILED) \
|
||||||
XX(EVENT_BMS_RESET_AT_INIT_FAILED)
|
XX(EVENT_NOF_EVENTS)
|
||||||
|
|
||||||
typedef enum { EVENTS_ENUM_TYPE(GENERATE_ENUM) } EVENTS_ENUM_TYPE;
|
typedef enum { EVENTS_ENUM_TYPE(GENERATE_ENUM) } EVENTS_ENUM_TYPE;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue