From eb5d267e637db4c2c639932b8c8176bf47dff78f Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sun, 19 Jan 2020 14:11:57 +1100 Subject: [PATCH] Enforce definition of `DIODE_DIRECTION` for non-custom matrix boards (#7915) * Enforce definition of `DIODE_DIRECTION` for non-custom matrix boards * Define diode direction for failing boards * Matching parentheses * Put onekey diode directions in top level config --- keyboards/40percentclub/luddite/config.h | 2 ++ keyboards/7skb/rev1/config.h | 2 ++ keyboards/adkb96/rev1/config.h | 2 ++ keyboards/alps64/config.h | 2 ++ keyboards/blackplum/config.h | 2 ++ keyboards/db/db63/config.h | 2 ++ keyboards/ergodash/mini/config.h | 2 ++ keyboards/ergodash/rev1/config.h | 2 ++ keyboards/handwired/aek64/config.h | 2 ++ keyboards/handwired/dactyl_manuform/4x5/config.h | 2 ++ keyboards/handwired/dactyl_manuform/5x6/config.h | 2 ++ keyboards/handwired/dactyl_manuform/5x7/config.h | 2 ++ keyboards/handwired/dactyl_manuform/6x6/config.h | 2 ++ .../handwired/dactyl_manuform/dmote/62key/config.h | 2 ++ keyboards/handwired/dactyl_promicro/config.h | 2 ++ keyboards/handwired/hacked_motospeed/config.h | 4 ++-- keyboards/handwired/lovelive9/config.h | 2 ++ keyboards/handwired/nicekey/config.h | 2 ++ keyboards/handwired/onekey/config.h | 2 ++ keyboards/handwired/splittest/config.h | 2 ++ keyboards/handwired/wulkan/config.h | 2 ++ keyboards/keebio/bfo9000/config.h | 2 ++ keyboards/keebio/fourier/config.h | 2 ++ keyboards/keebio/levinson/rev1/config.h | 2 ++ keyboards/keebio/levinson/rev2/config.h | 2 ++ keyboards/keebio/levinson/rev3/config.h | 2 ++ keyboards/keebio/quefrency/rev1/config.h | 2 ++ keyboards/keebio/wavelet/config.h | 2 ++ keyboards/lets_split/rev1/config.h | 2 ++ keyboards/lets_split/rev2/config.h | 2 ++ keyboards/lets_split/sockets/config.h | 2 ++ keyboards/nafuda/config.h | 2 ++ keyboards/naked48/rev1/config.h | 2 ++ keyboards/naked60/rev1/config.h | 2 ++ keyboards/naked64/rev1/config.h | 2 ++ keyboards/rgbkb/sol/config.h | 2 ++ keyboards/rgbkb/zygomorph/rev1/config.h | 2 ++ keyboards/runner3680/3x6/config.h | 2 ++ keyboards/runner3680/3x7/config.h | 2 ++ keyboards/runner3680/3x8/config.h | 2 ++ keyboards/runner3680/4x6/config.h | 2 ++ keyboards/runner3680/4x7/config.h | 2 ++ keyboards/runner3680/4x8/config.h | 2 ++ keyboards/runner3680/5x6/config.h | 2 ++ keyboards/runner3680/5x7/config.h | 2 ++ keyboards/runner3680/5x8/config.h | 2 ++ keyboards/setta21/rev1/config.h | 2 ++ keyboards/signum/3_0/elitec/config.h | 2 ++ keyboards/tanuki/config.h | 2 ++ keyboards/uzu42/rev1/config.h | 2 ++ keyboards/vitamins_included/rev1/config.h | 2 ++ keyboards/vitamins_included/rev2/config.h | 2 ++ quantum/matrix.c | 10 ++++++++-- quantum/split_common/matrix.c | 10 ++++++++-- 54 files changed, 120 insertions(+), 6 deletions(-) diff --git a/keyboards/40percentclub/luddite/config.h b/keyboards/40percentclub/luddite/config.h index 36bda061439f4877003ce9cb0720adb05c994af9..005cb7a705e86e3c5d8d061aa86f7ee93d0e6b01 100644 --- a/keyboards/40percentclub/luddite/config.h +++ b/keyboards/40percentclub/luddite/config.h @@ -19,6 +19,8 @@ #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } #define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + /* number of backlight levels */ #define BACKLIGHT_PIN B5 #ifdef BACKLIGHT_PIN diff --git a/keyboards/7skb/rev1/config.h b/keyboards/7skb/rev1/config.h index 01b1ef4a1cc37648b13735bc772312106b99e31c..b1096c4d69b39997ad6805af733f2a613de0f087 100644 --- a/keyboards/7skb/rev1/config.h +++ b/keyboards/7skb/rev1/config.h @@ -34,6 +34,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B5 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/adkb96/rev1/config.h b/keyboards/adkb96/rev1/config.h index cff135c261a9b77cc154fc1797174774f14987a2..42685123b1754866a006acd09e685aa2972c4b3e 100644 --- a/keyboards/adkb96/rev1/config.h +++ b/keyboards/adkb96/rev1/config.h @@ -33,6 +33,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 } #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } +#define DIODE_DIRECTION COL2ROW + #define SOFT_SERIAL_PIN D0 /* define tapping term */ diff --git a/keyboards/alps64/config.h b/keyboards/alps64/config.h index cc7eada11a15cc2305dc4c7cf5918e446f0581de..237dfbbe770f02a29f96c88934f655b9981d5010 100644 --- a/keyboards/alps64/config.h +++ b/keyboards/alps64/config.h @@ -35,6 +35,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D0, D1, D2, D3, D4, D5, D6, C2 } #define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/blackplum/config.h b/keyboards/blackplum/config.h index 0fd7e21cb6a123eb7accf41ebbed60467a491655..256603744e212d88f8fa5a641dccb9f3b719ad0d 100644 --- a/keyboards/blackplum/config.h +++ b/keyboards/blackplum/config.h @@ -19,6 +19,8 @@ #define MATRIX_COL_PINS { D0, D1, D2, F7, F6, F5, F4, F1 } #define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/db/db63/config.h b/keyboards/db/db63/config.h index 468e0f8a97a97dcc8c49282b3eda4696e0cb370d..488409e3a606e147c05adae1fde1c9a0f41c0fa2 100644 --- a/keyboards/db/db63/config.h +++ b/keyboards/db/db63/config.h @@ -32,6 +32,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2 } #define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + #define RGBLED_NUM 18 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/ergodash/mini/config.h b/keyboards/ergodash/mini/config.h index 2fa51dcc126c395343e1783887675d5375241e00..1a0ecc0a7e93c31360daae826873303e34932518 100644 --- a/keyboards/ergodash/mini/config.h +++ b/keyboards/ergodash/mini/config.h @@ -38,6 +38,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } // #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/ergodash/rev1/config.h b/keyboards/ergodash/rev1/config.h index 7e84a3cab031b7080465e1309d190efdcaacec47..0e89ca3402af5e5bb3a89c4d5bc46ed8adcc1737 100644 --- a/keyboards/ergodash/rev1/config.h +++ b/keyboards/ergodash/rev1/config.h @@ -38,6 +38,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } // #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/handwired/aek64/config.h b/keyboards/handwired/aek64/config.h index 7d235358c3dcd4d2b41da3855b977106e92abb9c..a072d562a7832d87e34574a3d7e40ca0825407bb 100644 --- a/keyboards/handwired/aek64/config.h +++ b/keyboards/handwired/aek64/config.h @@ -39,6 +39,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { E0, E1, C0, C1, C2 } #define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/handwired/dactyl_manuform/4x5/config.h b/keyboards/handwired/dactyl_manuform/4x5/config.h index 1f24c9aca627f1389a2e4b0c7f07ea686d5c7098..698418fb73c9f0bf511af8088f37987b9c8c533b 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/config.h +++ b/keyboards/handwired/dactyl_manuform/4x5/config.h @@ -37,6 +37,8 @@ along with this program. If not, see . // #define MATRIX_COL_PINS { B5, B4, E6, D7, C6 } #define MATRIX_COL_PINS { C6, D7, E6, B4, B5 } +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/handwired/dactyl_manuform/5x6/config.h b/keyboards/handwired/dactyl_manuform/5x6/config.h index 413039449f8cf801b2e64fcb052232ebac05e6af..fd0c23961c12ed6aa492a4602296ef622870d96e 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/config.h +++ b/keyboards/handwired/dactyl_manuform/5x6/config.h @@ -32,6 +32,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } #define MATRIX_ROW_PINS { F6, F7, B1, B3, B2, B6 } +#define DIODE_DIRECTION COL2ROW + // WS2812 RGB LED strip input and number of LEDs #define RGB_DI_PIN D3 #define RGBLED_NUM 12 diff --git a/keyboards/handwired/dactyl_manuform/5x7/config.h b/keyboards/handwired/dactyl_manuform/5x7/config.h index 43583749874cfc2314ba7e308ee6aeb6eb78363f..bf56d08251265d153a05f9bddfdda5f8bf8af65c 100644 --- a/keyboards/handwired/dactyl_manuform/5x7/config.h +++ b/keyboards/handwired/dactyl_manuform/5x7/config.h @@ -32,6 +32,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 } #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } +#define DIODE_DIRECTION COL2ROW + // WS2812 RGB LED strip input and number of LEDs #define RGB_DI_PIN D3 #define RGBLED_NUM 12 diff --git a/keyboards/handwired/dactyl_manuform/6x6/config.h b/keyboards/handwired/dactyl_manuform/6x6/config.h index 9bc501c5e9068a4e8f7b53596f786e71b38437be..522e98b6873dc5a459b318c0c8a8394b3171f96f 100644 --- a/keyboards/handwired/dactyl_manuform/6x6/config.h +++ b/keyboards/handwired/dactyl_manuform/6x6/config.h @@ -32,6 +32,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } #define MATRIX_ROW_PINS { F5, F6, F7, B1, B3, B2, B6 } +#define DIODE_DIRECTION COL2ROW + // WS2812 RGB LED strip input and number of LEDs #define RGB_DI_PIN D3 #define RGBLED_NUM 12 diff --git a/keyboards/handwired/dactyl_manuform/dmote/62key/config.h b/keyboards/handwired/dactyl_manuform/dmote/62key/config.h index 7db3ceb753be11ce4beee7827944bdbc66774b97..d315cb180dd2bbc1d1871b0816315b417cdb8171 100644 --- a/keyboards/handwired/dactyl_manuform/dmote/62key/config.h +++ b/keyboards/handwired/dactyl_manuform/dmote/62key/config.h @@ -37,6 +37,8 @@ #define MATRIX_ROW_PINS { F6, F7, B1, B3, B2, B6 } #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } +#define DIODE_DIRECTION COL2ROW + // WS2812 RGB LED, normally used to indicate keyboard state: #define RGBLIGHT_EFFECT_KNIGHT #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 diff --git a/keyboards/handwired/dactyl_promicro/config.h b/keyboards/handwired/dactyl_promicro/config.h index 3c0b541d1a02d50c54174abc75e9754d461580bf..c57e766243f9ceaa6a8cdc47045d4b978b09193a 100644 --- a/keyboards/handwired/dactyl_promicro/config.h +++ b/keyboards/handwired/dactyl_promicro/config.h @@ -30,6 +30,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } #define MATRIX_ROW_PINS { F6, F7, B1, B3, B2, B6 } +#define DIODE_DIRECTION COL2ROW + /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x3060 diff --git a/keyboards/handwired/hacked_motospeed/config.h b/keyboards/handwired/hacked_motospeed/config.h index d4bf11f235cd2a42c8c7c931a883b0dc5825b62e..0035a5e282b3a413413d001bf3d02486fa6cb1e1 100644 --- a/keyboards/handwired/hacked_motospeed/config.h +++ b/keyboards/handwired/hacked_motospeed/config.h @@ -50,7 +50,7 @@ along with this program. If not, see . #define UNUSED_PINS /* COL2ROW, ROW2COL*/ -//#define DIODE_DIRECTION COL2ROW +#define DIODE_DIRECTION COL2ROW /* * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. @@ -245,4 +245,4 @@ along with this program. If not, see . /* Bootmagic Lite key configuration */ // #define BOOTMAGIC_LITE_ROW 0 -// #define BOOTMAGIC_LITE_COLUMN 0 \ No newline at end of file +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/handwired/lovelive9/config.h b/keyboards/handwired/lovelive9/config.h index c11a25df6006d1d4571848a9988ce2077c5daba6..f1f6f69c55e05a1d5f525fc58f700e5b82c9ecb8 100644 --- a/keyboards/handwired/lovelive9/config.h +++ b/keyboards/handwired/lovelive9/config.h @@ -19,6 +19,8 @@ #define MATRIX_ROW_PINS { NO_PIN } #define MATRIX_COL_PINS { B4, B6, B2, D7, B1, F7, F6, F5, F4 } +#define DIODE_DIRECTION COL2ROW + #define UNUSED_PINS /* ws2812 RGB LED */ diff --git a/keyboards/handwired/nicekey/config.h b/keyboards/handwired/nicekey/config.h index 4af56cc52899bd166d478c43108eabf13fc4e923..9c1b18117bf88e3d00640c448e1597532fa2050c 100644 --- a/keyboards/handwired/nicekey/config.h +++ b/keyboards/handwired/nicekey/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { B6 } #define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/handwired/onekey/config.h b/keyboards/handwired/onekey/config.h index 64a447481d2bd739f81a264fec130009ebc29845..652a99cab64632c22ea52b47b8ede673cfcaaf5f 100644 --- a/keyboards/handwired/onekey/config.h +++ b/keyboards/handwired/onekey/config.h @@ -29,6 +29,8 @@ along with this program. If not, see . #define MATRIX_ROWS 1 #define MATRIX_COLS 1 +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/handwired/splittest/config.h b/keyboards/handwired/splittest/config.h index 56574f75296a197125eb6df721e7113f7909433e..3ff8547fc93fcaaf8b8ebbb691e837132b7ecfae 100644 --- a/keyboards/handwired/splittest/config.h +++ b/keyboards/handwired/splittest/config.h @@ -33,6 +33,8 @@ along with this program. If not, see . #define MATRIX_ROWS 2 #define MATRIX_COLS 1 +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/handwired/wulkan/config.h b/keyboards/handwired/wulkan/config.h index 4a9cbada7e16b98753dd17a3f271aa7ba0e65b53..628206535055abdc9044bff3e8110ff43b55f4d9 100644 --- a/keyboards/handwired/wulkan/config.h +++ b/keyboards/handwired/wulkan/config.h @@ -17,6 +17,8 @@ #define MATRIX_ROW_PINS { B8, A0, A1, A2 } #define MATRIX_COL_PINS { B13, B14, B15, B9, B7, B6, B5, B4, B3, B2, B1, B0 } +#define DIODE_DIRECTION COL2ROW + /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 5 diff --git a/keyboards/keebio/bfo9000/config.h b/keyboards/keebio/bfo9000/config.h index b45ec9c2fafe265245cc37e47a59b9f3f0ee2c62..0b279bc34368edc6543011023aa60ff37f08caf0 100644 --- a/keyboards/keebio/bfo9000/config.h +++ b/keyboards/keebio/bfo9000/config.h @@ -37,6 +37,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D3, D2, D4, C6, D7, E6 } #define MATRIX_COL_PINS { B5, B6, B2, B3, B1, F7, F6, F5, F4 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/keebio/fourier/config.h b/keyboards/keebio/fourier/config.h index 9ddc53a0c8e9cbe62a113f7a9206c86a57be0f59..a0e85a3b1e78bf36e15bd8900851adb957cb5d93 100644 --- a/keyboards/keebio/fourier/config.h +++ b/keyboards/keebio/fourier/config.h @@ -37,6 +37,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { F4, D7, E6, B4 } #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } +#define DIODE_DIRECTION COL2ROW + #define QMK_ESC_OUTPUT F5 #define QMK_ESC_INPUT F4 #define QMK_LED B0 diff --git a/keyboards/keebio/levinson/rev1/config.h b/keyboards/keebio/levinson/rev1/config.h index a34c8bdcc557b53cf5df0d6d4a621c9b7857c304..5b23f18c1d36e7892c392471897c186148bba9be 100644 --- a/keyboards/keebio/levinson/rev1/config.h +++ b/keyboards/keebio/levinson/rev1/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D7, E6, B4, B5 } #define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/keebio/levinson/rev2/config.h b/keyboards/keebio/levinson/rev2/config.h index 9d694712538c05b07b93dcac7508c404b5638a9a..e8e7294dd86708accc0c85ad438476f215344ae5 100644 --- a/keyboards/keebio/levinson/rev2/config.h +++ b/keyboards/keebio/levinson/rev2/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D4, D7, E6, B4 } #define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/keebio/levinson/rev3/config.h b/keyboards/keebio/levinson/rev3/config.h index 3e45b9d422b4903fe8a0defc24884b725aa0f62c..da5f4e74173f064f3e39027572805f5fceaf64e9 100644 --- a/keyboards/keebio/levinson/rev3/config.h +++ b/keyboards/keebio/levinson/rev3/config.h @@ -40,6 +40,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS_RIGHT { F4, F7, D3, B5, B4, E6 } #define SPLIT_HAND_PIN D2 +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/keebio/quefrency/rev1/config.h b/keyboards/keebio/quefrency/rev1/config.h index 1d726a0fc3201d73a6c49ee4f6e948a07f62e5fa..1e3be6347ac85a5ce13c4513b7bf5d07db921b74 100644 --- a/keyboards/keebio/quefrency/rev1/config.h +++ b/keyboards/keebio/quefrency/rev1/config.h @@ -38,6 +38,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS_RIGHT { F5, F6, F7, B1, B3, B2, B6, C6 } #define SPLIT_HAND_PIN D2 +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/keebio/wavelet/config.h b/keyboards/keebio/wavelet/config.h index 6f67fdbaf536a0d72ac5890a3b2a37646e9e8508..71366ec24b7f9311a1a7dd00526faa35246407cf 100644 --- a/keyboards/keebio/wavelet/config.h +++ b/keyboards/keebio/wavelet/config.h @@ -37,6 +37,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { F4, F5, F7, B3, D2, D1, D4, D7 } #define MATRIX_COL_PINS { F6, B1, B2, B6, B4, E6 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/lets_split/rev1/config.h b/keyboards/lets_split/rev1/config.h index c6e7f6479ec5018c4381113e0dfe31764808eef9..d753437354070984460a5abf1d1dd6bbf1cd7222 100644 --- a/keyboards/lets_split/rev1/config.h +++ b/keyboards/lets_split/rev1/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } // #define MATRIX_COL_PINS { B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/lets_split/rev2/config.h b/keyboards/lets_split/rev2/config.h index 2481ce0413eb01b508021777235f3b5e0498bf67..0977d7c6701c005a066244f96d0acf9e10d785cd 100644 --- a/keyboards/lets_split/rev2/config.h +++ b/keyboards/lets_split/rev2/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/lets_split/sockets/config.h b/keyboards/lets_split/sockets/config.h index eb8092a8f4ea09a1f63cb2cffe4d2de228e707ce..f6ecb70947c09b8f2a8ff845367a9a006460c8d8 100644 --- a/keyboards/lets_split/sockets/config.h +++ b/keyboards/lets_split/sockets/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F4, F7, D7, B3, B2, B6} // #define MATRIX_COL_PINS { B6, B2, B3, D7, F7, F4} //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/nafuda/config.h b/keyboards/nafuda/config.h index 3db4401d49fdf00ce30afd64ae10e9c51dc8fb0d..be3348668dcfc821e4594296716d7f7948faa59c 100644 --- a/keyboards/nafuda/config.h +++ b/keyboards/nafuda/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D1, D0, D4 } #define MATRIX_COL_PINS { F4, F5, F6 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/naked48/rev1/config.h b/keyboards/naked48/rev1/config.h index d770fefb498f8823ed23f520e846ba1dd35024f1..21f7aa55ecb4e9ae9fe35e3babe0418948e73606 100644 --- a/keyboards/naked48/rev1/config.h +++ b/keyboards/naked48/rev1/config.h @@ -37,6 +37,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS_RIGHT { D4, C6, D7, E6 } #define MATRIX_COL_PINS_RIGHT { F4, F5, F6, F7, B1, B3, B2, B6, B4, B5, B2, B2 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/naked60/rev1/config.h b/keyboards/naked60/rev1/config.h index ac0c0ab2fca1c55d7cc525dbceaa837b3199a827..b082e1227f29b98766ed52b3f3840778957e7b8f 100644 --- a/keyboards/naked60/rev1/config.h +++ b/keyboards/naked60/rev1/config.h @@ -41,6 +41,8 @@ along with this program. If not, see . //#define MATRIX_ROW_PINS_RIGHT { D1, D0, D4, C6, B6 } //#define MATRIX_COL_PINS_RIGHT { F4, F5, F6, F7, B1, B3, B2, D7, E6, B4, B5, D3 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/naked64/rev1/config.h b/keyboards/naked64/rev1/config.h index 2e48edbc03393b4dee966df78ad9d1cf86093e2a..d9aff6be13e9727d4dc9498c0f3a637ede2f0918 100644 --- a/keyboards/naked64/rev1/config.h +++ b/keyboards/naked64/rev1/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS_RIGHT { D4, C6, D7, E6, B4, B5, B2, B2 } #define MATRIX_COL_PINS_RIGHT { F4, F5, F6, F7, B1, B3, B2, B6 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/rgbkb/sol/config.h b/keyboards/rgbkb/sol/config.h index 9b136db0584225b9ae50736da2cd9a67633e30e0..f42783f719d984d302bb2de2d208d63ca45379f4 100644 --- a/keyboards/rgbkb/sol/config.h +++ b/keyboards/rgbkb/sol/config.h @@ -35,6 +35,8 @@ along with this program. If not, see . #define MATRIX_COLS 7 #define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/rgbkb/zygomorph/rev1/config.h b/keyboards/rgbkb/zygomorph/rev1/config.h index 6e55a6a5f5dda21977fabfc791d0adc3d9b84f0c..246e391ac1755c4281d4205d510f0741bab5fd20 100644 --- a/keyboards/rgbkb/zygomorph/rev1/config.h +++ b/keyboards/rgbkb/zygomorph/rev1/config.h @@ -38,6 +38,8 @@ along with this program. If not, see . #define MATRIX_COLS 6 #define MATRIX_COL_PINS { F4, F6, C7, C6, B6, D4 } +#define DIODE_DIRECTION COL2ROW + #define SOFT_SERIAL_PIN D3 #define ENCODERS_PAD_A { D2 } diff --git a/keyboards/runner3680/3x6/config.h b/keyboards/runner3680/3x6/config.h index d3f3605f55e5dedc0ae63bd7627f3219f0f7a071..fd462afb2468438e625664048bf7e0e5286483b8 100644 --- a/keyboards/runner3680/3x6/config.h +++ b/keyboards/runner3680/3x6/config.h @@ -34,6 +34,8 @@ #define MATRIX_COL_PINS { F6, F7, B1, B3, B2 ,B6 } // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6} //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/runner3680/3x7/config.h b/keyboards/runner3680/3x7/config.h index e0e6ae8e06b5944c8cd0463517e57a1f9f85bbbc..e6acb3735dc0e7e89da531ef3434f2f7b0927939 100644 --- a/keyboards/runner3680/3x7/config.h +++ b/keyboards/runner3680/3x7/config.h @@ -34,6 +34,8 @@ #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2 ,B6 } // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/runner3680/3x8/config.h b/keyboards/runner3680/3x8/config.h index 0d4e3296a1224cd09471f5ff142d383d0f390689..257f63a8f45a13ae2a395d187901187dd5bce268 100644 --- a/keyboards/runner3680/3x8/config.h +++ b/keyboards/runner3680/3x8/config.h @@ -34,6 +34,8 @@ #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 ,B6 } // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/runner3680/4x6/config.h b/keyboards/runner3680/4x6/config.h index 08838d1b66c9a0a422b3aa36afae5fcbfeb0c9c8..06b9bc4dfc53ef8d518d6ded3e3e76c8a8414772 100644 --- a/keyboards/runner3680/4x6/config.h +++ b/keyboards/runner3680/4x6/config.h @@ -34,6 +34,8 @@ #define MATRIX_COL_PINS { F6, F7, B1, B3, B2 ,B6 } // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6} //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/runner3680/4x7/config.h b/keyboards/runner3680/4x7/config.h index f33f8f9f2b7674130aa9fbb81c4194b5ed90575a..8bc2da4cdc67c32e497819bb32e3cf099e2a2bab 100644 --- a/keyboards/runner3680/4x7/config.h +++ b/keyboards/runner3680/4x7/config.h @@ -34,6 +34,8 @@ #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2 ,B6 } // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/runner3680/4x8/config.h b/keyboards/runner3680/4x8/config.h index d85ebb29cf5e6e63898ac5c8fac032ad5b0992f7..9f9adfa9d21b4f6240defc72b561323bb6750f05 100644 --- a/keyboards/runner3680/4x8/config.h +++ b/keyboards/runner3680/4x8/config.h @@ -34,6 +34,8 @@ #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 ,B6 } // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/runner3680/5x6/config.h b/keyboards/runner3680/5x6/config.h index ae3853a8e8a409c4c30bfc51b91e917dcb50ceaf..3ae72dcfd9e31e3b05a33819690af06363e6fdd7 100644 --- a/keyboards/runner3680/5x6/config.h +++ b/keyboards/runner3680/5x6/config.h @@ -34,6 +34,8 @@ #define MATRIX_COL_PINS { F6, F7, B1, B3, B2 ,B6 } // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6} //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/runner3680/5x7/config.h b/keyboards/runner3680/5x7/config.h index 1d56608e6d6172cca4b4132e9f0b25e421ebf0b2..004f84edd68480b311d2bd0be23c5e7d5ff6eefe 100644 --- a/keyboards/runner3680/5x7/config.h +++ b/keyboards/runner3680/5x7/config.h @@ -34,6 +34,8 @@ #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2 ,B6 } // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/runner3680/5x8/config.h b/keyboards/runner3680/5x8/config.h index 5349fa06aaf9709a801a81b5ae2df95a5db947d2..11b7d647ed7239b42649df5deac2eb05464a9b1f 100644 --- a/keyboards/runner3680/5x8/config.h +++ b/keyboards/runner3680/5x8/config.h @@ -34,6 +34,8 @@ #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 ,B6 } // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define tapping term */ #define TAPPING_TERM 120 diff --git a/keyboards/setta21/rev1/config.h b/keyboards/setta21/rev1/config.h index 57451a7e30dc50b1ac93cbf633df64807c9a91ed..c6c1357d0a964065b9f41ff1377f382611f95ad5 100644 --- a/keyboards/setta21/rev1/config.h +++ b/keyboards/setta21/rev1/config.h @@ -34,6 +34,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D4, C6, D7, E6 } #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/signum/3_0/elitec/config.h b/keyboards/signum/3_0/elitec/config.h index 1e045e2e10f37066cb7dda9333d3a60934656e18..eeafb7236098fd04075027723c90f07e39568213 100644 --- a/keyboards/signum/3_0/elitec/config.h +++ b/keyboards/signum/3_0/elitec/config.h @@ -22,6 +22,8 @@ #define MATRIX_COL_PINS { B4, D7, D0, E6, D4, F6, F4, F7, B1, B3, C6, B2 } #define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/tanuki/config.h b/keyboards/tanuki/config.h index 1439ed43e8c1139621d1ca868b36ff43b3df5657..2dcd7b27d641bcb836d8098cfdadc426f4f0b504 100644 --- a/keyboards/tanuki/config.h +++ b/keyboards/tanuki/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { F7 , B1 , D4 , D0 } #define UNUSED_PINS +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/uzu42/rev1/config.h b/keyboards/uzu42/rev1/config.h index 8f86d22bf15d965123203f324a9c0cc2daeef5fe..13b278970ffa645e2df67bb248563f0c33a56eaf 100644 --- a/keyboards/uzu42/rev1/config.h +++ b/keyboards/uzu42/rev1/config.h @@ -36,6 +36,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } // #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/vitamins_included/rev1/config.h b/keyboards/vitamins_included/rev1/config.h index c4881db01b314124b19454a6c6a22c52feb82ed9..88b43ffc332545038bda247ab7bbaf2881f50b99 100644 --- a/keyboards/vitamins_included/rev1/config.h +++ b/keyboards/vitamins_included/rev1/config.h @@ -38,6 +38,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { F5, F6, C7, F7 } #define MATRIX_COL_PINS { F1, F4, E2, B6, D7, D6} +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/vitamins_included/rev2/config.h b/keyboards/vitamins_included/rev2/config.h index 0aa0e7063f9b8657d377a3c1aea164f4c1b7f273..d0f9e64003e983a7d83573bbc95ee74313ae7d50 100644 --- a/keyboards/vitamins_included/rev2/config.h +++ b/keyboards/vitamins_included/rev2/config.h @@ -37,6 +37,8 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { F5, F6, C7, F7 } #define MATRIX_COL_PINS { F1, F4, E2, B6, D7, D6} +#define DIODE_DIRECTION COL2ROW + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/quantum/matrix.c b/quantum/matrix.c index 1675f2477b2d09fd0fd87ddd30cc5392169e3676..6bd604bb79c62221c100dc8eb0491ab1d5f7b0fc 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -62,7 +62,8 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) return (last_row_value != current_matrix[current_row]); } -#elif (DIODE_DIRECTION == COL2ROW) +#elif defined(DIODE_DIRECTION) +# if (DIODE_DIRECTION == COL2ROW) static void select_row(uint8_t row) { setPinOutput(row_pins[row]); @@ -110,7 +111,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) return (last_row_value != current_matrix[current_row]); } -#elif (DIODE_DIRECTION == ROW2COL) +# elif (DIODE_DIRECTION == ROW2COL) static void select_col(uint8_t col) { setPinOutput(col_pins[col]); @@ -165,6 +166,11 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) return matrix_changed; } +# else +# error DIODE_DIRECTION must be one of COL2ROW or ROW2COL! +# endif +#else +# error DIODE_DIRECTION is not defined! #endif void matrix_init(void) { diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index ed1ff5acf3985f14927a99189af9b437f6f0ec9e..454ea59c3b1eab856d846e04ce0ad585921b72fe 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -79,7 +79,8 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) return (last_row_value != current_matrix[current_row]); } -#elif (DIODE_DIRECTION == COL2ROW) +#elif defined(DIODE_DIRECTION) +# if (DIODE_DIRECTION == COL2ROW) static void select_row(uint8_t row) { setPinOutput(row_pins[row]); @@ -124,7 +125,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) return (last_row_value != current_matrix[current_row]); } -#elif (DIODE_DIRECTION == ROW2COL) +# elif (DIODE_DIRECTION == ROW2COL) static void select_col(uint8_t col) { setPinOutput(col_pins[col]); @@ -179,6 +180,11 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) return matrix_changed; } +# else +# error DIODE_DIRECTION must be one of COL2ROW or ROW2COL! +# endif +#else +# error DIODE_DIRECTION is not defined! #endif void matrix_init(void) {