From c0095710a7c7e9bd94aa9f4dd814dc28d718c731 Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Thu, 24 May 2018 09:18:36 -0400 Subject: a failed attempt at hot-plugging --- keyboards/ergodox_ez/matrix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'keyboards/ergodox_ez/matrix.c') diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 2aad99781..6660af46a 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -68,7 +68,8 @@ static void init_cols(void); static void unselect_rows(void); static void select_row(uint8_t row); -static uint8_t mcp23018_reset_loop; +// static uint8_t mcp23018_reset_loop; +static uint16_t mcp23018_reset_loop; #ifdef DEBUG_MATRIX_SCAN_RATE uint32_t matrix_timer; @@ -175,7 +176,8 @@ void debounce_report(matrix_row_t change, uint8_t row) { uint8_t matrix_scan(void) { if (mcp23018_status) { // if there was an error - if (++mcp23018_reset_loop == 0) { + // if (++mcp23018_reset_loop == 0) { + if (++mcp23018_reset_loop >= 1300) { // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans // this will be approx bit more frequent than once per second print("trying to reset mcp23018\n"); -- cgit v1.2.3-24-g4f1b