aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Singer <gesinger@gmail.com>2019-08-04 00:26:02 -0400
committerDrashna Jaelre <drashna@live.com>2019-08-03 21:26:02 -0700
commitf644db042c488a19c2256c9f3870b5bd331cc98c (patch)
treed2c590fb7f6dc2dd92b3a24d39c842bce20f04d7
parent465acd4d09fbf429ebd5894d13ae43a55c6777ee (diff)
downloadqmk_firmware-f644db042c488a19c2256c9f3870b5bd331cc98c.tar.gz
qmk_firmware-f644db042c488a19c2256c9f3870b5bd331cc98c.zip
[Split] Add config option for DIRECT_PINS_RIGHT (#6479)
Adds support for different direct pin mappings on the halves of a split keyboard.
-rw-r--r--docs/config_options.md3
-rw-r--r--docs/feature_split_keyboard.md5
-rw-r--r--quantum/split_common/matrix.c8
3 files changed, 16 insertions, 0 deletions
diff --git a/docs/config_options.md b/docs/config_options.md
index 01c0e3ee8..3be294db8 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -248,6 +248,9 @@ There are a few different ways to set handedness for split keyboards (listed in
248* `#define MATRIX_COL_PINS_RIGHT { <col pins> }` 248* `#define MATRIX_COL_PINS_RIGHT { <col pins> }`
249 * If you want to specify a different pinout for the right half than the left half, you can define `MATRIX_ROW_PINS_RIGHT`/`MATRIX_COL_PINS_RIGHT`. Currently, the size of `MATRIX_ROW_PINS` must be the same as `MATRIX_ROW_PINS_RIGHT` and likewise for the definition of columns. 249 * If you want to specify a different pinout for the right half than the left half, you can define `MATRIX_ROW_PINS_RIGHT`/`MATRIX_COL_PINS_RIGHT`. Currently, the size of `MATRIX_ROW_PINS` must be the same as `MATRIX_ROW_PINS_RIGHT` and likewise for the definition of columns.
250 250
251* `#define DIRECT_PINS_RIGHT { { F1, F0, B0, C7 }, { F4, F5, F6, F7 } }`
252 * If you want to specify a different direct pinout for the right half than the left half, you can define `DIRECT_PINS_RIGHT`. Currently, the size of `DIRECT_PINS` must be the same as `DIRECT_PINS_RIGHT`.
253
251* `#define RGBLED_SPLIT { 6, 6 }` 254* `#define RGBLED_SPLIT { 6, 6 }`
252 * See [RGB Light Configuration](#rgb-light-configuration) 255 * See [RGB Light Configuration](#rgb-light-configuration)
253 256
diff --git a/docs/feature_split_keyboard.md b/docs/feature_split_keyboard.md
index 95aceab22..4addb1bfd 100644
--- a/docs/feature_split_keyboard.md
+++ b/docs/feature_split_keyboard.md
@@ -160,6 +160,11 @@ There are some settings that you may need to configure, based on how the hardwar
160 160
161This allows you to specify a different set of pins for the matrix on the right side. This is useful if you have a board with differently-shaped halves that requires a different configuration (such as Keebio's Quefrency). 161This allows you to specify a different set of pins for the matrix on the right side. This is useful if you have a board with differently-shaped halves that requires a different configuration (such as Keebio's Quefrency).
162 162
163```c
164#define DIRECT_PINS_RIGHT { { F1, F0, B0, C7 }, { F4, F5, F6, F7 } }
165```
166
167This allows you to specify a different set of direct pins for the right side.
163 168
164```c 169```c
165#define RGBLIGHT_SPLIT 170#define RGBLIGHT_SPLIT
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c
index 41a15ace4..e0f094e34 100644
--- a/quantum/split_common/matrix.c
+++ b/quantum/split_common/matrix.c
@@ -252,6 +252,14 @@ void matrix_init(void) {
252 252
253 // Set pinout for right half if pinout for that half is defined 253 // Set pinout for right half if pinout for that half is defined
254 if (!isLeftHand) { 254 if (!isLeftHand) {
255#ifdef DIRECT_PINS_RIGHT
256 const pin_t direct_pins_right[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS_RIGHT;
257 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
258 for (uint8_t j = 0; j < MATRIX_COLS; j++) {
259 direct_pins[i][j] = direct_pins_right[i][j];
260 }
261 }
262#endif
255#ifdef MATRIX_ROW_PINS_RIGHT 263#ifdef MATRIX_ROW_PINS_RIGHT
256 const pin_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT; 264 const pin_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT;
257 for (uint8_t i = 0; i < MATRIX_ROWS; i++) { 265 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {