From 684793360cdb08ac1e50a6d27e1796fadd527adb Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 9 May 2016 00:36:23 -0400 Subject: [PATCH] quantum accommodates more than 16 columns --- quantum/matrix.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/quantum/matrix.c b/quantum/matrix.c index 2dab6ae9..7d70f728 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -42,6 +42,13 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static matrix_row_t matrix_reversed_debouncing[MATRIX_COLS]; #endif + +#if MATRIX_COLS > 16 + #define SHIFTER 1UL +#else + #define SHIFTER 1 +#endif + static matrix_row_t read_cols(void); static void init_cols(void); static void unselect_rows(void); @@ -235,15 +242,15 @@ static matrix_row_t read_cols(void) #endif if ((col & 0xF0) == 0x20) { - result |= (PINB&(1<<(col & 0x0F)) ? 0 : (1<