From bc8438f739af6165656296c8cbacc108b1c20af1 Mon Sep 17 00:00:00 2001 From: Florian Didron Date: Sat, 17 Oct 2020 14:48:49 +0900 Subject: [PATCH] Fix/moonlander leds (#318) * Additionall fixes * fix spelling errors * Remove bad matrix wake code Co-authored-by: Drashna Jael're --- keyboards/moonlander/matrix.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/keyboards/moonlander/matrix.c b/keyboards/moonlander/matrix.c index a67a091705..8daebd6973 100644 --- a/keyboards/moonlander/matrix.c +++ b/keyboards/moonlander/matrix.c @@ -264,7 +264,7 @@ void matrix_print(void) { // Needed for proper wake/sleep void matrix_power_up(void) { - mcp23018_init(); + bool temp_launching = is_launching; // outputs setPinOutput(B10); @@ -274,6 +274,8 @@ void matrix_power_up(void) { setPinOutput(B14); setPinOutput(B15); + wait_us(30); + // inputs setPinInputLow(A0); setPinInputLow(A1); @@ -283,10 +285,16 @@ void matrix_power_up(void) { setPinInputLow(A7); setPinInputLow(B0); - memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - memset(matrix_debouncing_right, 0, MATRIX_COLS * sizeof(matrix_row_t)); - + mcp23018_init(); + is_launching = temp_launching; + if (!temp_launching) { + ML_LED_1(false); + ML_LED_2(false); + ML_LED_3(false); + ML_LED_4(false); + ML_LED_5(false); + ML_LED_6(false); + } // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) {