From 692774e7f64a229bda2d784fdab27ee45698e603 Mon Sep 17 00:00:00 2001 From: zvecr Date: Thu, 8 Feb 2024 09:32:27 +0000 Subject: [PATCH] Migrate dip switch config to info.json - keychron --- keyboards/keychron/c1_pro/c1_pro.c | 13 ------------- keyboards/keychron/c1_pro/config.h | 6 ------ keyboards/keychron/c1_pro/info.json | 3 +++ keyboards/keychron/c2_pro/c2_pro.c | 12 ------------ keyboards/keychron/c2_pro/config.h | 6 ------ keyboards/keychron/c2_pro/info.json | 3 +++ keyboards/keychron/q10/config.h | 6 ------ keyboards/keychron/q10/info.json | 5 +++++ keyboards/keychron/q10/q10.c | 9 --------- keyboards/keychron/q11/config.h | 9 --------- keyboards/keychron/q11/info.json | 6 ++++++ keyboards/keychron/q11/q11.c | 19 ------------------- keyboards/keychron/q12/config.h | 8 -------- keyboards/keychron/q12/info.json | 5 +++++ keyboards/keychron/q12/q12.c | 10 ---------- keyboards/keychron/q1v1/ansi/ansi.c | 9 --------- .../keychron/q1v1/ansi_encoder/ansi_encoder.c | 9 --------- keyboards/keychron/q1v1/config.h | 6 ------ keyboards/keychron/q1v1/info.json | 3 +++ keyboards/keychron/q1v1/iso/iso.c | 9 --------- .../keychron/q1v1/iso_encoder/iso_encoder.c | 9 --------- keyboards/keychron/q1v2/config.h | 9 --------- keyboards/keychron/q1v2/info.json | 3 +++ keyboards/keychron/q1v2/q1v2.c | 9 --------- keyboards/keychron/q2/config.h | 6 ------ keyboards/keychron/q2/info.json | 3 +++ keyboards/keychron/q2/q2.c | 8 -------- keyboards/keychron/q3/config.h | 6 ------ keyboards/keychron/q3/info.json | 3 +++ keyboards/keychron/q3/q3.c | 13 ------------- keyboards/keychron/q4/config.h | 6 ------ keyboards/keychron/q4/info.json | 3 +++ keyboards/keychron/q4/q4.c | 8 -------- keyboards/keychron/q5/config.h | 6 ------ keyboards/keychron/q5/info.json | 3 +++ keyboards/keychron/q5/q5.c | 9 --------- keyboards/keychron/q6/config.h | 6 ------ keyboards/keychron/q6/info.json | 5 +++++ keyboards/keychron/q6/q6.c | 9 --------- keyboards/keychron/q60/config.h | 6 ------ keyboards/keychron/q60/info.json | 5 +++++ keyboards/keychron/q60/q60.c | 8 -------- keyboards/keychron/q65/config.h | 6 ------ keyboards/keychron/q65/info.json | 5 +++++ keyboards/keychron/q65/q65.c | 8 -------- keyboards/keychron/q7/config.h | 6 ------ keyboards/keychron/q7/info.json | 3 +++ keyboards/keychron/q7/q7.c | 8 -------- keyboards/keychron/q8/config.h | 6 ------ keyboards/keychron/q8/info.json | 3 +++ keyboards/keychron/q8/q8.c | 8 -------- keyboards/keychron/q9/config.h | 6 ------ keyboards/keychron/q9/info.json | 3 +++ keyboards/keychron/q9/q9.c | 7 ------- keyboards/keychron/q9_plus/config.h | 6 ------ keyboards/keychron/q9_plus/info.json | 3 +++ keyboards/keychron/q9_plus/q9_plus.c | 7 ------- keyboards/keychron/s1/config.h | 6 ------ keyboards/keychron/s1/info.json | 5 +++++ keyboards/keychron/s1/s1.c | 9 --------- keyboards/keychron/v1/config.h | 6 ------ keyboards/keychron/v1/info.json | 5 +++++ keyboards/keychron/v1/v1.c | 9 --------- keyboards/keychron/v10/config.h | 6 ------ keyboards/keychron/v10/info.json | 5 +++++ keyboards/keychron/v10/v10.c | 9 --------- keyboards/keychron/v2/config.h | 6 ------ keyboards/keychron/v2/info.json | 5 +++++ keyboards/keychron/v2/v2.c | 8 -------- keyboards/keychron/v3/config.h | 6 ------ keyboards/keychron/v3/info.json | 5 +++++ keyboards/keychron/v3/v3.c | 13 ------------- keyboards/keychron/v4/config.h | 6 ------ keyboards/keychron/v4/info.json | 5 +++++ keyboards/keychron/v4/v4.c | 8 -------- keyboards/keychron/v5/config.h | 6 ------ keyboards/keychron/v5/info.json | 5 +++++ keyboards/keychron/v5/v5.c | 9 --------- keyboards/keychron/v6/config.h | 5 ----- keyboards/keychron/v6/info.json | 5 +++++ keyboards/keychron/v6/v6.c | 9 --------- keyboards/keychron/v7/config.h | 6 ------ keyboards/keychron/v7/info.json | 5 +++++ keyboards/keychron/v7/v7.c | 8 -------- keyboards/keychron/v8/config.h | 6 ------ keyboards/keychron/v8/info.json | 5 +++++ keyboards/keychron/v8/v8.c | 8 -------- 87 files changed, 117 insertions(+), 466 deletions(-) create mode 100644 keyboards/keychron/q10/info.json create mode 100644 keyboards/keychron/q12/info.json create mode 100644 keyboards/keychron/q6/info.json create mode 100644 keyboards/keychron/q60/info.json create mode 100644 keyboards/keychron/q65/info.json create mode 100644 keyboards/keychron/s1/info.json create mode 100644 keyboards/keychron/v1/info.json create mode 100644 keyboards/keychron/v10/info.json create mode 100644 keyboards/keychron/v2/info.json create mode 100644 keyboards/keychron/v3/info.json create mode 100644 keyboards/keychron/v4/info.json create mode 100644 keyboards/keychron/v5/info.json create mode 100644 keyboards/keychron/v6/info.json create mode 100644 keyboards/keychron/v7/info.json create mode 100644 keyboards/keychron/v8/info.json diff --git a/keyboards/keychron/c1_pro/c1_pro.c b/keyboards/keychron/c1_pro/c1_pro.c index 607cd958ade9..178dca81215a 100644 --- a/keyboards/keychron/c1_pro/c1_pro.c +++ b/keyboards/keychron/c1_pro/c1_pro.c @@ -16,19 +16,6 @@ #include "quantum.h" -// clang-format off - -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111101111, -}; - -// clang-format on - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/c1_pro/config.h b/keyboards/keychron/c1_pro/config.h index 2d8149047125..78415190b726 100644 --- a/keyboards/keychron/c1_pro/config.h +++ b/keyboards/keychron/c1_pro/config.h @@ -16,12 +16,6 @@ #pragma once -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* EEPROM Driver Configuration */ #define WEAR_LEVELING_LOGICAL_SIZE 2048 #define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2) diff --git a/keyboards/keychron/c1_pro/info.json b/keyboards/keychron/c1_pro/info.json index 9c9b4bf16f85..080392ea4899 100644 --- a/keyboards/keychron/c1_pro/info.json +++ b/keyboards/keychron/c1_pro/info.json @@ -17,6 +17,9 @@ "mousekey": true, "nkro": true }, + "dip_switch": { + "matrix_grid": [ [5, 4] ] + }, "matrix_pins": { "cols": ["C14", "C15", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "B0", "B1", "A8", "A9", "A10", "H3"], "rows": ["B5", "B4", "B3", "A15", "A14", "A13"] diff --git a/keyboards/keychron/c2_pro/c2_pro.c b/keyboards/keychron/c2_pro/c2_pro.c index 2cd58ab4d796..593e40499704 100644 --- a/keyboards/keychron/c2_pro/c2_pro.c +++ b/keyboards/keychron/c2_pro/c2_pro.c @@ -16,18 +16,6 @@ #include "quantum.h" -// clang-format off -const matrix_row_t matrix_mask[] = { - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111101111, -}; - -// clang-format on - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/c2_pro/config.h b/keyboards/keychron/c2_pro/config.h index 6971ebd1aa8c..7422e29f6f0d 100644 --- a/keyboards/keychron/c2_pro/config.h +++ b/keyboards/keychron/c2_pro/config.h @@ -16,12 +16,6 @@ #pragma once -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* EEPROM Driver Configuration */ #define WEAR_LEVELING_LOGICAL_SIZE 2048 #define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2) diff --git a/keyboards/keychron/c2_pro/info.json b/keyboards/keychron/c2_pro/info.json index dd97dd7adf24..736a2e86a163 100644 --- a/keyboards/keychron/c2_pro/info.json +++ b/keyboards/keychron/c2_pro/info.json @@ -17,6 +17,9 @@ "mousekey": true, "nkro": true }, + "dip_switch": { + "matrix_grid": [ [5, 4] ] + }, "matrix_pins": { "cols": ["A10", "A9", "A8", "B1", "B0", "A7", "A6", "A5", "A4", "A3", "A2", "NO_PIN", "NO_PIN", "NO_PIN", "NO_PIN", "NO_PIN", "NO_PIN", "NO_PIN", "NO_PIN", "C14"], "rows": ["B5", "B4", "B3", "A15", "A14", "A13"], diff --git a/keyboards/keychron/q10/config.h b/keyboards/keychron/q10/config.h index e999515abc49..0a19cc008ca7 100644 --- a/keyboards/keychron/q10/config.h +++ b/keyboards/keychron/q10/config.h @@ -44,12 +44,6 @@ #define SNLED27351_CURRENT_TUNE \ { 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {5,5} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* Disable RGB lighting when PC is in suspend */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/q10/info.json b/keyboards/keychron/q10/info.json new file mode 100644 index 000000000000..98a376bd205e --- /dev/null +++ b/keyboards/keychron/q10/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [5, 5] ] + } +} diff --git a/keyboards/keychron/q10/q10.c b/keyboards/keychron/q10/q10.c index 455a2a25f28b..754b14817503 100644 --- a/keyboards/keychron/q10/q10.c +++ b/keyboards/keychron/q10/q10.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111011111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q11/config.h b/keyboards/keychron/q11/config.h index 949e5cf1da95..184785ed9805 100755 --- a/keyboards/keychron/q11/config.h +++ b/keyboards/keychron/q11/config.h @@ -16,15 +16,6 @@ #pragma once -// Connects each switch in the dip switch to the GPIO pin of the MCU -#define DIP_SWITCH_PINS \ - { A8 } - -/* handedness */ -#define SPLIT_HAND_MATRIX_GRID A2, A15 - -#define MATRIX_MASKED // actual mask is defined by `matrix_mask` in `q11.c` - /* RGB Matrix Driver Configuration */ #define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND diff --git a/keyboards/keychron/q11/info.json b/keyboards/keychron/q11/info.json index f240c7080102..8b962e4a768c 100755 --- a/keyboards/keychron/q11/info.json +++ b/keyboards/keychron/q11/info.json @@ -11,6 +11,9 @@ "bootmagic": { "matrix": [0, 1] }, + "dip_switch": { + "pins": ["A8"] + }, "features": { "bootmagic": true, "command": false, @@ -36,6 +39,9 @@ ] } }, + "handedness": { + "matrix_grid": ["A2", "A15"] + }, "matrix_pins": { "right": { "cols": ["A8", "A7", "A6", "A5", "A4", "A3", "A2", "A1", "A0"], diff --git a/keyboards/keychron/q11/q11.c b/keyboards/keychron/q11/q11.c index bf7bab4b5397..f643113ea3b9 100755 --- a/keyboards/keychron/q11/q11.c +++ b/keyboards/keychron/q11/q11.c @@ -16,25 +16,6 @@ #include "quantum.h" -// Mask out handedness diode to prevent it -// from keeping the keyboard awake -// - just mirroring `KC_NO` in the `LAYOUT` -// macro to keep it simple -const matrix_row_t matrix_mask[] = { - 0b011111111, - 0b011111111, - 0b011011111, - 0b001111111, - 0b011111111, - 0b001011111, - 0b111111111, - 0b101111111, - 0b111111111, - 0b110111111, - 0b010111111, - 0b111011110, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { if (!dip_switch_update_user(index, active)) { diff --git a/keyboards/keychron/q12/config.h b/keyboards/keychron/q12/config.h index 2f6a277439e4..e13238d9ee24 100644 --- a/keyboards/keychron/q12/config.h +++ b/keyboards/keychron/q12/config.h @@ -39,16 +39,8 @@ #define SNLED27351_CURRENT_TUNE \ { 0xAD, 0xAD, 0x55, 0xAD, 0xAD, 0x55, 0xAD, 0xAD, 0x55, 0xAD, 0xAD, 0x55 } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } #define SCAN_COUNT_MAX 100 -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/q12/info.json b/keyboards/keychron/q12/info.json new file mode 100644 index 000000000000..7019c8755b15 --- /dev/null +++ b/keyboards/keychron/q12/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [5, 4] ] + } +} diff --git a/keyboards/keychron/q12/q12.c b/keyboards/keychron/q12/q12.c index 3d8eab56590b..9a019af6aced 100644 --- a/keyboards/keychron/q12/q12.c +++ b/keyboards/keychron/q12/q12.c @@ -16,16 +16,6 @@ #include "quantum.h" -// clang-format off -const matrix_row_t matrix_mask[] = { - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111101111, -}; -// clang-format on #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { if (!dip_switch_update_user(index, active)) { diff --git a/keyboards/keychron/q1v1/ansi/ansi.c b/keyboards/keychron/q1v1/ansi/ansi.c index bc352a19641c..f45907eaf638 100644 --- a/keyboards/keychron/q1v1/ansi/ansi.c +++ b/keyboards/keychron/q1v1/ansi/ansi.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b0111111111111101, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, -}; - #ifdef RGB_MATRIX_ENABLE const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { /* Refer to IS31 manual for these locations diff --git a/keyboards/keychron/q1v1/ansi_encoder/ansi_encoder.c b/keyboards/keychron/q1v1/ansi_encoder/ansi_encoder.c index 387f3e0b3264..1c15ac633d5c 100644 --- a/keyboards/keychron/q1v1/ansi_encoder/ansi_encoder.c +++ b/keyboards/keychron/q1v1/ansi_encoder/ansi_encoder.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b0111111111111101, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, -}; - #ifdef RGB_MATRIX_ENABLE const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { /* Refer to IS31 manual for these locations diff --git a/keyboards/keychron/q1v1/config.h b/keyboards/keychron/q1v1/config.h index aa6658e1ba5c..c61d83a0ab9a 100644 --- a/keyboards/keychron/q1v1/config.h +++ b/keyboards/keychron/q1v1/config.h @@ -20,12 +20,6 @@ #define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND #define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_VCC_VCC -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {0,1} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* Encoder Configuration*/ #define ENCODER_DEFAULT_POS 0x3 diff --git a/keyboards/keychron/q1v1/info.json b/keyboards/keychron/q1v1/info.json index 004168726934..f4a3c5bb2409 100644 --- a/keyboards/keychron/q1v1/info.json +++ b/keyboards/keychron/q1v1/info.json @@ -17,6 +17,9 @@ "nkro": true, "rgb_matrix": true }, + "dip_switch": { + "matrix_grid": [ [0, 1] ] + }, "matrix_pins": { "cols": ["D5", "D4", "D6", "D7", "B4", "B5", "B6", "C6", "C7", "F7", "F6", "F5", "F4", "F1", "F0"], "rows": ["D3", "D2", "B3", "B2", "B1", "B0"] diff --git a/keyboards/keychron/q1v1/iso/iso.c b/keyboards/keychron/q1v1/iso/iso.c index ad3152adcd44..109eb012828f 100644 --- a/keyboards/keychron/q1v1/iso/iso.c +++ b/keyboards/keychron/q1v1/iso/iso.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b0111111111111101, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, -}; - #ifdef RGB_MATRIX_ENABLE const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { /* Refer to IS31 manual for these locations diff --git a/keyboards/keychron/q1v1/iso_encoder/iso_encoder.c b/keyboards/keychron/q1v1/iso_encoder/iso_encoder.c index 19122aa18d9b..e46a17cdc633 100644 --- a/keyboards/keychron/q1v1/iso_encoder/iso_encoder.c +++ b/keyboards/keychron/q1v1/iso_encoder/iso_encoder.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b0111111111111101, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, - 0b0111111111111111, -}; - #ifdef RGB_MATRIX_ENABLE const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { diff --git a/keyboards/keychron/q1v2/config.h b/keyboards/keychron/q1v2/config.h index 67c7cae5bb7c..7f94cbee5593 100644 --- a/keyboards/keychron/q1v2/config.h +++ b/keyboards/keychron/q1v2/config.h @@ -27,15 +27,6 @@ #define I2C1_TIMINGR_SCLH 15U #define I2C1_TIMINGR_SCLL 51U -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* Disable RGB lighting when PC is in suspend */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/q1v2/info.json b/keyboards/keychron/q1v2/info.json index b40c41c7606e..03411bd4def9 100644 --- a/keyboards/keychron/q1v2/info.json +++ b/keyboards/keychron/q1v2/info.json @@ -18,6 +18,9 @@ "rgb_matrix": true, "dip_switch": true }, + "dip_switch": { + "matrix_grid": [ [5, 4] ] + }, "matrix_pins": { "cols": ["C14", "C15", "A0", "A1", "A2", "A3", "A4", "A5", null, null, null, null, null, null, null, null], "rows": ["B5", "B4", "B3", "A15", "A14", "A13"], diff --git a/keyboards/keychron/q1v2/q1v2.c b/keyboards/keychron/q1v2/q1v2.c index 4f83a760d385..1de8f205c7e6 100644 --- a/keyboards/keychron/q1v2/q1v2.c +++ b/keyboards/keychron/q1v2/q1v2.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { if (!dip_switch_update_user(index, active)) { diff --git a/keyboards/keychron/q2/config.h b/keyboards/keychron/q2/config.h index d0beff49f0a4..e55d78afd52b 100644 --- a/keyboards/keychron/q2/config.h +++ b/keyboards/keychron/q2/config.h @@ -18,18 +18,12 @@ #define MATRIX_UNSELECT_DRIVE_HIGH -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {4, 4} } - /* RGB Matrix Driver Configuration */ #define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_VDDIO #define SNLED27351_I2C_ADDRESS_2 SNLED27351_I2C_ADDRESS_GND #define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/q2/info.json b/keyboards/keychron/q2/info.json index 47d9aa83b188..e18c9b2448c2 100644 --- a/keyboards/keychron/q2/info.json +++ b/keyboards/keychron/q2/info.json @@ -22,6 +22,9 @@ "nkro": true, "rgb_matrix": true }, + "dip_switch": { + "matrix_grid": [ [4, 4] ] + }, "matrix_pins": { "cols": ["C14", "C15", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "B0", "B1", "A8", "A9", "H3"], "rows": ["B4", "B3", "A15", "A14", "A13"] diff --git a/keyboards/keychron/q2/q2.c b/keyboards/keychron/q2/q2.c index 7ff85556def5..1dd839eccc22 100644 --- a/keyboards/keychron/q2/q2.c +++ b/keyboards/keychron/q2/q2.c @@ -16,14 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q3/config.h b/keyboards/keychron/q3/config.h index 6af0afd18ff4..176e14a5e269 100644 --- a/keyboards/keychron/q3/config.h +++ b/keyboards/keychron/q3/config.h @@ -29,12 +29,6 @@ #define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {5, 4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* Encoder Configuration*/ #define ENCODER_DEFAULT_POS 0x3 diff --git a/keyboards/keychron/q3/info.json b/keyboards/keychron/q3/info.json index c08d73f26a1e..6d1bb49d6e16 100644 --- a/keyboards/keychron/q3/info.json +++ b/keyboards/keychron/q3/info.json @@ -3,6 +3,9 @@ "maintainer": "lalalademaxiya1", "bootloader": "stm32-dfu", "diode_direction": "ROW2COL", + "dip_switch": { + "matrix_grid": [ [5, 4] ] + }, "eeprom": { "wear_leveling": { "backing_size": 4096 diff --git a/keyboards/keychron/q3/q3.c b/keyboards/keychron/q3/q3.c index 2bf8bf08a0b1..846b58d4a7b9 100644 --- a/keyboards/keychron/q3/q3.c +++ b/keyboards/keychron/q3/q3.c @@ -17,19 +17,6 @@ #include "quantum.h" #include "rgb_matrix.h" -// clang-format off - -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111101111, -}; - -// clang-format on - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q4/config.h b/keyboards/keychron/q4/config.h index 97f480ea31cf..a46d98eb06ea 100644 --- a/keyboards/keychron/q4/config.h +++ b/keyboards/keychron/q4/config.h @@ -16,12 +16,6 @@ #pragma once -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {4,4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/q4/info.json b/keyboards/keychron/q4/info.json index 0a9dcf495783..4e88d4db6af1 100644 --- a/keyboards/keychron/q4/info.json +++ b/keyboards/keychron/q4/info.json @@ -4,6 +4,9 @@ "maintainer": "lalalademaxiya1", "bootloader": "stm32-dfu", "diode_direction": "ROW2COL", + "dip_switch": { + "matrix_grid": [ [4, 4] ] + }, "dynamic_keymap": { "layer_count": 5 }, diff --git a/keyboards/keychron/q4/q4.c b/keyboards/keychron/q4/q4.c index c3cb67bcc2ec..54ad01250fc8 100644 --- a/keyboards/keychron/q4/q4.c +++ b/keyboards/keychron/q4/q4.c @@ -16,14 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b11111111111111, - 0b11111111111111, - 0b11111111111111, - 0b11111111111111, - 0b11111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q5/config.h b/keyboards/keychron/q5/config.h index 240baeea6c8e..3fa242199934 100644 --- a/keyboards/keychron/q5/config.h +++ b/keyboards/keychron/q5/config.h @@ -33,12 +33,6 @@ #define SNLED27351_CURRENT_TUNE \ { 0xB6, 0xB6, 0x56, 0xB6, 0xB6, 0x56, 0xB6, 0xB6, 0x56, 0xB6, 0xB6, 0x56 } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {5, 4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/q5/info.json b/keyboards/keychron/q5/info.json index 243f70ddf1ff..f1cdd43c4e41 100644 --- a/keyboards/keychron/q5/info.json +++ b/keyboards/keychron/q5/info.json @@ -4,6 +4,9 @@ "maintainer": "lalalademaxiya1", "bootloader": "stm32-dfu", "diode_direction": "ROW2COL", + "dip_switch": { + "matrix_grid": [ [5, 4] ] + }, "eeprom": { "wear_leveling": { "backing_size": 4096 diff --git a/keyboards/keychron/q5/q5.c b/keyboards/keychron/q5/q5.c index 7a1cabcd1a5b..4026e9dea83c 100644 --- a/keyboards/keychron/q5/q5.c +++ b/keyboards/keychron/q5/q5.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q6/config.h b/keyboards/keychron/q6/config.h index ff8cd1142b34..4b9963de8549 100644 --- a/keyboards/keychron/q6/config.h +++ b/keyboards/keychron/q6/config.h @@ -30,12 +30,6 @@ #define SNLED27351_CURRENT_TUNE \ { 0xA4, 0xA4, 0x52, 0xA4, 0xA4, 0x52, 0xA4, 0xA4, 0x52, 0xA4, 0xA4, 0x52 } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {5, 4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/q6/info.json b/keyboards/keychron/q6/info.json new file mode 100644 index 000000000000..7019c8755b15 --- /dev/null +++ b/keyboards/keychron/q6/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [5, 4] ] + } +} diff --git a/keyboards/keychron/q6/q6.c b/keyboards/keychron/q6/q6.c index 8a9750e9de4f..c1dc38a3fcf0 100644 --- a/keyboards/keychron/q6/q6.c +++ b/keyboards/keychron/q6/q6.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q60/config.h b/keyboards/keychron/q60/config.h index 3a6c3ea8ee41..c22e74da97ba 100644 --- a/keyboards/keychron/q60/config.h +++ b/keyboards/keychron/q60/config.h @@ -29,12 +29,6 @@ #define SNLED27351_CURRENT_TUNE \ { 0xD8, 0xD8, 0x60, 0xD8, 0xD8, 0x60, 0xD8, 0xD8, 0x60, 0xD8, 0xD8, 0x60 } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {4,4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/q60/info.json b/keyboards/keychron/q60/info.json new file mode 100644 index 000000000000..5084aad92720 --- /dev/null +++ b/keyboards/keychron/q60/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [4, 4] ] + } +} diff --git a/keyboards/keychron/q60/q60.c b/keyboards/keychron/q60/q60.c index d97f72fb8ea1..c6f2d1a38c74 100644 --- a/keyboards/keychron/q60/q60.c +++ b/keyboards/keychron/q60/q60.c @@ -16,14 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b11111111111111, - 0b11111111111111, - 0b11111111111111, - 0b11111111111111, - 0b11111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q65/config.h b/keyboards/keychron/q65/config.h index 99eb4572cfbc..abea6f65993e 100644 --- a/keyboards/keychron/q65/config.h +++ b/keyboards/keychron/q65/config.h @@ -40,12 +40,6 @@ #define SNLED27351_CURRENT_TUNE \ { 0xB8, 0xB8, 0x58, 0xB8, 0xB8, 0x58, 0xB8, 0xB8, 0x58, 0xB8, 0xB8, 0x58 } -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {4,4} } - /* Turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/q65/info.json b/keyboards/keychron/q65/info.json new file mode 100644 index 000000000000..5084aad92720 --- /dev/null +++ b/keyboards/keychron/q65/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [4, 4] ] + } +} diff --git a/keyboards/keychron/q65/q65.c b/keyboards/keychron/q65/q65.c index 18fa8697c79d..e293733bfe66 100644 --- a/keyboards/keychron/q65/q65.c +++ b/keyboards/keychron/q65/q65.c @@ -16,14 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q7/config.h b/keyboards/keychron/q7/config.h index 00f09dd1bf8d..4a2a6af9e3a9 100644 --- a/keyboards/keychron/q7/config.h +++ b/keyboards/keychron/q7/config.h @@ -30,9 +30,3 @@ #define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL #define SNLED27351_CURRENT_TUNE \ { 0xF8, 0xF8, 0x80, 0xF8, 0xF8, 0x80, 0xF8, 0xF8, 0x80, 0xF8, 0xF8, 0x80 } - -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {4,4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED \ No newline at end of file diff --git a/keyboards/keychron/q7/info.json b/keyboards/keychron/q7/info.json index d6d0c5d1fc99..6b8a94ce9913 100644 --- a/keyboards/keychron/q7/info.json +++ b/keyboards/keychron/q7/info.json @@ -4,6 +4,9 @@ "maintainer": "lalalademaxiya1", "bootloader": "stm32-dfu", "diode_direction": "ROW2COL", + "dip_switch": { + "matrix_grid": [ [4, 4] ] + }, "dynamic_keymap": { "layer_count": 5 }, diff --git a/keyboards/keychron/q7/q7.c b/keyboards/keychron/q7/q7.c index abd4ac11f030..d020f6ab4307 100644 --- a/keyboards/keychron/q7/q7.c +++ b/keyboards/keychron/q7/q7.c @@ -16,14 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q8/config.h b/keyboards/keychron/q8/config.h index 163d3775d956..df9c1a9a3077 100644 --- a/keyboards/keychron/q8/config.h +++ b/keyboards/keychron/q8/config.h @@ -34,12 +34,6 @@ #define SNLED27351_CURRENT_TUNE \ { 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60 } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {4, 4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* Encoder Configuration */ #define ENCODER_DEFAULT_POS 0x3 diff --git a/keyboards/keychron/q8/info.json b/keyboards/keychron/q8/info.json index 7f98bf537c62..4d4677f8af66 100644 --- a/keyboards/keychron/q8/info.json +++ b/keyboards/keychron/q8/info.json @@ -4,6 +4,9 @@ "maintainer": "lalalademaxiya1", "bootloader": "stm32-dfu", "diode_direction": "ROW2COL", + "dip_switch": { + "matrix_grid": [ [4, 4] ] + }, "dynamic_keymap": { "layer_count": 5 }, diff --git a/keyboards/keychron/q8/q8.c b/keyboards/keychron/q8/q8.c index a653bdc8b934..c28f992f8e7c 100644 --- a/keyboards/keychron/q8/q8.c +++ b/keyboards/keychron/q8/q8.c @@ -16,14 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q9/config.h b/keyboards/keychron/q9/config.h index 8b5cc06d8bd9..09b7be045961 100644 --- a/keyboards/keychron/q9/config.h +++ b/keyboards/keychron/q9/config.h @@ -16,12 +16,6 @@ #pragma once -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { { 3, 4 } } - /* RGB Matrix Driver Configuration */ #define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND diff --git a/keyboards/keychron/q9/info.json b/keyboards/keychron/q9/info.json index 5cc519c72041..5dd1134ba6b0 100644 --- a/keyboards/keychron/q9/info.json +++ b/keyboards/keychron/q9/info.json @@ -22,6 +22,9 @@ "nkro": true, "rgb_matrix": true }, + "dip_switch": { + "matrix_grid": [ [3, 4] ] + }, "matrix_pins": { "cols": ["A10", "A9", "A8", "B1", "B0", "A7", "A6", "A5", "A4", "A3", "A2", "A1", "A0", "C15", "C14"], "rows": ["B3", "A15", "A14", "A13"] diff --git a/keyboards/keychron/q9/q9.c b/keyboards/keychron/q9/q9.c index 51dea886f1ca..d020f6ab4307 100644 --- a/keyboards/keychron/q9/q9.c +++ b/keyboards/keychron/q9/q9.c @@ -16,13 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/q9_plus/config.h b/keyboards/keychron/q9_plus/config.h index cbd3c8b11b23..16a274217d89 100755 --- a/keyboards/keychron/q9_plus/config.h +++ b/keyboards/keychron/q9_plus/config.h @@ -16,12 +16,6 @@ #pragma once -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID {{ 3, 4 }} - /* RGB Matrix Driver Configuration */ #define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND diff --git a/keyboards/keychron/q9_plus/info.json b/keyboards/keychron/q9_plus/info.json index 9f8703de37b1..0abc5b591e51 100755 --- a/keyboards/keychron/q9_plus/info.json +++ b/keyboards/keychron/q9_plus/info.json @@ -19,6 +19,9 @@ "nkro": true, "rgb_matrix": true }, + "dip_switch": { + "matrix_grid": [ [3, 4] ] + }, "matrix_pins": { "cols": ["A10", "A9", "A8", "B1", "B0", "A7", "A6", "A5", "A4", "A3", "A2", "A1", "A0", "C15", "C14"], "rows": ["B3", "A15", "A14", "A13"] diff --git a/keyboards/keychron/q9_plus/q9_plus.c b/keyboards/keychron/q9_plus/q9_plus.c index 848117d323be..77fd5f3cb003 100755 --- a/keyboards/keychron/q9_plus/q9_plus.c +++ b/keyboards/keychron/q9_plus/q9_plus.c @@ -16,13 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { if (!dip_switch_update_user(index, active)) { diff --git a/keyboards/keychron/s1/config.h b/keyboards/keychron/s1/config.h index 8c9838952272..adea1822e578 100644 --- a/keyboards/keychron/s1/config.h +++ b/keyboards/keychron/s1/config.h @@ -16,12 +16,6 @@ #pragma once -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {5,4} } - /* EEPROM Driver Configuration */ #define WEAR_LEVELING_LOGICAL_SIZE 2048 #define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2) diff --git a/keyboards/keychron/s1/info.json b/keyboards/keychron/s1/info.json new file mode 100644 index 000000000000..7019c8755b15 --- /dev/null +++ b/keyboards/keychron/s1/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [5, 4] ] + } +} diff --git a/keyboards/keychron/s1/s1.c b/keyboards/keychron/s1/s1.c index d8488dd6ea6f..2f1b905505f4 100644 --- a/keyboards/keychron/s1/s1.c +++ b/keyboards/keychron/s1/s1.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/v1/config.h b/keyboards/keychron/v1/config.h index 84334306ddc7..8fe649593752 100644 --- a/keyboards/keychron/v1/config.h +++ b/keyboards/keychron/v1/config.h @@ -25,12 +25,6 @@ /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION ROW2COL -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {5,4} } - /* RGB Matrix Driver Configuration */ #define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_VDDIO #define SNLED27351_I2C_ADDRESS_2 SNLED27351_I2C_ADDRESS_GND diff --git a/keyboards/keychron/v1/info.json b/keyboards/keychron/v1/info.json new file mode 100644 index 000000000000..7019c8755b15 --- /dev/null +++ b/keyboards/keychron/v1/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [5, 4] ] + } +} diff --git a/keyboards/keychron/v1/v1.c b/keyboards/keychron/v1/v1.c index 79c591917475..7f93b37bcc3b 100644 --- a/keyboards/keychron/v1/v1.c +++ b/keyboards/keychron/v1/v1.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/v10/config.h b/keyboards/keychron/v10/config.h index 01d3b3e04212..719a5829fff4 100644 --- a/keyboards/keychron/v10/config.h +++ b/keyboards/keychron/v10/config.h @@ -44,12 +44,6 @@ #define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL #define SNLED27351_CURRENT_TUNE { 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {5,5} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* Disable RGB lighting when PC is in suspend */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/v10/info.json b/keyboards/keychron/v10/info.json new file mode 100644 index 000000000000..98a376bd205e --- /dev/null +++ b/keyboards/keychron/v10/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [5, 5] ] + } +} diff --git a/keyboards/keychron/v10/v10.c b/keyboards/keychron/v10/v10.c index 2e1e3f090f03..1bde388544cc 100644 --- a/keyboards/keychron/v10/v10.c +++ b/keyboards/keychron/v10/v10.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111011111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/v2/config.h b/keyboards/keychron/v2/config.h index f42e87368bda..e90e60fa35b5 100644 --- a/keyboards/keychron/v2/config.h +++ b/keyboards/keychron/v2/config.h @@ -32,12 +32,6 @@ #define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {4,4} } - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/v2/info.json b/keyboards/keychron/v2/info.json new file mode 100644 index 000000000000..5084aad92720 --- /dev/null +++ b/keyboards/keychron/v2/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [4, 4] ] + } +} diff --git a/keyboards/keychron/v2/v2.c b/keyboards/keychron/v2/v2.c index 7703c280df08..f2aed82fa91c 100644 --- a/keyboards/keychron/v2/v2.c +++ b/keyboards/keychron/v2/v2.c @@ -16,14 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/v3/config.h b/keyboards/keychron/v3/config.h index 9532062aaa62..6fe3e4dd9706 100644 --- a/keyboards/keychron/v3/config.h +++ b/keyboards/keychron/v3/config.h @@ -32,12 +32,6 @@ #define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {5, 4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/v3/info.json b/keyboards/keychron/v3/info.json new file mode 100644 index 000000000000..7019c8755b15 --- /dev/null +++ b/keyboards/keychron/v3/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [5, 4] ] + } +} diff --git a/keyboards/keychron/v3/v3.c b/keyboards/keychron/v3/v3.c index 17ea8f0e9790..4452556ca688 100644 --- a/keyboards/keychron/v3/v3.c +++ b/keyboards/keychron/v3/v3.c @@ -16,19 +16,6 @@ #include "quantum.h" -// clang-format off - -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111101111, -}; - -// clang-format on - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/v4/config.h b/keyboards/keychron/v4/config.h index 27147555ea9d..4c121c9edeee 100644 --- a/keyboards/keychron/v4/config.h +++ b/keyboards/keychron/v4/config.h @@ -29,12 +29,6 @@ #define SNLED27351_CURRENT_TUNE \ { 0xD0, 0xD0, 0x60, 0xD0, 0xD0, 0x60, 0xD0, 0xD0, 0x60, 0xD0, 0xD0, 0x60 } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {4,4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/v4/info.json b/keyboards/keychron/v4/info.json new file mode 100644 index 000000000000..5084aad92720 --- /dev/null +++ b/keyboards/keychron/v4/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [4, 4] ] + } +} diff --git a/keyboards/keychron/v4/v4.c b/keyboards/keychron/v4/v4.c index 402eadf2d77a..d020f6ab4307 100644 --- a/keyboards/keychron/v4/v4.c +++ b/keyboards/keychron/v4/v4.c @@ -16,14 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b11111111111111, - 0b11111111111111, - 0b11111111111111, - 0b11111111111111, - 0b11111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/v5/config.h b/keyboards/keychron/v5/config.h index 128c0aa9f19c..d49649c80903 100644 --- a/keyboards/keychron/v5/config.h +++ b/keyboards/keychron/v5/config.h @@ -39,12 +39,6 @@ #define SNLED27351_CURRENT_TUNE \ { 0xB6, 0xB6, 0x56, 0xB6, 0xB6, 0x56, 0xB6, 0xB6, 0x56, 0xB6, 0xB6, 0x56 } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {5, 4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/v5/info.json b/keyboards/keychron/v5/info.json new file mode 100644 index 000000000000..7019c8755b15 --- /dev/null +++ b/keyboards/keychron/v5/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [5, 4] ] + } +} diff --git a/keyboards/keychron/v5/v5.c b/keyboards/keychron/v5/v5.c index 6d87524b2333..050ea18c0cff 100644 --- a/keyboards/keychron/v5/v5.c +++ b/keyboards/keychron/v5/v5.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111111111, - 0b111111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/v6/config.h b/keyboards/keychron/v6/config.h index 129f3925bb7d..ff16573b93ee 100644 --- a/keyboards/keychron/v6/config.h +++ b/keyboards/keychron/v6/config.h @@ -33,13 +33,8 @@ /* Limit the maximum brigtness current of colour white to 500mA */ #define SNLED27351_CURRENT_TUNE { 0xA8, 0xA8, 0x48, 0xA8, 0xA8, 0x48, 0xA8, 0xA8, 0x48, 0xA8, 0xA8, 0x48 } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {5, 4} } #define SCAN_COUNT_MAX 100 -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/v6/info.json b/keyboards/keychron/v6/info.json new file mode 100644 index 000000000000..7019c8755b15 --- /dev/null +++ b/keyboards/keychron/v6/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [5, 4] ] + } +} diff --git a/keyboards/keychron/v6/v6.c b/keyboards/keychron/v6/v6.c index 0f9305d2d05f..8aeab5e952ff 100644 --- a/keyboards/keychron/v6/v6.c +++ b/keyboards/keychron/v6/v6.c @@ -16,15 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111111111, - 0b11111111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/v7/config.h b/keyboards/keychron/v7/config.h index 500e4df30d56..40c4aee28b1e 100644 --- a/keyboards/keychron/v7/config.h +++ b/keyboards/keychron/v7/config.h @@ -30,12 +30,6 @@ #define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL #define SNLED27351_CURRENT_TUNE { 0xFC, 0xFC, 0x70, 0xFC, 0xFC, 0x70, 0xFC, 0xFC, 0x70, 0xFC, 0xFC, 0x70 } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {4,4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/v7/info.json b/keyboards/keychron/v7/info.json new file mode 100644 index 000000000000..5084aad92720 --- /dev/null +++ b/keyboards/keychron/v7/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [4, 4] ] + } +} diff --git a/keyboards/keychron/v7/v7.c b/keyboards/keychron/v7/v7.c index e6b8309cae7c..215b4922dc12 100644 --- a/keyboards/keychron/v7/v7.c +++ b/keyboards/keychron/v7/v7.c @@ -16,14 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111111111, - 0b1111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { diff --git a/keyboards/keychron/v8/config.h b/keyboards/keychron/v8/config.h index c9db5c07550e..7b139dbd54ae 100644 --- a/keyboards/keychron/v8/config.h +++ b/keyboards/keychron/v8/config.h @@ -33,12 +33,6 @@ #define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_9_CHANNEL #define SNLED27351_CURRENT_TUNE { 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60 } -/* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID { {4, 4} } - -/* Disable DIP switch in matrix data */ -#define MATRIX_MASKED - /* Turn off effects when suspended */ #define RGB_MATRIX_SLEEP diff --git a/keyboards/keychron/v8/info.json b/keyboards/keychron/v8/info.json new file mode 100644 index 000000000000..5084aad92720 --- /dev/null +++ b/keyboards/keychron/v8/info.json @@ -0,0 +1,5 @@ +{ + "dip_switch": { + "matrix_grid": [ [4, 4] ] + } +} diff --git a/keyboards/keychron/v8/v8.c b/keyboards/keychron/v8/v8.c index 38d3cada17af..5cc6c0782c7d 100644 --- a/keyboards/keychron/v8/v8.c +++ b/keyboards/keychron/v8/v8.c @@ -16,14 +16,6 @@ #include "quantum.h" -const matrix_row_t matrix_mask[] = { - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111111111, - 0b111111111101111, -}; - #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) {