mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-05 02:39:57 +02:00
Add back value writing to Safety.cpp
This commit is contained in:
parent
9876d5b75b
commit
4a4ff1e16b
1 changed files with 2 additions and 0 deletions
|
@ -39,6 +39,7 @@ void update_machineryprotection() {
|
|||
if (datalayer.battery.status.reported_soc == 10000) //Scaled SOC% value is 100.00%
|
||||
{
|
||||
set_event(EVENT_BATTERY_FULL, 0);
|
||||
datalayer.battery.status.max_charge_power_W = 0;
|
||||
} else {
|
||||
clear_event(EVENT_BATTERY_FULL);
|
||||
}
|
||||
|
@ -47,6 +48,7 @@ void update_machineryprotection() {
|
|||
// Normally the BMS will send 0W allowed, but this acts as an additional layer of safety
|
||||
if (datalayer.battery.status.reported_soc == 0) { //Scaled SOC% value is 0.00%
|
||||
set_event(EVENT_BATTERY_EMPTY, 0);
|
||||
datalayer.battery.status.max_discharge_power_W = 0;
|
||||
} else {
|
||||
clear_event(EVENT_BATTERY_EMPTY);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue