]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
[Split] Add config option for DIRECT_PINS_RIGHT (#6479)
authorGarrett Singer <gesinger@gmail.com>
Sun, 4 Aug 2019 04:26:02 +0000 (00:26 -0400)
committerDrashna Jaelre <drashna@live.com>
Sun, 4 Aug 2019 04:26:02 +0000 (21:26 -0700)
Adds support for different direct pin mappings on the halves of a split keyboard.

docs/config_options.md
docs/feature_split_keyboard.md
quantum/split_common/matrix.c

index 01c0e3ee8ca3e81554d3a0fc60e6f8f7d4a31100..3be294db89498db659d7aba8762077911c5a37cf 100644 (file)
@@ -248,6 +248,9 @@ There are a few different ways to set handedness for split keyboards (listed in
 * `#define MATRIX_COL_PINS_RIGHT { <col pins> }`
   * 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.
 
+* `#define DIRECT_PINS_RIGHT { { F1, F0, B0, C7 }, { F4, F5, F6, F7 } }`
+  * 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`.
+
 * `#define RGBLED_SPLIT { 6, 6 }`
   * See [RGB Light Configuration](#rgb-light-configuration)
 
index 95aceab22386a193c5f72392e49682bc6cfc3cf7..4addb1bfd0f32323c4583d3a72fafab3a9d53f86 100644 (file)
@@ -160,6 +160,11 @@ There are some settings that you may need to configure, based on how the hardwar
 
 This 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).
 
+```c
+#define DIRECT_PINS_RIGHT { { F1, F0, B0, C7 }, { F4, F5, F6, F7 } }
+```
+
+This allows you to specify a different set of direct pins for the right side.
 
 ```c
 #define RGBLIGHT_SPLIT
index 41a15ace4e43d4d5f298280a7e46a7f689bf64e2..e0f094e34ba1d1a9a4b17cdcd3be783545c8a8cc 100644 (file)
@@ -252,6 +252,14 @@ void matrix_init(void) {
 
   // Set pinout for right half if pinout for that half is defined
   if (!isLeftHand) {
+#ifdef DIRECT_PINS_RIGHT
+    const pin_t direct_pins_right[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS_RIGHT;
+    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+      for (uint8_t j = 0; j < MATRIX_COLS; j++) {
+        direct_pins[i][j] = direct_pins_right[i][j];
+      }
+    }
+#endif
 #ifdef MATRIX_ROW_PINS_RIGHT
     const pin_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT;
     for (uint8_t i = 0; i < MATRIX_ROWS; i++) {