diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-10-16 08:50:50 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-10-16 08:50:50 +1100 |
| commit | f03093e5c27555c227e9c04114f59062c8289361 (patch) | |
| tree | 984f9b03a059e94a6fa7e9fb43cef26fc12e8f3b /src/battery/battery.cpp | |
| parent | f27670a112d90c6053e84b82d109793f87a40065 (diff) | |
| download | tangara-fw-f03093e5c27555c227e9c04114f59062c8289361.tar.gz | |
Remove early-exit when there's no battery
SAMD is currently returning incorrect states, so this is the cause of
the battery meter often reading 0 when not plugged in
Diffstat (limited to 'src/battery/battery.cpp')
| -rw-r--r-- | src/battery/battery.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/battery/battery.cpp b/src/battery/battery.cpp index 69ca9a7d..b3567ee5 100644 --- a/src/battery/battery.cpp +++ b/src/battery/battery.cpp @@ -57,13 +57,7 @@ auto Battery::Update() -> void { std::lock_guard<std::mutex> lock{state_mutex_}; auto charge_state = samd_.GetChargeStatus(); - if (charge_state && *charge_state == ChargeStatus::kNoBattery) { - if (state_) { - EmitEvent(); - } - state_.reset(); - return; - } + // FIXME: So what we *should* do here is measure the actual real-life // time from full battery -> empty battery, store it in NVS, then rely on // that. If someone could please do this, it would be lovely. Thanks! |
