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

@ -221,26 +221,32 @@ bool kbscan_press(uint16_t key, bool pressed, uint8_t * layer) {
break;
case (KT_SCI):
if (pressed) {
uint8_t sci = (uint8_t)(key & 0xFF);
if (!pmc_sci(&PMC_1, sci)) {
// In the case of ignored SCI, reset bit
return false;
// Send SCI if ACPI OS is loaded
if (acpi_ecos != EC_OS_NONE) {
uint8_t sci = (uint8_t)(key & 0xFF);
if (!pmc_sci(&PMC_1, sci)) {
// In the case of ignored SCI, reset bit
return false;
}
}
// Handle hardware hotkeys
hardware_hotkey(key);
}
break;
case (KT_SCI_EXTRA):
if (pressed) {
uint8_t sci = SCI_EXTRA;
sci_extra = (uint8_t)(key & 0xFF);
if (!pmc_sci(&PMC_1, sci)) {
// In the case of ignored SCI, reset bit
return false;
// Send SCI if ACPI OS is loaded
if (acpi_ecos != EC_OS_NONE) {
uint8_t sci = SCI_EXTRA;
sci_extra = (uint8_t)(key & 0xFF);
if (!pmc_sci(&PMC_1, sci)) {
// In the case of ignored SCI, reset bit
return false;
}
}
// Handle hardware hotkeys
hardware_hotkey(key);
}
break;