mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 01:39:30 +02:00
Alter BMS_a145_SW_SOC_Change event to once only
This commit is contained in:
parent
95ee6ff9ae
commit
c6b7ff82c0
2 changed files with 5 additions and 2 deletions
|
@ -484,10 +484,12 @@ void TeslaBattery::
|
|||
clear_event(EVENT_BATTERY_FUSE);
|
||||
}
|
||||
// Raise any informational Tesla BMS events in BE
|
||||
if (BMS_a145_SW_SOC_Change == true) { // BMS has recalibrated pack SOC
|
||||
if (BMS_a145_SW_SOC_Change == true && !BMS_SW_SOC_Change_Latch) { // BMS has newly recalibrated pack SOC
|
||||
BMS_SW_SOC_Change_Latch = true; // Only set event once, BMS_a145 can be active for a while
|
||||
set_event(EVENT_BATTERY_SOC_RECALIBRATION, 0);
|
||||
} else {
|
||||
clear_event(EVENT_BATTERY_SOC_RECALIBRATION);
|
||||
} else if (BMS_a145_SW_SOC_Change == false) {
|
||||
BMS_SW_SOC_Change_Latch = false;
|
||||
}
|
||||
|
||||
if (user_selected_tesla_GTW_chassisType > 1) { //{{0, "Model S"}, {1, "Model X"}, {2, "Model 3"}, {3, "Model Y"}};
|
||||
|
|
|
@ -877,6 +877,7 @@ class TeslaBattery : public CanBattery {
|
|||
bool BMS_a141_SW_BMB_Status_Warning = false;
|
||||
bool BMS_a144_Hvp_Config_Mismatch = false;
|
||||
bool BMS_a145_SW_SOC_Change = false;
|
||||
bool BMS_SW_SOC_Change_Latch = false;
|
||||
bool BMS_a146_SW_Brick_Overdischarged = false;
|
||||
bool BMS_a149_SW_Missing_Config_Block = false;
|
||||
bool BMS_a151_SW_external_isolation = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue