Fix battery indicator when charged
This commit is contained in:
parent
35462cb7a0
commit
1e20303851
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user