Skip to content

Commit e9697b5

Browse files
committed
fl16: Use core powerdown and wakeup function
Don't try to outsmart the core quantum logic, let it handle the hard stuff. Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent c19e2bb commit e9697b5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

keyboards/framework/matrix.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,17 @@ static adc10ksample_t read_adc(void) {
262262
bool handle_idle(void) {
263263
bool lid_closed = !readPin(SLEEP_GPIO);
264264

265+
// If lid state is different from current suspend state,
266+
// adjust suspend state
267+
if (is_suspended != lid_closed) {
268+
if lid_closed {
269+
suspend_power_down();
270+
} else {
271+
suspend_wakeup_init();
272+
}
273+
}
274+
return lid_closed;
275+
265276
bool disable_backlight = lid_closed || is_suspended;
266277
if (disable_backlight) {
267278
led_suspend();

0 commit comments

Comments
 (0)