Improve SOC and load LED behavior at low SOC

This commit prevents that the SOC bar shows 2 LEDs already even though the load is still switched of because of low voltage.
This commit is contained in:
Martin Jaeger
2019-07-11 17:50:40 +02:00
parent 3a2af7ccc7
commit 17b044d941
3 changed files with 8 additions and 5 deletions
+3 -3
View File
@@ -228,7 +228,7 @@ void leds_toggle_error()
}
//----------------------------------------------------------------------------
void leds_update_soc(int soc)
void leds_update_soc(int soc, bool load_off_low_soc)
{
#ifndef LED_DCDC
// if there is no dedicated LED for the DC/DC converter status, blink SOC
@@ -246,12 +246,12 @@ void leds_update_soc(int soc)
trigger_timeout[LED_SOC_1] = -1;
trigger_timeout[LED_SOC_2] = -1;
trigger_timeout[LED_SOC_3] = -1;
if (soc > 80) {
if (soc > 80 && !load_off_low_soc) {
led_states[LED_SOC_1] = blink_chg;
led_states[LED_SOC_2] = LED_STATE_ON;
led_states[LED_SOC_3] = LED_STATE_ON;
}
else if (soc > 20) {
else if (soc > 20 && !load_off_low_soc) {
led_states[LED_SOC_1] = LED_STATE_OFF;
led_states[LED_SOC_2] = blink_chg;
led_states[LED_SOC_3] = LED_STATE_ON;