Send SWI on lid open

This commit is contained in:
Jeremy Soller
2020-01-13 20:40:29 -07:00
parent c1236b9e4a
commit 2e6a556e4b
2 changed files with 21 additions and 5 deletions

View File

@@ -72,8 +72,10 @@ void touchpad_event(struct Ps2 * ps2) {
}
}
bool lid_wake = false;
void lid_event(void) {
extern struct Gpio __code LID_SW_N;
extern struct Gpio __code SWI_N;
static bool send_sci = true;
static bool last = true;
@@ -87,6 +89,16 @@ void lid_event(void) {
DEBUG("open\n");
//TODO: send SWI if needed
if (lid_wake) {
gpio_set(&SWI_N, false);
//TODO: find correct delay
delay_ticks(10);
gpio_set(&SWI_N, true);
lid_wake = false;
}
} else {
DEBUG("closed\n");
}