Only send hotkey SCI if ACPI OS is loaded

This commit is contained in:
Jeremy Soller
2020-09-23 10:52:20 -06:00
committed by Jeremy Soller
parent 343722e350
commit 00043ebfaf
3 changed files with 29 additions and 18 deletions

View File

@ -370,9 +370,11 @@ void power_event(void) {
ac_send_sci = true;
}
if (ac_send_sci) {
// Send SCI 0x16 for AC detect event
if (pmc_sci(&PMC_1, 0x16)) {
ac_send_sci = false;
// Send SCI 0x16 for AC detect event if ACPI OS is loaded
if (acpi_ecos != EC_OS_NONE) {
if (pmc_sci(&PMC_1, 0x16)) {
ac_send_sci = false;
}
}
}
ac_last = ac_new;