From b8564f5dd08f49ee0fc6d28957a376132bd7038d Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 12 Jun 2018 14:27:22 -0400 Subject: revert some attempts, update i2c --- keyboards/ergodox_ez/config.h | 5 ++--- keyboards/ergodox_ez/ergodox_ez.c | 14 +++++++------- keyboards/ergodox_ez/matrix.c | 8 ++++---- 3 files changed, 13 insertions(+), 14 deletions(-) (limited to 'keyboards/ergodox_ez') diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h index 3dfe8733cb..1285cbe1c9 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/ergodox_ez/config.h @@ -81,10 +81,9 @@ along with this program. If not, see . /* fix space cadet rollover issue */ #define DISABLE_SPACE_CADET_ROLLOVER -// #define RGB_MIDI -#define RGBW_BB_TWI +// #define RGBW_BB_TWI -#define RGBW 1 +// #define RGBW 1 /* "debounce" is measured in keyboard scans. Some users reported * needing values as high as 15, which was at the time around 50ms. diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c index b393d73d7e..3a2d1273fa 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c @@ -113,13 +113,13 @@ uint8_t init_mcp23018(void) { // sreg_prev=SREG; // cli(); - // if (i2c_initialized == 0) { - // i2c_init(); // on pins D(1,0) - // i2c_initialized = true; - // _delay_ms(1000); - // } - i2c_init(); // on pins D(1,0) - _delay_ms(1000); + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized = true; + _delay_ms(1000); + } + // i2c_init(); // on pins D(1,0) + // _delay_ms(1000); // set pin direction // - unused : input : 1 diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 6660af46a4..8b117166fb 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -68,8 +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 uint16_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; @@ -176,8 +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 >= 1300) { + 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