From 6aae926b5f90f9e05e4dd022a5b94f0ab52c8614 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 14 Oct 2020 08:23:08 -0700 Subject: Fix issues with suspend code for ZSA split boards (#10640) --- keyboards/ergodox_ez/matrix.c | 15 +++++++++++++++ keyboards/moonlander/matrix.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) (limited to 'keyboards') diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 685ce5009..c091b6eb9 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -237,3 +237,18 @@ static void select_row(uint8_t row) { } } } + +// DO NOT REMOVE +// Needed for proper wake/sleep +void matrix_power_up(void) { + mcp23018_status = init_mcp23018(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } + +} diff --git a/keyboards/moonlander/matrix.c b/keyboards/moonlander/matrix.c index b90c1b59e..df498bd6e 100644 --- a/keyboards/moonlander/matrix.c +++ b/keyboards/moonlander/matrix.c @@ -268,3 +268,32 @@ void matrix_print(void) { printf("\n"); } } + +// DO NOT REMOVE +// Needed for proper wake/sleep +void matrix_power_up(void) { + mcp23018_init(); + + // outputs + setPinOutput(B10); + setPinOutput(B11); + setPinOutput(B12); + setPinOutput(B13); + setPinOutput(B14); + setPinOutput(B15); + + // inputs + setPinInputLow(A0); + setPinInputLow(A1); + setPinInputLow(A2); + setPinInputLow(A3); + setPinInputLow(A6); + setPinInputLow(A7); + setPinInputLow(B0); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + } + +} -- cgit v1.2.3-70-g09d2