diff options
-rw-r--r-- | common/charge_state_v2.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 0f48d2482f..5e3df653c6 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -611,6 +611,13 @@ void charger_task(void) curr.batt.flags |= BATT_FLAG_BAD_TEMPERATURE; } + /* If the battery thinks it's above 100%, don't believe it */ + if (curr.batt.state_of_charge > 100) { + CPRINTS("ignoring ridiculous batt.soc of %d%%", + curr.batt.state_of_charge); + curr.batt.flags |= BATT_FLAG_BAD_STATE_OF_CHARGE; + } + /* * Now decide what we want to do about it. We'll normally just * pass along whatever the battery wants to the charger. Note @@ -740,15 +747,6 @@ void charger_task(void) } /* - * If battery seems to be disconnected, we need to get it - * out of that state, even if the charge level is full. - */ - if (curr.batt.state_of_charge >= BATTERY_LEVEL_FULL && - !battery_seems_to_be_disconnected) - /* Full up. Stop charging */ - curr.state = ST_IDLE; - - /* * TODO(crosbug.com/p/27643): Quit trying if charging too long * without getting full (CONFIG_CHARGER_TIMEOUT_HOURS). */ |