Skip to content

Commit 16846a9

Browse files
committed
pbio/drv/charger: Don't show green when just plugged in.
1 parent f2067d0 commit 16846a9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
### Fixed
88
- Fixed low-battery warning on boot ([pybricks-micropython#292]) when the
99
voltage is not actually low.
10+
- Fixed light indidicator always briefly showing green when just plugged in
11+
or after rebooting ([pybricks-micropython#292]) even if battery is not
12+
actually full.
1013

1114
## [3.6.0b3] - 2025-02-14
1215

lib/pbio/drv/charger/charger_mp2639a.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,12 @@ PROCESS_THREAD(pbdrv_charger_mp2639a_process, ev, data) {
249249
// CHG signal is on (/CHG pin is logic low).
250250
pbdrv_charger_status = PBDRV_CHARGER_STATUS_CHARGE;
251251
} else {
252-
// CHG signal is off (/CHG pin is logic high).
253-
pbdrv_charger_status = PBDRV_CHARGER_STATUS_COMPLETE;
252+
// CHG signal is off (/CHG pin is logic high). This is only
253+
// valid after a few cycles. Otherwise it always briefly
254+
// appears as if it is full when just plugged in.
255+
pbdrv_charger_status = charge_count > 2 ?
256+
PBDRV_CHARGER_STATUS_COMPLETE :
257+
PBDRV_CHARGER_STATUS_DISCHARGE;
254258
}
255259
}
256260
} else {

0 commit comments

Comments
 (0)