From c471bf4677bc77b29ad9c15806a7adbc58d5fef3 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Thu, 19 Jan 2023 11:50:39 +0800 Subject: [PATCH] lotus: Fix MUX Needs to be pulled low to enable Signed-off-by: Daniel Schaefer --- keyboards/lotus/matrix.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/keyboards/lotus/matrix.c b/keyboards/lotus/matrix.c index acbd37c035..0015e9480b 100644 --- a/keyboards/lotus/matrix.c +++ b/keyboards/lotus/matrix.c @@ -193,18 +193,22 @@ static void mux_select_row(int row) { switch (row) { case 0: index = 2; + break; case 1: index = 0; + break; case 2: index = 1; + break; default: index = row; + break; } int bits[] = { (index & 0x1) > 0, - (index & 0x4) > 0, - (index & 0x8) > 0 + (index & 0x2) > 0, + (index & 0x4) > 0 }; writePin(MUX_A, bits[0]); writePin(MUX_B, bits[1]); @@ -417,7 +421,12 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { * TODO: Do we need a de-init? Probably not. */ static void adc_mux_init(void) { - writePinHigh(MUX_ENABLE); + setPinOutput(MUX_ENABLE); + writePinLow(MUX_ENABLE); + + setPinOutput(MUX_A); + setPinOutput(MUX_B); + setPinOutput(MUX_C); } /**