aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunrelentingtech <greg@unrelenting.technology>2021-02-28 09:11:52 +0300
committerGitHub <noreply@github.com>2021-02-28 17:11:52 +1100
commitce75f48acb3ba622201a0615bccb5825d118a703 (patch)
tree476886e4c3c4de338afbe88693d42058f37dd2ea
parent9fd5c6f619ec0745a6774cb3f6fe23dcceb1e621 (diff)
downloadqmk_firmware-ce75f48acb3ba622201a0615bccb5825d118a703.tar.gz
qmk_firmware-ce75f48acb3ba622201a0615bccb5825d118a703.zip
[Keyboard] Update spiderisland/split78 (#11990)
* [Keyboard] spiderisland/split78: add MCP23018 reset code Now, communication with the right side gets re-established after unplugging it and plugging it back in. * [Keyboard] spiderisland/split78: configure debouncing I've been experiencing particularly bad bounce on the 'A' key. Also, update maintainer github username
-rw-r--r--keyboards/spiderisland/split78/config.h2
-rw-r--r--keyboards/spiderisland/split78/matrix.c16
-rw-r--r--keyboards/spiderisland/split78/readme.md2
-rw-r--r--keyboards/spiderisland/split78/rules.mk1
4 files changed, 18 insertions, 3 deletions
diff --git a/keyboards/spiderisland/split78/config.h b/keyboards/spiderisland/split78/config.h
index a7ec160fa..e15e5d193 100644
--- a/keyboards/spiderisland/split78/config.h
+++ b/keyboards/spiderisland/split78/config.h
@@ -33,3 +33,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
33#define BACKLIGHT_PIN D4 33#define BACKLIGHT_PIN D4
34#define BACKLIGHT_LEVELS 3 34#define BACKLIGHT_LEVELS 3
35#define BACKLIGHT_BREATHING 35#define BACKLIGHT_BREATHING
36
37#define DEBOUNCE 50
diff --git a/keyboards/spiderisland/split78/matrix.c b/keyboards/spiderisland/split78/matrix.c
index b5c7028fd..71e154e5b 100644
--- a/keyboards/spiderisland/split78/matrix.c
+++ b/keyboards/spiderisland/split78/matrix.c
@@ -105,9 +105,17 @@ void matrix_init_custom(void) {
105 105
106} 106}
107 107
108static i2c_status_t mcp23018_status = I2C_STATUS_SUCCESS;
109
108bool matrix_scan_custom(matrix_row_t current_matrix[]) { 110bool matrix_scan_custom(matrix_row_t current_matrix[]) {
109 bool matrix_has_changed = false; 111 bool matrix_has_changed = false;
110 112
113#if defined(RIGHT_HALF)
114 if (mcp23018_status != I2C_STATUS_SUCCESS) {
115 mcp23018_status = mcp23018_init();
116 }
117#endif
118
111 for (uint8_t row = 0; row < MATRIX_ROWS; row++) { 119 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
112 // Store last value of row prior to reading 120 // Store last value of row prior to reading
113 matrix_row_t last_row_value = current_matrix[row]; 121 matrix_row_t last_row_value = current_matrix[row];
@@ -124,7 +132,9 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
124 // as 0x75 would be no keys pressed 132 // as 0x75 would be no keys pressed
125 uint8_t data = 0x7F; 133 uint8_t data = 0x7F;
126 // Receive the columns from right half 134 // Receive the columns from right half
127 i2c_receive(TWI_ADDR_WRITE, &data, 1, I2C_TIMEOUT); 135 if (mcp23018_status == I2C_STATUS_SUCCESS) {
136 mcp23018_status = i2c_receive(TWI_ADDR_WRITE, &data, 1, I2C_TIMEOUT);
137 }
128#endif 138#endif
129 139
130 cols |= ((~(PINA | 0x80)) & 0x7F); 140 cols |= ((~(PINA | 0x80)) & 0x7F);
@@ -146,7 +156,9 @@ void matrix_set_row_status(uint8_t row) {
146 //Set the remote row on port A 156 //Set the remote row on port A
147 txdata[0] = (GPIOA); 157 txdata[0] = (GPIOA);
148 txdata[1] = ( 0xFF & ~(1<<row) ); 158 txdata[1] = ( 0xFF & ~(1<<row) );
149 i2c_transmit(TWI_ADDR_WRITE, (uint8_t *)txdata, 2, I2C_TIMEOUT); 159 if (mcp23018_status == I2C_STATUS_SUCCESS) {
160 mcp23018_status = i2c_transmit(TWI_ADDR_WRITE, (uint8_t *)txdata, 2, I2C_TIMEOUT);
161 }
150#endif 162#endif
151 163
152 //Set the local row on port B 164 //Set the local row on port B
diff --git a/keyboards/spiderisland/split78/readme.md b/keyboards/spiderisland/split78/readme.md
index 704ffcd26..84db8f0ff 100644
--- a/keyboards/spiderisland/split78/readme.md
+++ b/keyboards/spiderisland/split78/readme.md
@@ -9,7 +9,7 @@ It is mistakenly called "87 key" on the AliExpress title and "104 key" (?!) in t
9 9
10This port is based on the `split75` port which was mostly done by [Michael L. Walker](https://github.com/walkerstop). 10This port is based on the `split75` port which was mostly done by [Michael L. Walker](https://github.com/walkerstop).
11 11
12* Keyboard Maintainer: [unrelenting.technology](https://github.com/myfreeweb) 12* Keyboard Maintainer: [unrelenting.technology](https://github.com/unrelentingtech)
13* Hardware Availability: https://a.aliexpress.com/_dVJsSpR 13* Hardware Availability: https://a.aliexpress.com/_dVJsSpR
14 14
15Make example for this keyboard (after setting up your build environment): 15Make example for this keyboard (after setting up your build environment):
diff --git a/keyboards/spiderisland/split78/rules.mk b/keyboards/spiderisland/split78/rules.mk
index 61015b97f..664f5237d 100644
--- a/keyboards/spiderisland/split78/rules.mk
+++ b/keyboards/spiderisland/split78/rules.mk
@@ -17,6 +17,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality 17BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
18RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow 18RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
19WS2812_DRIVER = i2c 19WS2812_DRIVER = i2c
20DEBOUNCE_TYPE = sym_eager_pr
20 21
21# custom matrix setup 22# custom matrix setup
22CUSTOM_MATRIX = lite 23CUSTOM_MATRIX = lite