1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-06-26 18:02:35 +00:00

fix(core) fuel gauge not updated while charging is IDLE.

[no changelog]
This commit is contained in:
kopecdav 2025-05-09 13:07:18 +02:00 committed by kopecdav
parent 4b9fb839cd
commit 46272a854e

View File

@ -62,6 +62,11 @@ void fuel_gauge_initial_guess(fuel_gauge_state_t* state, float voltage_V,
float fuel_gauge_update(fuel_gauge_state_t* state, uint32_t dt_ms, float fuel_gauge_update(fuel_gauge_state_t* state, uint32_t dt_ms,
float voltage_V, float current_mA, float temperature) { float voltage_V, float current_mA, float temperature) {
if (current_mA == 0.0f) {
// No current flow, return latched SOC without updating
return state->soc_latched;
}
// Determine if we're in discharge mode // Determine if we're in discharge mode
bool discharging_mode = current_mA >= 0.0f; bool discharging_mode = current_mA >= 0.0f;