diff options
author | QMK Bot <hello@qmk.fm> | 2021-09-08 22:44:49 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2021-09-08 22:44:49 +0000 |
commit | 38afc7e4cca3d192963c68182f4f80db4e1445cb (patch) | |
tree | 3832085f777f40705302c56804f5142b6ff935b8 | |
parent | d977e5d3e90505089feb4fcc6109836e017ef8fd (diff) | |
parent | 2e0659f7fddd4c872b230c4a7d2e2a5517042414 (diff) | |
download | qmk_firmware-38afc7e4cca3d192963c68182f4f80db4e1445cb.tar.gz qmk_firmware-38afc7e4cca3d192963c68182f4f80db4e1445cb.zip |
Merge remote-tracking branch 'origin/master' into develop
-rw-r--r-- | keyboards/3w6/rev1/matrix.c | 2 | ||||
-rw-r--r-- | keyboards/3w6/rev2/matrix.c | 5 | ||||
-rw-r--r-- | keyboards/handwired/dactyl/dactyl.h | 2 | ||||
-rwxr-xr-x | keyboards/sx60/sx60.h | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/keyboards/3w6/rev1/matrix.c b/keyboards/3w6/rev1/matrix.c index af3d21067..ae2f96bfa 100644 --- a/keyboards/3w6/rev1/matrix.c +++ b/keyboards/3w6/rev1/matrix.c | |||
@@ -34,7 +34,7 @@ extern i2c_status_t tca9555_status; | |||
34 | // All address pins of the tca9555 are connected to the ground | 34 | // All address pins of the tca9555 are connected to the ground |
35 | // | 0 | 1 | 0 | 0 | A2 | A1 | A0 | | 35 | // | 0 | 1 | 0 | 0 | A2 | A1 | A0 | |
36 | // | 0 | 1 | 0 | 0 | 0 | 0 | 0 | | 36 | // | 0 | 1 | 0 | 0 | 0 | 0 | 0 | |
37 | #define I2C_ADDR 0b0100000 | 37 | #define I2C_ADDR (0b0100000 << 1) |
38 | 38 | ||
39 | // Register addresses | 39 | // Register addresses |
40 | #define IODIRA 0x06 // i/o direction register | 40 | #define IODIRA 0x06 // i/o direction register |
diff --git a/keyboards/3w6/rev2/matrix.c b/keyboards/3w6/rev2/matrix.c index 0fc0322b6..c47c24e1d 100644 --- a/keyboards/3w6/rev2/matrix.c +++ b/keyboards/3w6/rev2/matrix.c | |||
@@ -34,7 +34,7 @@ extern i2c_status_t tca9555_status; | |||
34 | // All address pins of the tca9555 are connected to the ground | 34 | // All address pins of the tca9555 are connected to the ground |
35 | // | 0 | 1 | 0 | 0 | A2 | A1 | A0 | | 35 | // | 0 | 1 | 0 | 0 | A2 | A1 | A0 | |
36 | // | 0 | 1 | 0 | 0 | 0 | 0 | 0 | | 36 | // | 0 | 1 | 0 | 0 | 0 | 0 | 0 | |
37 | #define I2C_ADDR 0b0100000 | 37 | #define I2C_ADDR (0b0100000 << 1) |
38 | 38 | ||
39 | // Register addresses | 39 | // Register addresses |
40 | #define IODIRA 0x06 // i/o direction register | 40 | #define IODIRA 0x06 // i/o direction register |
@@ -192,6 +192,7 @@ static matrix_row_t read_cols(uint8_t row) { | |||
192 | // do nothing | 192 | // do nothing |
193 | return 0; | 193 | return 0; |
194 | } else { | 194 | } else { |
195 | port0 = ~port0; | ||
195 | // We read all the pins on GPIOA. | 196 | // We read all the pins on GPIOA. |
196 | // The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero. | 197 | // The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero. |
197 | // The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys. | 198 | // The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys. |
@@ -247,7 +248,7 @@ static void select_row(uint8_t row) { | |||
247 | default: break; | 248 | default: break; |
248 | } | 249 | } |
249 | 250 | ||
250 | tca9555_status = i2c_writeReg(I2C_ADDR, OREGP1, &port1, 2, I2C_TIMEOUT); | 251 | tca9555_status = i2c_writeReg(I2C_ADDR, OREGP1, &port1, 1, I2C_TIMEOUT); |
251 | // Select the desired row by writing a byte for the entire GPIOB bus where only the bit representing the row we want to select is a zero (write instruction) and every other bit is a one. | 252 | // Select the desired row by writing a byte for the entire GPIOB bus where only the bit representing the row we want to select is a zero (write instruction) and every other bit is a one. |
252 | // Note that the row - MATRIX_ROWS_PER_SIDE reflects the fact that being on the right hand, the columns are numbered from MATRIX_ROWS_PER_SIDE to MATRIX_ROWS, but the pins we want to write to are indexed from zero up on the GPIOB bus. | 253 | // Note that the row - MATRIX_ROWS_PER_SIDE reflects the fact that being on the right hand, the columns are numbered from MATRIX_ROWS_PER_SIDE to MATRIX_ROWS, but the pins we want to write to are indexed from zero up on the GPIOB bus. |
253 | } | 254 | } |
diff --git a/keyboards/handwired/dactyl/dactyl.h b/keyboards/handwired/dactyl/dactyl.h index fe45d1668..b901b6767 100644 --- a/keyboards/handwired/dactyl/dactyl.h +++ b/keyboards/handwired/dactyl/dactyl.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include "i2c_master.h" | 6 | #include "i2c_master.h" |
7 | #include <util/delay.h> | 7 | #include <util/delay.h> |
8 | 8 | ||
9 | #define I2C_ADDR 0b0100000 | 9 | #define I2C_ADDR (0b0100000 << 1) |
10 | #define I2C_TIMEOUT 100 | 10 | #define I2C_TIMEOUT 100 |
11 | #define IODIRA 0x00 // i/o direction register | 11 | #define IODIRA 0x00 // i/o direction register |
12 | #define IODIRB 0x01 | 12 | #define IODIRB 0x01 |
diff --git a/keyboards/sx60/sx60.h b/keyboards/sx60/sx60.h index 2c0aa8240..605b6fe78 100755 --- a/keyboards/sx60/sx60.h +++ b/keyboards/sx60/sx60.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #include <util/delay.h> | 7 | #include <util/delay.h> |
8 | 8 | ||
9 | /* I2C aliases and register addresses (see "mcp23018.md") */ | 9 | /* I2C aliases and register addresses (see "mcp23018.md") */ |
10 | #define I2C_ADDR 0b0100000 | 10 | #define I2C_ADDR (0b0100000 << 1) |
11 | #define I2C_TIMEOUT 100 | 11 | #define I2C_TIMEOUT 100 |
12 | #define IODIRA 0x00 /* i/o direction register */ | 12 | #define IODIRA 0x00 /* i/o direction register */ |
13 | #define IODIRB 0x01 | 13 | #define IODIRB 0x01 |