Skip to content

Commit 6aae926

Browse files
authored
Fix issues with suspend code for ZSA split boards (qmk#10640)
1 parent 49dd1ed commit 6aae926

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

keyboards/ergodox_ez/matrix.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,18 @@ static void select_row(uint8_t row) {
237237
}
238238
}
239239
}
240+
241+
// DO NOT REMOVE
242+
// Needed for proper wake/sleep
243+
void matrix_power_up(void) {
244+
mcp23018_status = init_mcp23018();
245+
246+
unselect_rows();
247+
init_cols();
248+
249+
// initialize matrix state: all keys off
250+
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
251+
matrix[i] = 0;
252+
}
253+
254+
}

keyboards/moonlander/matrix.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,32 @@ void matrix_print(void) {
268268
printf("\n");
269269
}
270270
}
271+
272+
// DO NOT REMOVE
273+
// Needed for proper wake/sleep
274+
void matrix_power_up(void) {
275+
mcp23018_init();
276+
277+
// outputs
278+
setPinOutput(B10);
279+
setPinOutput(B11);
280+
setPinOutput(B12);
281+
setPinOutput(B13);
282+
setPinOutput(B14);
283+
setPinOutput(B15);
284+
285+
// inputs
286+
setPinInputLow(A0);
287+
setPinInputLow(A1);
288+
setPinInputLow(A2);
289+
setPinInputLow(A3);
290+
setPinInputLow(A6);
291+
setPinInputLow(A7);
292+
setPinInputLow(B0);
293+
294+
// initialize matrix state: all keys off
295+
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
296+
matrix[i] = 0;
297+
}
298+
299+
}

0 commit comments

Comments
 (0)