Fix battery indicator when charged

This commit is contained in:
Jeremy Soller 2020-02-17 13:46:39 -07:00
parent 35462cb7a0
commit 1e20303851
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
3 changed files with 24 additions and 6 deletions

View File

@ -59,9 +59,15 @@ uint8_t acpi_read(uint8_t addr) {
ACPI_16(0x1A, battery_full_capacity);
ACPI_16(0x22, battery_design_voltage);
// Bypass status test in ACPI - TODO
case 0x26:
data |= 1 << 1;
// If AC adapter connected
if (!gpio_get(&ACIN_N)) {
// And battery is not fully charged
if (!(battery_status & 0x0020)) {
// Battery is charging
data |= 1 << 1;
}
}
break;
ACPI_16(0x2A, battery_current);

View File

@ -74,9 +74,15 @@ uint8_t acpi_read(uint8_t addr) {
ACPI_16(0x1A, battery_full_capacity);
ACPI_16(0x22, battery_design_voltage);
// Bypass status test in ACPI - TODO
case 0x26:
data |= 1 << 1;
// If AC adapter connected
if (!gpio_get(&ACIN_N)) {
// And battery is not fully charged
if (!(battery_status & 0x0020)) {
// Battery is charging
data |= 1 << 1;
}
}
break;
ACPI_16(0x2A, battery_current);

View File

@ -74,9 +74,15 @@ uint8_t acpi_read(uint8_t addr) {
ACPI_16(0x1A, battery_full_capacity);
ACPI_16(0x22, battery_design_voltage);
// Bypass status test in ACPI - TODO
case 0x26:
data |= 1 << 1;
// If AC adapter connected
if (!gpio_get(&ACIN_N)) {
// And battery is not fully charged
if (!(battery_status & 0x0020)) {
// Battery is charging
data |= 1 << 1;
}
}
break;
ACPI_16(0x2A, battery_current);