aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/ergodox_ez/matrix.c15
-rw-r--r--keyboards/moonlander/matrix.c29
2 files changed, 44 insertions, 0 deletions
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) {
237 } 237 }
238 } 238 }
239} 239}
240
241// DO NOT REMOVE
242// Needed for proper wake/sleep
243void 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}
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) {
268 printf("\n"); 268 printf("\n");
269 } 269 }
270} 270}
271
272// DO NOT REMOVE
273// Needed for proper wake/sleep
274void 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}