diff options
-rwxr-xr-x | drivers/avr/i2c_master.c | 2 | ||||
-rw-r--r-- | keyboards/ergodox_ez/config.h | 5 | ||||
-rw-r--r-- | keyboards/ergodox_ez/ergodox_ez.c | 14 | ||||
-rw-r--r-- | keyboards/ergodox_ez/matrix.c | 8 |
4 files changed, 14 insertions, 15 deletions
diff --git a/drivers/avr/i2c_master.c b/drivers/avr/i2c_master.c index bcf92153c..cd3c2e1c8 100755 --- a/drivers/avr/i2c_master.c +++ b/drivers/avr/i2c_master.c | |||
@@ -21,7 +21,7 @@ void i2c_init(void) | |||
21 | uint8_t i2c_start(uint8_t address) | 21 | uint8_t i2c_start(uint8_t address) |
22 | { | 22 | { |
23 | // reset TWI control register | 23 | // reset TWI control register |
24 | //TWCR = 0; | 24 | TWCR = 0; |
25 | // transmit START condition | 25 | // transmit START condition |
26 | TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN); | 26 | TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN); |
27 | // wait for end of transmission | 27 | // wait for end of transmission |
diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h index 3dfe8733c..1285cbe1c 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/ergodox_ez/config.h | |||
@@ -81,10 +81,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
81 | /* fix space cadet rollover issue */ | 81 | /* fix space cadet rollover issue */ |
82 | #define DISABLE_SPACE_CADET_ROLLOVER | 82 | #define DISABLE_SPACE_CADET_ROLLOVER |
83 | 83 | ||
84 | // #define RGB_MIDI | 84 | // #define RGBW_BB_TWI |
85 | #define RGBW_BB_TWI | ||
86 | 85 | ||
87 | #define RGBW 1 | 86 | // #define RGBW 1 |
88 | 87 | ||
89 | /* "debounce" is measured in keyboard scans. Some users reported | 88 | /* "debounce" is measured in keyboard scans. Some users reported |
90 | * needing values as high as 15, which was at the time around 50ms. | 89 | * 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 b393d73d7..3a2d1273f 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c | |||
@@ -113,13 +113,13 @@ uint8_t init_mcp23018(void) { | |||
113 | // sreg_prev=SREG; | 113 | // sreg_prev=SREG; |
114 | // cli(); | 114 | // cli(); |
115 | 115 | ||
116 | // if (i2c_initialized == 0) { | 116 | if (i2c_initialized == 0) { |
117 | // i2c_init(); // on pins D(1,0) | 117 | i2c_init(); // on pins D(1,0) |
118 | // i2c_initialized = true; | 118 | i2c_initialized = true; |
119 | // _delay_ms(1000); | 119 | _delay_ms(1000); |
120 | // } | 120 | } |
121 | i2c_init(); // on pins D(1,0) | 121 | // i2c_init(); // on pins D(1,0) |
122 | _delay_ms(1000); | 122 | // _delay_ms(1000); |
123 | 123 | ||
124 | // set pin direction | 124 | // set pin direction |
125 | // - unused : input : 1 | 125 | // - unused : input : 1 |
diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 6660af46a..8b117166f 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c | |||
@@ -68,8 +68,8 @@ static void init_cols(void); | |||
68 | static void unselect_rows(void); | 68 | static void unselect_rows(void); |
69 | static void select_row(uint8_t row); | 69 | static void select_row(uint8_t row); |
70 | 70 | ||
71 | // static uint8_t mcp23018_reset_loop; | 71 | static uint8_t mcp23018_reset_loop; |
72 | static uint16_t mcp23018_reset_loop; | 72 | // static uint16_t mcp23018_reset_loop; |
73 | 73 | ||
74 | #ifdef DEBUG_MATRIX_SCAN_RATE | 74 | #ifdef DEBUG_MATRIX_SCAN_RATE |
75 | uint32_t matrix_timer; | 75 | uint32_t matrix_timer; |
@@ -176,8 +176,8 @@ void debounce_report(matrix_row_t change, uint8_t row) { | |||
176 | uint8_t matrix_scan(void) | 176 | uint8_t matrix_scan(void) |
177 | { | 177 | { |
178 | if (mcp23018_status) { // if there was an error | 178 | if (mcp23018_status) { // if there was an error |
179 | // if (++mcp23018_reset_loop == 0) { | 179 | if (++mcp23018_reset_loop == 0) { |
180 | if (++mcp23018_reset_loop >= 1300) { | 180 | // if (++mcp23018_reset_loop >= 1300) { |
181 | // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans | 181 | // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans |
182 | // this will be approx bit more frequent than once per second | 182 | // this will be approx bit more frequent than once per second |
183 | print("trying to reset mcp23018\n"); | 183 | print("trying to reset mcp23018\n"); |