oryp6: Use a battery current of 0 to determine that battery is fully charged
This commit is contained in:
parent
c9a602c5af
commit
fc990f8043
@ -81,8 +81,8 @@ uint8_t acpi_read(uint8_t addr) {
|
||||
case 0x26:
|
||||
// If AC adapter connected
|
||||
if (!gpio_get(&ACIN_N)) {
|
||||
// And battery is not fully charged
|
||||
if (!(battery_status & 0x0020)) {
|
||||
// And battery is using current
|
||||
if (battery_current != 0) {
|
||||
// Battery is charging
|
||||
data |= 1 << 1;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ void board_event(void) {
|
||||
// Discharging (no AC adapter)
|
||||
gpio_set(&LED_BAT_CHG_N, true);
|
||||
gpio_set(&LED_BAT_FULL, false);
|
||||
} else if (battery_status & 0x0020) {
|
||||
} else if (battery_current == 0) {
|
||||
// Fully charged
|
||||
// TODO: turn off charger
|
||||
gpio_set(&LED_BAT_CHG_N, true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user