diff --git a/keyboards/keychron/c1/ansi/rgb/rules.mk b/keyboards/keychron/c1/ansi/rgb/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/c1/ansi/rgb/rules.mk +++ b/keyboards/keychron/c1/ansi/rgb/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/c1/ansi/white/rules.mk b/keyboards/keychron/c1/ansi/white/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/c1/ansi/white/rules.mk +++ b/keyboards/keychron/c1/ansi/white/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/c1/config.h b/keyboards/keychron/c1/config.h index cf3fc1bb7d..1ee1446572 100644 --- a/keyboards/keychron/c1/config.h +++ b/keyboards/keychron/c1/config.h @@ -16,14 +16,8 @@ #pragma once -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/c2/ansi/rgb/rules.mk b/keyboards/keychron/c2/ansi/rgb/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/c2/ansi/rgb/rules.mk +++ b/keyboards/keychron/c2/ansi/rgb/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/c2/ansi/white/rules.mk b/keyboards/keychron/c2/ansi/white/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/c2/ansi/white/rules.mk +++ b/keyboards/keychron/c2/ansi/white/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/c2/config.h b/keyboards/keychron/c2/config.h index 1e0bf7f8d6..4ab73090a8 100644 --- a/keyboards/keychron/c2/config.h +++ b/keyboards/keychron/c2/config.h @@ -16,14 +16,8 @@ #pragma once -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/common/keychron_common.c b/keyboards/keychron/common/keychron_common.c index 424dbed617..e9cff63011 100644 --- a/keyboards/keychron/common/keychron_common.c +++ b/keyboards/keychron/common/keychron_common.c @@ -189,34 +189,12 @@ bool led_update_kb(led_t led_state) { #endif -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; /* Don't process further events if user function exists and returns false */ - } - if (index == 0) { /* First encoder */ - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } else if (index == 1) { /* Second encoder */ - if (clockwise) { - tap_code_delay(KC_VOLU, 10); - } else { - tap_code_delay(KC_VOLD, 10); - } - } - return true; -} -#endif - #if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) static void encoder_pad_cb(void *param) { encoder_inerrupt_read((uint32_t)param & 0XFF); } -void keyboard_post_init_keychron(void) { +__attribute__((weak)) void keyboard_post_init_kb(void) { pin_t encoders_pad_a[NUM_ENCODERS] = ENCODERS_PAD_A; pin_t encoders_pad_b[NUM_ENCODERS] = ENCODERS_PAD_B; for (uint32_t i = 0; i < NUM_ENCODERS; i++) { diff --git a/keyboards/keychron/common/keychron_ft_common.c b/keyboards/keychron/common/keychron_ft_common.c index cf4cb750af..b4c36889ea 100644 --- a/keyboards/keychron/common/keychron_ft_common.c +++ b/keyboards/keychron/common/keychron_ft_common.c @@ -17,6 +17,11 @@ #include "keychron_ft_common.h" #include "raw_hid.h" +#ifndef NKRO +# include +# define RAW_EPSIZE 32 +#endif + #ifndef BL_TEST_KEY1 # define BL_TEST_KEY1 KC_RIGHT #endif diff --git a/keyboards/keychron/common/matrix.c b/keyboards/keychron/common/matrix.c index df6284bc66..af7514c5ad 100644 --- a/keyboards/keychron/common/matrix.c +++ b/keyboards/keychron/common/matrix.c @@ -18,9 +18,9 @@ #ifndef SHIFT_COL_START # define SHIFT_COL_START 8 -# ifndef SHIFT_COL_END -# define SHIFT_COL_END 15 -# endif +#endif +#ifndef SHIFT_COL_END +# define SHIFT_COL_END 15 #endif #if defined(SHIFT_COL_START) && defined(SHIFT_COL_END) diff --git a/keyboards/keychron/q0/config.h b/keyboards/keychron/q0/config.h index d32f6626c5..840728a67a 100644 --- a/keyboards/keychron/q0/config.h +++ b/keyboards/keychron/q0/config.h @@ -16,9 +16,6 @@ #pragma once -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - /* Set LED driver current */ #define CKLED2001_CURRENT_TUNE \ { 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70, 0xFF, 0xFF, 0x70 } diff --git a/keyboards/keychron/q0/q0.c b/keyboards/keychron/q0/q0.c index 821f5f5a0b..6131d01c0e 100644 --- a/keyboards/keychron/q0/q0.c +++ b/keyboards/keychron/q0/q0.c @@ -15,15 +15,3 @@ */ #include "quantum.h" -#include "keychron_common.h" - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q0/rev_0130/rules.mk b/keyboards/keychron/q0/rev_0130/rules.mk index 41120843c9..9077e5e2e3 100644 --- a/keyboards/keychron/q0/rev_0130/rules.mk +++ b/keyboards/keychron/q0/rev_0130/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q0/rev_0131/info.json b/keyboards/keychron/q0/rev_0131/info.json index 7384c527e4..d972fe04b6 100644 --- a/keyboards/keychron/q0/rev_0131/info.json +++ b/keyboards/keychron/q0/rev_0131/info.json @@ -29,7 +29,7 @@ "diode_direction": "ROW2COL", "encoder": { "rotary": [ - {"pin_a": "A3", "pin_b": "A8"} + {"pin_a": "A3", "pin_b": "A4"} ] }, "bootmagic": { diff --git a/keyboards/keychron/q0/rev_0131/rules.mk b/keyboards/keychron/q0/rev_0131/rules.mk index 41120843c9..9077e5e2e3 100644 --- a/keyboards/keychron/q0/rev_0131/rules.mk +++ b/keyboards/keychron/q0/rev_0131/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q1/ansi_atmega32u4/config.h b/keyboards/keychron/q1/ansi_atmega32u4/config.h index 17a9e0008a..ac1b3f7f0e 100644 --- a/keyboards/keychron/q1/ansi_atmega32u4/config.h +++ b/keyboards/keychron/q1/ansi_atmega32u4/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 0, 1 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 0, 1 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q1/ansi_atmega32u4_encoder/config.h b/keyboards/keychron/q1/ansi_atmega32u4_encoder/config.h index 3a9f79ba70..1fa21464e1 100644 --- a/keyboards/keychron/q1/ansi_atmega32u4_encoder/config.h +++ b/keyboards/keychron/q1/ansi_atmega32u4_encoder/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 0, 1 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 0, 1 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q1/ansi_stm32l432/config.h b/keyboards/keychron/q1/ansi_stm32l432/config.h index f595d36eab..7e74bb9c00 100644 --- a/keyboards/keychron/q1/ansi_stm32l432/config.h +++ b/keyboards/keychron/q1/ansi_stm32l432/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q1/ansi_stm32l432/rules.mk b/keyboards/keychron/q1/ansi_stm32l432/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q1/ansi_stm32l432/rules.mk +++ b/keyboards/keychron/q1/ansi_stm32l432/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q1/ansi_stm32l432_encoder/config.h b/keyboards/keychron/q1/ansi_stm32l432_encoder/config.h index 2da095abaa..13b8ab1cec 100644 --- a/keyboards/keychron/q1/ansi_stm32l432_encoder/config.h +++ b/keyboards/keychron/q1/ansi_stm32l432_encoder/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q1/ansi_stm32l432_encoder/rules.mk b/keyboards/keychron/q1/ansi_stm32l432_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q1/ansi_stm32l432_encoder/rules.mk +++ b/keyboards/keychron/q1/ansi_stm32l432_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q1/config.h b/keyboards/keychron/q1/config.h index 7dafc452bb..b421be6902 100644 --- a/keyboards/keychron/q1/config.h +++ b/keyboards/keychron/q1/config.h @@ -16,9 +16,6 @@ #pragma once -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - /* Disable DIP switch in matrix data */ #define MATRIX_MASKED diff --git a/keyboards/keychron/q1/iso_atmega32u4/config.h b/keyboards/keychron/q1/iso_atmega32u4/config.h index 0a59fefa12..805e63cc2f 100644 --- a/keyboards/keychron/q1/iso_atmega32u4/config.h +++ b/keyboards/keychron/q1/iso_atmega32u4/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 0, 1 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 0, 1 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q1/iso_atmega32u4_encoder/config.h b/keyboards/keychron/q1/iso_atmega32u4_encoder/config.h index 7a3c0ad3b0..32d6443664 100644 --- a/keyboards/keychron/q1/iso_atmega32u4_encoder/config.h +++ b/keyboards/keychron/q1/iso_atmega32u4_encoder/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 0, 1 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 0, 1 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q1/iso_stm32l432/config.h b/keyboards/keychron/q1/iso_stm32l432/config.h index 8fc9079b62..b2840fd967 100644 --- a/keyboards/keychron/q1/iso_stm32l432/config.h +++ b/keyboards/keychron/q1/iso_stm32l432/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q1/iso_stm32l432/rules.mk b/keyboards/keychron/q1/iso_stm32l432/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q1/iso_stm32l432/rules.mk +++ b/keyboards/keychron/q1/iso_stm32l432/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q1/iso_stm32l432_encoder/config.h b/keyboards/keychron/q1/iso_stm32l432_encoder/config.h index f43553aafe..9207c9c095 100644 --- a/keyboards/keychron/q1/iso_stm32l432_encoder/config.h +++ b/keyboards/keychron/q1/iso_stm32l432_encoder/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q1/iso_stm32l432_encoder/rules.mk b/keyboards/keychron/q1/iso_stm32l432_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q1/iso_stm32l432_encoder/rules.mk +++ b/keyboards/keychron/q1/iso_stm32l432_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q1/jis_stm32l432/config.h b/keyboards/keychron/q1/jis_stm32l432/config.h index ef6a1614c8..36c3bd7f28 100644 --- a/keyboards/keychron/q1/jis_stm32l432/config.h +++ b/keyboards/keychron/q1/jis_stm32l432/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q1/jis_stm32l432/rules.mk b/keyboards/keychron/q1/jis_stm32l432/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q1/jis_stm32l432/rules.mk +++ b/keyboards/keychron/q1/jis_stm32l432/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q1/jis_stm32l432_encoder/config.h b/keyboards/keychron/q1/jis_stm32l432_encoder/config.h index bcbf3e0441..8b142a8f64 100644 --- a/keyboards/keychron/q1/jis_stm32l432_encoder/config.h +++ b/keyboards/keychron/q1/jis_stm32l432_encoder/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q1/jis_stm32l432_encoder/rules.mk b/keyboards/keychron/q1/jis_stm32l432_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q1/jis_stm32l432_encoder/rules.mk +++ b/keyboards/keychron/q1/jis_stm32l432_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q1/q1.c b/keyboards/keychron/q1/q1.c index 797e7ef6f4..8b6d6f2bf2 100644 --- a/keyboards/keychron/q1/q1.c +++ b/keyboards/keychron/q1/q1.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" #ifdef DIP_SWITCH_ENABLE bool dip_switch_update_kb(uint8_t index, bool active) { @@ -28,14 +27,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q10/ansi_encoder/rules.mk b/keyboards/keychron/q10/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q10/ansi_encoder/rules.mk +++ b/keyboards/keychron/q10/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q10/config.h b/keyboards/keychron/q10/config.h index 2d02c6b9ec..1895c52910 100644 --- a/keyboards/keychron/q10/config.h +++ b/keyboards/keychron/q10/config.h @@ -35,10 +35,7 @@ { 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 5 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 5 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/q10/iso_encoder/rules.mk b/keyboards/keychron/q10/iso_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q10/iso_encoder/rules.mk +++ b/keyboards/keychron/q10/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q10/q10.c b/keyboards/keychron/q10/q10.c index 6138d44c95..66c66afd86 100644 --- a/keyboards/keychron/q10/q10.c +++ b/keyboards/keychron/q10/q10.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b1111111111111111, @@ -37,14 +36,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q11/config.h b/keyboards/keychron/q11/config.h index d7de124681..5942318242 100755 --- a/keyboards/keychron/q11/config.h +++ b/keyboards/keychron/q11/config.h @@ -16,12 +16,8 @@ #pragma once -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - // Connects each switch in the dip switch to the GPIO pin of the MCU -#define DIP_SWITCH_PINS \ - { A8 } +#define DIP_SWITCH_PINS { A8 } /* handedness */ #define SPLIT_HAND_MATRIX_GRID A2, A15 @@ -36,7 +32,7 @@ /* RGB Matrix Configuration */ #define DRIVER_COUNT 1 #define DRIVER_ADDR_1 0b1110100 -#define DRIVER_1_LED_TOTAL 89 +#define DRIVER_1_LED_TOTAL 90 #define RGB_MATRIX_LED_COUNT DRIVER_1_LED_TOTAL #define SPLIT_TRANSPORT_MIRROR diff --git a/keyboards/keychron/q11/iso_encoder/config.h b/keyboards/keychron/q11/iso_encoder/config.h new file mode 100755 index 0000000000..08632f0ce7 --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/config.h @@ -0,0 +1,20 @@ +/* Copyright 2023 @ Keychron(https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* Enable caps-lock LED */ +#define CAPS_LOCK_LED_INDEX 23 diff --git a/keyboards/keychron/q11/iso_encoder/info.json b/keyboards/keychron/q11/iso_encoder/info.json new file mode 100755 index 0000000000..e6954978ee --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/info.json @@ -0,0 +1,167 @@ +{ + "keyboard_name": "Keychron Q11", + "manufacturer": "Keychron", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "bootloader": "stm32-dfu", + "bootmagic": { + "matrix": [0, 1] + }, + "features": { + "audio": false, + "backlight": false, + "bootmagic": true, + "command": false, + "console": false, + "dip_switch": true, + "encoder": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "rgb_matrix": true, + "rgblight": false + }, + "diode_direction": "ROW2COL", + "encoder": { + "rotary": [ + {"pin_a": "B0", "pin_b": "B1"} + ] + }, + "matrix_pins": { + "cols": ["A7", "A6", "A5", "A4", "A3", "A2", "A1", "C15", null], + "rows": ["A13", "A14", "A15", "B3", "B4", "B5"] + }, + "processor": "STM32L432", + "rgb_matrix": { + "driver": "CKLED2001", + "split_count": [43, 47] + }, + "split": { + "enabled": true, + "encoder": { + "right": { + "rotary": [ + {"pin_a": "C14", "pin_b": "C15"} + ] + } + }, + "matrix_pins": { + "right": { + "cols": ["A8", "A7", "A6", "A5", "A4", "A3", "A2", "A1", "A0"], + "rows": ["B5", "B4", "B3", "A15", "A14", "A13"] + } + }, + "transport": { + "protocol": "serial_usart", + "sync_matrix_state": false + } + }, + "usb": { + "vid": "0x3434", + "pid": "0x01E1", + "device_version": "1.0.0" + }, + "layouts": { + "LAYOUT_iso_92": { + "layout": [ + {"matrix":[0,0], "x":0, "y":0 }, + {"matrix":[0,1], "x":1.25, "y":0 }, + {"matrix":[0,2], "x":2.25, "y":0 }, + {"matrix":[0,3], "x":3.25, "y":0 }, + {"matrix":[0,4], "x":4.25, "y":0 }, + {"matrix":[0,5], "x":5.25, "y":0 }, + {"matrix":[0,6], "x":6.25, "y":0 }, + {"matrix":[0,7], "x":7.25, "y":0 }, + {"matrix":[6,0], "x":9, "y":0 }, + {"matrix":[6,1], "x":10, "y":0 }, + {"matrix":[6,2], "x":11, "y":0 }, + {"matrix":[6,3], "x":12, "y":0 }, + {"matrix":[6,4], "x":13, "y":0 }, + {"matrix":[6,5], "x":14, "y":0 }, + {"matrix":[6,6], "x":15, "y":0 }, + {"matrix":[6,7], "x":16, "y":0 }, + {"matrix":[6,8], "x":17.25, "y":0 }, + + {"matrix":[1,0], "x":0, "y":1.25 }, + {"matrix":[1,1], "x":1.25, "y":1.25 }, + {"matrix":[1,2], "x":2.25, "y":1.25 }, + {"matrix":[1,3], "x":3.25, "y":1.25 }, + {"matrix":[1,4], "x":4.25, "y":1.25 }, + {"matrix":[1,5], "x":5.25, "y":1.25 }, + {"matrix":[1,6], "x":6.25, "y":1.25 }, + {"matrix":[1,7], "x":7.25, "y":1.25 }, + {"matrix":[7,0], "x":9, "y":1.25 }, + {"matrix":[7,1], "x":10, "y":1.25 }, + {"matrix":[7,2], "x":11, "y":1.25 }, + {"matrix":[7,3], "x":12, "y":1.25 }, + {"matrix":[7,4], "x":13, "y":1.25 }, + {"matrix":[7,5], "x":14, "y":1.25 }, + {"matrix":[7,6], "x":15, "y":1.25, "w":2 }, + {"matrix":[7,8], "x":17.25, "y":1.25 }, + + {"matrix":[2,0], "x":0, "y":2.25 }, + {"matrix":[2,1], "x":1.25, "y":2.25, "w":1.5 }, + {"matrix":[2,2], "x":2.75, "y":2.25 }, + {"matrix":[2,3], "x":3.75, "y":2.25 }, + {"matrix":[2,4], "x":4.75, "y":2.25 }, + {"matrix":[2,6], "x":5.75, "y":2.25 }, + {"matrix":[2,7], "x":6.75, "y":2.25 }, + {"matrix":[8,0], "x":8.5, "y":2.25 }, + {"matrix":[8,1], "x":9.5, "y":2.25 }, + {"matrix":[8,2], "x":10.5, "y":2.25 }, + {"matrix":[8,3], "x":11.5, "y":2.25 }, + {"matrix":[8,4], "x":12.5, "y":2.25 }, + {"matrix":[8,5], "x":13.5, "y":2.25 }, + {"matrix":[8,6], "x":14.5, "y":2.25 }, + {"matrix":[8,8], "x":17.25, "y":2.25 }, + + {"matrix":[3,0], "x":0, "y":3.25 }, + {"matrix":[3,1], "x":1.25, "y":3.25, "w":1.75 }, + {"matrix":[3,2], "x":3, "y":3.25 }, + {"matrix":[3,3], "x":4, "y":3.25 }, + {"matrix":[3,4], "x":5, "y":3.25 }, + {"matrix":[3,5], "x":6, "y":3.25 }, + {"matrix":[3,6], "x":7, "y":3.25 }, + {"matrix":[9,0], "x":8.75, "y":3.25 }, + {"matrix":[9,1], "x":9.75, "y":3.25 }, + {"matrix":[9,2], "x":10.75, "y":3.25 }, + {"matrix":[9,3], "x":11.75, "y":3.25 }, + {"matrix":[9,4], "x":12.75, "y":3.25 }, + {"matrix":[9,5], "x":13.75, "y":3.25 }, + {"matrix":[9,7], "x":14.75, "y":3.25 }, + {"matrix":[8,7], "x":15.75, "y":2.25, "w":1.25, "h":2 }, + {"matrix":[9,8], "x":17.25, "y":3.25 }, + + {"matrix":[4,0], "x":0, "y":4.25 }, + {"matrix":[4,1], "x":1.25, "y":4.25, "w":1.25 }, + {"matrix":[4,2], "x":2.5, "y":4.25 }, + {"matrix":[4,3], "x":3.5, "y":4.25 }, + {"matrix":[4,4], "x":4.5, "y":4.25 }, + {"matrix":[4,5], "x":5.5, "y":4.25 }, + {"matrix":[4,6], "x":6.5, "y":4.25 }, + {"matrix":[4,7], "x":7.5, "y":4.25 }, + {"matrix":[10,0], "x":9.25, "y":4.25 }, + {"matrix":[10,1], "x":10.25, "y":4.25 }, + {"matrix":[10,2], "x":11.25, "y":4.25 }, + {"matrix":[10,3], "x":12.25, "y":4.25 }, + {"matrix":[10,4], "x":13.25, "y":4.25 }, + {"matrix":[10,5], "x":14.25, "y":4.25, "w":1.75 }, + {"matrix":[10,7], "x":16.25, "y":4.25 }, + + {"matrix":[5,0], "x":0, "y":5.25 }, + {"matrix":[5,1], "x":1.25, "y":5.25, "w":1.25 }, + {"matrix":[5,2], "x":2.5, "y":5.25, "w":1.25 }, + {"matrix":[5,3], "x":3.75, "y":5.25, "w":1.25 }, + {"matrix":[5,4], "x":5, "y":5.25, "w":1.25 }, + {"matrix":[5,6], "x":6.25, "y":5.25, "w":2.25 }, + {"matrix":[11,1], "x":9.25, "y":5.25, "w":2.75 }, + {"matrix":[11,2], "x":12, "y":5.25 }, + {"matrix":[11,3], "x":13, "y":5.25 }, + {"matrix":[11,4], "x":14, "y":5.25 }, + {"matrix":[11,6], "x":15.25, "y":5.25 }, + {"matrix":[11,7], "x":16.25, "y":5.25 }, + {"matrix":[11,8], "x":17.25, "y":5.25} + ] + } + } +} diff --git a/keyboards/keychron/q11/iso_encoder/iso_encoder.c b/keyboards/keychron/q11/iso_encoder/iso_encoder.c new file mode 100755 index 0000000000..8cff7d5555 --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/iso_encoder.c @@ -0,0 +1,183 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "quantum.h" + +// clang-format off +#ifdef RGB_MATRIX_ENABLE + +const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { +/* Refer to CKLED2001 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, A_2, C_2, B_2}, // ESC + {0, A_3, C_3, B_3}, // F1 + {0, A_4, C_4, B_4}, // F2 + {0, A_5, C_5, B_5}, // F3 + {0, A_6, C_6, B_6}, // F4 + {0, A_7, C_7, B_7}, // F5 + {0, A_8, C_8, B_8}, // F6 + + {0, D_1, F_1, E_1}, // M1 + {0, D_2, F_2, E_2}, // `~ + {0, D_3, F_3, E_3}, // 1! + {0, D_4, F_4, E_4}, // 2@ + {0, D_5, F_5, E_5}, // 3# + {0, D_6, F_6, E_6}, // 4$ + {0, D_7, F_7, E_7}, // 5% + {0, D_8, F_8, E_8}, // 6^ + + {0, G_1, I_1, H_1}, // M2 + {0, G_2, I_2, H_2}, // TAB + {0, G_3, I_3, H_3}, // Q + {0, G_4, I_4, H_4}, // W + {0, G_5, I_5, H_5}, // E + {0, G_6, I_6, H_6}, // R + {0, G_7, I_7, H_7}, // T + + {0, J_1, L_1, K_1}, // M3 + {0, J_2, L_2, K_2}, // CapsJock + {0, J_3, L_3, K_3}, // A + {0, J_4, L_4, K_4}, // S + {0, J_5, L_5, K_5}, // D + {0, J_6, L_6, K_6}, // F + {0, J_7, L_7, K_7}, // G + + {0, J_9, L_9, K_9}, // M4 + {0, J_10, L_10, K_10}, // Shift_L + {0, J_11, L_11, K_11}, // NUBS + {0, J_12, L_12, K_12}, // Z + {0, J_13, L_13, K_13}, // X + {0, J_14, L_14, K_14}, // C + {0, J_15, L_15, K_15}, // V + {0, J_16, L_16, K_16}, // B + + {0, G_9, I_9, H_9}, // M5 + {0, G_10, I_10, H_10}, // Ctrl_L + {0, G_11, I_11, H_11}, // WGn_L + {0, G_12, I_12, H_12}, // Alt_L + {0, G_13, I_13, H_13}, // Fn + {0, G_15, I_15, H_15}, // Space + + {0, A_16, C_16, B_16}, // F7 + {0, A_15, C_15, B_15}, // F8 + {0, A_14, C_14, B_14}, // F9 + {0, A_13, C_13, B_13}, // F11 + {0, A_12, C_12, B_12}, // F11 + {0, A_11, C_11, B_11}, // F12 + {0, A_10, C_10, B_10}, // INS + {0, A_9, C_9, B_9}, // DEL + + {0, D_16, F_16, E_16}, // 7& + {0, D_15, F_15, E_15}, // 8* + {0, D_14, F_14, E_14}, // 9( + {0, D_13, F_13, E_13}, // 1) + {0, D_12, F_12, E_12}, // -_ + {0, D_11, F_11, E_11}, // =+ + {0, D_10, F_10, E_10}, // BackSpace + {0, D_8, F_8, E_8}, // PgUp + + {0, G_16, I_16, H_16}, // Y + {0, G_15, I_15, H_15}, // U + {0, G_14, I_14, H_14}, // G + {0, G_13, I_13, H_13}, // O + {0, G_12, I_12, H_12}, // P + {0, G_11, I_11, H_11}, // [ + {0, G_10, I_10, H_10}, // ] + {0, G_8, I_8, H_8}, // PgDn + + {0, J_16, L_16, K_16}, // H + {0, J_15, L_15, K_15}, // J + {0, J_14, L_14, K_14}, // KKEY_PRESS_HOME + {0, J_13, L_13, K_13}, // J + {0, J_12, L_12, K_12}, // ;: + {0, J_11, L_11, K_11}, // '" + {0, J_9, L_9, K_9}, // NUHS + {0, G_9, I_9, H_9}, // Enter + {0, J_8, L_8, K_8}, // Home + + {0, J_7, L_7, K_7}, // N + {0, J_6, L_6, K_6}, // M + {0, J_5, L_5, K_5}, // ,< + {0, J_4, L_4, K_4}, // .> + {0, J_3, L_3, K_3}, // ?/ + {0, J_2, L_2, K_2}, // Shift_R + {0, J_1, L_1, K_1}, // Up + + {0, G_6, I_6, H_6}, // Space + {0, G_5, I_5, H_5}, // Win_R + {0, G_4, I_4, H_4}, // Fn + {0, G_3, I_3, H_3}, // Ctrl_R + {0, G_2, I_2, H_2}, // Left + {0, G_1, I_1, H_1}, // Down + {0, G_7, I_7, H_7}, // Right +}; + +#define __ NO_LED + +led_config_t g_led_config = { + { + // Key Matrix to LED Index + { __, 0, 1, 2, 3, 4, 5, 6, __ }, + { 7, 8, 9, 10, 11, 12, 13, 14, __ }, + { 15, 16, 17, 18, 19, __, 20, 21, __ }, + { 22, 23, 24, 25, 26, 27, 28, __, __ }, + { 29, 30, 31, 32, 33, 34, 35, 36, __ }, + { 37, 38, 39, 40, 41, __, 42, __, __ }, + + { 43, 44, 45, 46, 47, 48, 49, 50, __ }, + { 51, 52, 53, 54, 55, 56, 57, __, 58 }, + { 59, 60, 61, 62, 63, 64, 65, 74, 66 }, + { 67, 68, 69, 70, 71, 72, __, 73, 75 }, + { 76, 77, 78, 79, 80, 81, __, 82, __ }, + { __, 83, 84, 85, 86, __, 87, 88, 89 }, + }, + { + // LED Index to Physical Position + {17,0}, {31,0}, {45,0}, {59,0}, {72,0}, {86,0}, {100,0}, + {0,15}, {17,15}, {31,15}, {45,15}, {59,15}, {72,15}, {86,15}, {100,15}, + {0,27}, {21,27}, {38,27}, {52,27}, {66,27}, {79,27}, {93,27}, + {0,40}, {22,40}, {41,40}, {55,40}, {69,40}, {83,40}, {97,40}, + {0,52}, {19,52}, {34,52}, {48,52}, {62,52}, {76,52}, {90,52}, {103,52}, + {0,64}, {19,64}, {36,64}, {53,64}, {71,64}, {95,64}, + {110,0}, {124,0}, {138,0}, {152,0}, {165,0}, {179,0}, {193,0}, {207,0}, + {110,15}, {124,15}, {138,15}, {152,15}, {165,15}, {179,15}, {200,15}, {224,15}, + {103,27}, {117,27}, {131,27}, {145,27}, {158,27}, {172,27}, {186,27}, {224,27}, + {107,40}, {121,40}, {134,40}, {148,40}, {162,40}, {176,40}, {190,40}, {208,36}, {224,40}, + {114,52}, {127,52}, {141,52}, {155,52}, {169,52}, {188,52}, {210,52}, + {126,64}, {152,64}, {166,64}, {180,64}, {196,64}, {210,64}, {224,64}, + }, + { + // RGB LED Index to Flag + 1, 1, 1, 1, 1, 1, 1, + 4, 1, 4, 4, 4, 4, 4, 4, + 4, 1, 4, 4, 4, 4, 4, + 4, 8, 4, 4, 4, 4, 4, + 4, 1, 4, 4, 4, 4, 4, 4, + 4, 1, 1, 1, 4, 4, + 1, 1, 1, 1, 1, 1, 1, 1, + 4, 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 4, 4, 1, + 4, 4, 4, 4, 4, 4, 4, 1, 1, + 4, 4, 4, 4, 4, 1, 1, + 4, 1, 4, 1, 1, 1, 1, + } +}; + +#endif diff --git a/keyboards/keychron/q11/iso_encoder/keymaps/default/keymap.c b/keyboards/keychron/q11/iso_encoder/keymaps/default/keymap.c new file mode 100755 index 0000000000..bf526a1e87 --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/keymaps/default/keymap.c @@ -0,0 +1,71 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +// clang-format off + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_iso_92( + KC_MUTE, KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, KC_DEL, KC_MUTE, + _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + _______, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, + _______, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, + _______, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + _______, KC_LCTL, KC_LOPT, KC_LCMD, MO(MAC_FN), KC_SPC, KC_SPC, KC_RCMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT_iso_92( + RGB_TOG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [WIN_BASE] = LAYOUT_iso_92( + KC_MUTE, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_MUTE, + _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + _______, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, + _______, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, + _______, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + _______, KC_LCTL, KC_LWIN, KC_LALT, MO(WIN_FN), KC_SPC, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_FN] = LAYOUT_iso_92( + RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/q2/jis_encoder/keymaps/default/rules.mk b/keyboards/keychron/q11/iso_encoder/keymaps/default/rules.mk old mode 100644 new mode 100755 similarity index 100% rename from keyboards/keychron/q2/jis_encoder/keymaps/default/rules.mk rename to keyboards/keychron/q11/iso_encoder/keymaps/default/rules.mk diff --git a/keyboards/keychron/q11/iso_encoder/keymaps/keychron/keymap.c b/keyboards/keychron/q11/iso_encoder/keymaps/keychron/keymap.c new file mode 100755 index 0000000000..e6c1c04fa2 --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/keymaps/keychron/keymap.c @@ -0,0 +1,90 @@ +/* Copyright 2022 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "keychron_common.h" +#include "keychron_ft_common.h" + +// clang-format off + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_iso_92( + KC_MUTE, KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, KC_DEL, KC_MUTE, + MC_1, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + MC_2, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, + MC_3, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, + MC_4, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + MC_5, KC_LCTL, KC_LOPT, KC_LCMD, MO(MAC_FN), KC_SPC, KC_SPC, KC_RCMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT_iso_92( + RGB_TOG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [WIN_BASE] = LAYOUT_iso_92( + KC_MUTE, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_MUTE, + MC_1, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + MC_2, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, + MC_3, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, + MC_4, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + MC_5, KC_LCTL, KC_LWIN, KC_LALT, MO(WIN_FN), KC_SPC, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_FN] = LAYOUT_iso_92( + RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI)} +}; +#endif // ENCODER_MAP_ENABLE + +// clang-format on + +void housekeeping_task_user(void) { + housekeeping_task_keychron(); + housekeeping_task_keychron_ft(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keychron(keycode, record)) { + return false; + } + + if (!process_record_keychron_ft(keycode, record)) { + return false; + } + + return true; +} diff --git a/keyboards/keychron/q11/iso_encoder/keymaps/keychron/rules.mk b/keyboards/keychron/q11/iso_encoder/keymaps/keychron/rules.mk new file mode 100755 index 0000000000..e420400d17 --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/keymaps/keychron/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes + +VPATH += keyboards/keychron/common +SRC += keychron_common.c keychron_ft_common.c factory.c diff --git a/keyboards/keychron/q11/iso_encoder/keymaps/via/keymap.c b/keyboards/keychron/q11/iso_encoder/keymaps/via/keymap.c new file mode 100755 index 0000000000..e1f579f0fa --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/keymaps/via/keymap.c @@ -0,0 +1,72 @@ +/* Copyright 2022 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +// clang-format off + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_iso_92( + KC_MUTE, KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, KC_DEL, KC_MUTE, + MC_1, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + MC_2, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, + MC_3, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, + MC_4, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + MC_5, KC_LCTL, KC_LOPT, KC_LCMD, MO(MAC_FN), KC_SPC, KC_SPC, KC_RCMD, MO(MAC_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT_iso_92( + RGB_TOG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [WIN_BASE] = LAYOUT_iso_92( + KC_MUTE, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_MUTE, + MC_1, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + MC_2, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_PGDN, + MC_3, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_HOME, + MC_4, KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + MC_5, KC_LCTL, KC_LWIN, KC_LALT, MO(WIN_FN), KC_SPC, KC_SPC, KC_RALT, MO(WIN_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_FN] = LAYOUT_iso_92( + RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [MAC_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) }, + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [WIN_FN] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) } +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/q11/iso_encoder/keymaps/via/rules.mk b/keyboards/keychron/q11/iso_encoder/keymaps/via/rules.mk new file mode 100755 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/q11/iso_encoder/rules.mk b/keyboards/keychron/q11/iso_encoder/rules.mk new file mode 100755 index 0000000000..bc11b0af05 --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/rules.mk @@ -0,0 +1,7 @@ +# Build Options +EEPROM_DRIVER = wear_leveling +WEAR_LEVELING_DRIVER = embedded_flash +SERIAL_DRIVER = usart + +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE diff --git a/keyboards/keychron/q11/q11.c b/keyboards/keychron/q11/q11.c index b97d6e4b6e..abb5e64cc6 100755 --- a/keyboards/keychron/q11/q11.c +++ b/keyboards/keychron/q11/q11.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" // Mask out handedness diode to prevent it // from keeping the keyboard awake @@ -25,9 +24,9 @@ const matrix_row_t matrix_mask[] = { 0b011111111, 0b011111111, - 0b011111111, + 0b011011111, 0b001111111, - 0b011111101, + 0b011111111, 0b001011111, 0b111111111, 0b101111111, @@ -87,11 +86,24 @@ static int16_t analogReadPin_my(pin_t pin) { return *sampleBuffer; } -void keyboard_post_init_kb(void) { #if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - keyboard_post_init_keychron(); +static void encoder_pad_cb(void *param) { + encoder_inerrupt_read((uint32_t)param & 0XFF); +} #endif +void keyboard_post_init_kb(void) { +#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) + + pin_t encoders_pad_a[NUM_ENCODERS] = ENCODERS_PAD_A; + pin_t encoders_pad_b[NUM_ENCODERS] = ENCODERS_PAD_B; + for (uint32_t i = 0; i < NUM_ENCODERS; i++) { + palEnableLineEvent(encoders_pad_a[i], PAL_EVENT_MODE_BOTH_EDGES); + palEnableLineEvent(encoders_pad_b[i], PAL_EVENT_MODE_BOTH_EDGES); + palSetLineCallback(encoders_pad_a[i], encoder_pad_cb, (void *)i); + palSetLineCallback(encoders_pad_b[i], encoder_pad_cb, (void *)i); + } +#endif if (is_keyboard_left()) { setPinOutput(A0); writePinHigh(A0); diff --git a/keyboards/keychron/q11/readme.md b/keyboards/keychron/q11/readme.md index 279fe6206b..6d6744fa8d 100644 --- a/keyboards/keychron/q11/readme.md +++ b/keyboards/keychron/q11/readme.md @@ -11,10 +11,12 @@ A customizable 75% split keyboard. Make example for this keyboard (after setting up your build environment): make keychron/q11/ansi_encoder:default + make keychron/q11/iso_encoder:default Flashing example for this keyboard: make keychron/q11/ansi_encoder:default:flash + make keychron/q11/iso_encoder:default:flash **Reset Key**: Hold down the key located at *K01*, which programmed as *Esc* while plugging in the keyboard. diff --git a/keyboards/keychron/q12/ansi_encoder/rules.mk b/keyboards/keychron/q12/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q12/ansi_encoder/rules.mk +++ b/keyboards/keychron/q12/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q12/config.h b/keyboards/keychron/q12/config.h index e1073a8173..a2e0e6f15e 100644 --- a/keyboards/keychron/q12/config.h +++ b/keyboards/keychron/q12/config.h @@ -33,10 +33,7 @@ { 0xAD, 0xAD, 0x55, 0xAD, 0xAD, 0x55, 0xAD, 0xAD, 0x55, 0xAD, 0xAD, 0x55 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/q12/iso_encoder/rules.mk b/keyboards/keychron/q12/iso_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q12/iso_encoder/rules.mk +++ b/keyboards/keychron/q12/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q12/q12.c b/keyboards/keychron/q12/q12.c index 2f7387f863..c13cd641e9 100644 --- a/keyboards/keychron/q12/q12.c +++ b/keyboards/keychron/q12/q12.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" // clang-format off const matrix_row_t matrix_mask[] = { @@ -38,14 +37,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q2/ansi/rules.mk b/keyboards/keychron/q2/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q2/ansi/rules.mk +++ b/keyboards/keychron/q2/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q2/ansi_encoder/info.json b/keyboards/keychron/q2/ansi_encoder/info.json index 2ad1cff501..66f83d1ef9 100644 --- a/keyboards/keychron/q2/ansi_encoder/info.json +++ b/keyboards/keychron/q2/ansi_encoder/info.json @@ -29,7 +29,7 @@ "diode_direction": "ROW2COL", "encoder": { "rotary": [ - {"pin_a": "A10", "pin_b": "B8"} + {"pin_a": "A10", "pin_b": "B5"} ] }, "processor": "STM32L432", diff --git a/keyboards/keychron/q2/ansi_encoder/rules.mk b/keyboards/keychron/q2/ansi_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q2/ansi_encoder/rules.mk +++ b/keyboards/keychron/q2/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q2/config.h b/keyboards/keychron/q2/config.h index c0a0c02e1e..8e368df7a9 100644 --- a/keyboards/keychron/q2/config.h +++ b/keyboards/keychron/q2/config.h @@ -41,10 +41,7 @@ #define MATRIX_MASKED /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 4, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 4, 4 } } #define SCAN_COUNT_MAX 100 /* Turn off effects when suspended */ diff --git a/keyboards/keychron/q2/iso/rules.mk b/keyboards/keychron/q2/iso/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q2/iso/rules.mk +++ b/keyboards/keychron/q2/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q2/iso_encoder/info.json b/keyboards/keychron/q2/iso_encoder/info.json index be163da1e3..9b4b8dc5ed 100644 --- a/keyboards/keychron/q2/iso_encoder/info.json +++ b/keyboards/keychron/q2/iso_encoder/info.json @@ -29,7 +29,7 @@ "diode_direction": "ROW2COL", "encoder": { "rotary": [ - {"pin_a": "A10", "pin_b": "B8"} + {"pin_a": "A10", "pin_b": "B5"} ] }, "processor": "STM32L432", diff --git a/keyboards/keychron/q2/iso_encoder/rules.mk b/keyboards/keychron/q2/iso_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q2/iso_encoder/rules.mk +++ b/keyboards/keychron/q2/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q2/jis/rules.mk b/keyboards/keychron/q2/jis/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q2/jis/rules.mk +++ b/keyboards/keychron/q2/jis/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q2/jis_encoder/info.json b/keyboards/keychron/q2/jis_encoder/info.json index 8b08c7f79f..4d7168ac5e 100644 --- a/keyboards/keychron/q2/jis_encoder/info.json +++ b/keyboards/keychron/q2/jis_encoder/info.json @@ -14,6 +14,7 @@ "console": false, "dip_switch": true, "encoder": true, + "encoder_map": true, "extrakey": true, "mousekey": true, "nkro": true, @@ -29,7 +30,7 @@ "diode_direction": "ROW2COL", "encoder": { "rotary": [ - {"pin_a": "A10", "pin_b": "B8"} + {"pin_a": "A10", "pin_b": "B5"} ] }, "processor": "STM32L432", diff --git a/keyboards/keychron/q2/jis_encoder/keymaps/keychron/keymap.c b/keyboards/keychron/q2/jis_encoder/keymaps/keychron/keymap.c index 92b8e22895..f0ac231651 100644 --- a/keyboards/keychron/q2/jis_encoder/keymaps/keychron/keymap.c +++ b/keyboards/keychron/q2/jis_encoder/keymaps/keychron/keymap.c @@ -65,12 +65,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) }; -// clang-format on - #if defined(ENCODER_MAP_ENABLE) -const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {[MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, [MAC_FN1] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, [WIN_FN1] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, [_FN2] = {ENCODER_CCW_CW(_______, _______)}}; +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN1] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_FN1] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [_FN2] = {ENCODER_CCW_CW(_______, _______)} +}; #endif // ENCODER_MAP_ENABLE +// clang-format on + void housekeeping_task_user(void) { housekeeping_task_keychron(); housekeeping_task_keychron_ft(); diff --git a/keyboards/keychron/q2/jis_encoder/keymaps/keychron/rules.mk b/keyboards/keychron/q2/jis_encoder/keymaps/keychron/rules.mk index 88c27a468a..dac903490f 100644 --- a/keyboards/keychron/q2/jis_encoder/keymaps/keychron/rules.mk +++ b/keyboards/keychron/q2/jis_encoder/keymaps/keychron/rules.mk @@ -1,5 +1,4 @@ VIA_ENABLE = yes -ENCODER_MAP_ENABLE = yes VPATH += keyboards/keychron/common SRC += keychron_common.c keychron_ft_common.c diff --git a/keyboards/keychron/q2/jis_encoder/keymaps/via/rules.mk b/keyboards/keychron/q2/jis_encoder/keymaps/via/rules.mk index f1adcab005..1e5b99807c 100644 --- a/keyboards/keychron/q2/jis_encoder/keymaps/via/rules.mk +++ b/keyboards/keychron/q2/jis_encoder/keymaps/via/rules.mk @@ -1,2 +1 @@ VIA_ENABLE = yes -ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/q2/jis_encoder/rules.mk b/keyboards/keychron/q2/jis_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q2/jis_encoder/rules.mk +++ b/keyboards/keychron/q2/jis_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q2/q2.c b/keyboards/keychron/q2/q2.c index f0eb464801..2d33298a45 100644 --- a/keyboards/keychron/q2/q2.c +++ b/keyboards/keychron/q2/q2.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b111111111111111, @@ -34,14 +33,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q3/ansi/rules.mk b/keyboards/keychron/q3/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q3/ansi/rules.mk +++ b/keyboards/keychron/q3/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q3/ansi_encoder/rules.mk b/keyboards/keychron/q3/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q3/ansi_encoder/rules.mk +++ b/keyboards/keychron/q3/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q3/config.h b/keyboards/keychron/q3/config.h index 3e4c13c15a..ab452c1a12 100644 --- a/keyboards/keychron/q3/config.h +++ b/keyboards/keychron/q3/config.h @@ -38,10 +38,7 @@ { 0x98, 0x98, 0x44, 0x98, 0x98, 0x44, 0x98, 0x98, 0x44, 0x98, 0x98, 0x44 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/q3/iso/rules.mk b/keyboards/keychron/q3/iso/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q3/iso/rules.mk +++ b/keyboards/keychron/q3/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q3/iso_encoder/rules.mk b/keyboards/keychron/q3/iso_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q3/iso_encoder/rules.mk +++ b/keyboards/keychron/q3/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q3/jis/rules.mk b/keyboards/keychron/q3/jis/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q3/jis/rules.mk +++ b/keyboards/keychron/q3/jis/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q3/jis_encoder/rules.mk b/keyboards/keychron/q3/jis_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q3/jis_encoder/rules.mk +++ b/keyboards/keychron/q3/jis_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q3/q3.c b/keyboards/keychron/q3/q3.c index 6bb9b4fee2..8acb24641f 100644 --- a/keyboards/keychron/q3/q3.c +++ b/keyboards/keychron/q3/q3.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" // clang-format off @@ -41,14 +40,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif // DIP_SWITCH_ENABLE - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q4/ansi_v1/rules.mk b/keyboards/keychron/q4/ansi_v1/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q4/ansi_v1/rules.mk +++ b/keyboards/keychron/q4/ansi_v1/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q4/ansi_v2/rules.mk b/keyboards/keychron/q4/ansi_v2/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q4/ansi_v2/rules.mk +++ b/keyboards/keychron/q4/ansi_v2/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q4/config.h b/keyboards/keychron/q4/config.h index ca32b604f4..f08eef28ee 100644 --- a/keyboards/keychron/q4/config.h +++ b/keyboards/keychron/q4/config.h @@ -17,10 +17,7 @@ #pragma once /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 4, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 4, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/q4/iso/rules.mk b/keyboards/keychron/q4/iso/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q4/iso/rules.mk +++ b/keyboards/keychron/q4/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q5/ansi/rules.mk b/keyboards/keychron/q5/ansi/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q5/ansi/rules.mk +++ b/keyboards/keychron/q5/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q5/ansi_encoder/rules.mk b/keyboards/keychron/q5/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q5/ansi_encoder/rules.mk +++ b/keyboards/keychron/q5/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q5/config.h b/keyboards/keychron/q5/config.h index 3599d897a1..e3b8d03165 100644 --- a/keyboards/keychron/q5/config.h +++ b/keyboards/keychron/q5/config.h @@ -33,10 +33,7 @@ { 0xB6, 0xB6, 0x56, 0xB6, 0xB6, 0x56, 0xB6, 0xB6, 0x56, 0xB6, 0xB6, 0x56 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/q5/iso/rules.mk b/keyboards/keychron/q5/iso/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q5/iso/rules.mk +++ b/keyboards/keychron/q5/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q5/iso_encoder/rules.mk b/keyboards/keychron/q5/iso_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q5/iso_encoder/rules.mk +++ b/keyboards/keychron/q5/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q5/q5.c b/keyboards/keychron/q5/q5.c index 9cc795e0dc..883f7c573b 100644 --- a/keyboards/keychron/q5/q5.c +++ b/keyboards/keychron/q5/q5.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b111111111111111111, @@ -37,14 +36,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q6/ansi/rules.mk b/keyboards/keychron/q6/ansi/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q6/ansi/rules.mk +++ b/keyboards/keychron/q6/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q6/ansi_encoder/rules.mk b/keyboards/keychron/q6/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q6/ansi_encoder/rules.mk +++ b/keyboards/keychron/q6/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q6/config.h b/keyboards/keychron/q6/config.h index b1584e700b..25aee4e452 100644 --- a/keyboards/keychron/q6/config.h +++ b/keyboards/keychron/q6/config.h @@ -33,10 +33,7 @@ { 0xA4, 0xA4, 0x52, 0xA4, 0xA4, 0x52, 0xA4, 0xA4, 0x52, 0xA4, 0xA4, 0x52 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/q6/iso/rules.mk b/keyboards/keychron/q6/iso/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q6/iso/rules.mk +++ b/keyboards/keychron/q6/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q6/iso_encoder/keymaps/default/keymap.c b/keyboards/keychron/q6/iso_encoder/keymaps/default/keymap.c index bb2377dadc..790538586e 100644 --- a/keyboards/keychron/q6/iso_encoder/keymaps/default/keymap.c +++ b/keyboards/keychron/q6/iso_encoder/keymaps/default/keymap.c @@ -30,7 +30,7 @@ enum layers{ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_iso_110( - KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_NO, KC_NO, RGB_MOD, KC_F13, KC_F14, KC_F15, KC_F16, + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_NO, KC_NO, RGB_MOD, KC_F13, KC_F14, KC_F15, KC_F16, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, diff --git a/keyboards/keychron/q6/iso_encoder/keymaps/via/keymap.c b/keyboards/keychron/q6/iso_encoder/keymaps/via/keymap.c index bb2377dadc..790538586e 100644 --- a/keyboards/keychron/q6/iso_encoder/keymaps/via/keymap.c +++ b/keyboards/keychron/q6/iso_encoder/keymaps/via/keymap.c @@ -30,7 +30,7 @@ enum layers{ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_iso_110( - KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_NO, KC_NO, RGB_MOD, KC_F13, KC_F14, KC_F15, KC_F16, + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_NO, KC_NO, RGB_MOD, KC_F13, KC_F14, KC_F15, KC_F16, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, diff --git a/keyboards/keychron/q6/iso_encoder/rules.mk b/keyboards/keychron/q6/iso_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q6/iso_encoder/rules.mk +++ b/keyboards/keychron/q6/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q6/q6.c b/keyboards/keychron/q6/q6.c index f4ff2a2e61..9a02067c7d 100644 --- a/keyboards/keychron/q6/q6.c +++ b/keyboards/keychron/q6/q6.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b11111111111111111111, @@ -37,14 +36,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q60/ansi/rules.mk b/keyboards/keychron/q60/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q60/ansi/rules.mk +++ b/keyboards/keychron/q60/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q60/config.h b/keyboards/keychron/q60/config.h index e9ddc10486..5ccd85258a 100644 --- a/keyboards/keychron/q60/config.h +++ b/keyboards/keychron/q60/config.h @@ -32,10 +32,7 @@ { 0xD8, 0xD8, 0x60, 0xD8, 0xD8, 0x60, 0xD8, 0xD8, 0x60, 0xD8, 0xD8, 0x60 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 4, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 4, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/q65/ansi_encoder/keymaps/default/keymap.c b/keyboards/keychron/q65/ansi_encoder/keymaps/default/keymap.c index 45d75c48ce..75490d2dd3 100644 --- a/keyboards/keychron/q65/ansi_encoder/keymaps/default/keymap.c +++ b/keyboards/keychron/q65/ansi_encoder/keymaps/default/keymap.c @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN1] = LAYOUT_ansi_73( - RGB_TOG, KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, + RGB_TOG, KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/keychron/q65/ansi_encoder/rules.mk b/keyboards/keychron/q65/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/q65/ansi_encoder/rules.mk +++ b/keyboards/keychron/q65/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q65/config.h b/keyboards/keychron/q65/config.h index eac17e6744..7fddb901dd 100644 --- a/keyboards/keychron/q65/config.h +++ b/keyboards/keychron/q65/config.h @@ -37,10 +37,7 @@ #define MATRIX_MASKED /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 4, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 4, 4 } } #define SCAN_COUNT_MAX 100 /* Turn off effects when suspended */ diff --git a/keyboards/keychron/q65/q65.c b/keyboards/keychron/q65/q65.c index 2c2fe5ff4a..0cb6a646a5 100644 --- a/keyboards/keychron/q65/q65.c +++ b/keyboards/keychron/q65/q65.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b1111111111111111, @@ -34,14 +33,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q7/ansi/rules.mk b/keyboards/keychron/q7/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q7/ansi/rules.mk +++ b/keyboards/keychron/q7/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q7/config.h b/keyboards/keychron/q7/config.h index 2162c19568..ec8060f25f 100644 --- a/keyboards/keychron/q7/config.h +++ b/keyboards/keychron/q7/config.h @@ -35,10 +35,7 @@ { 0xF8, 0xF8, 0x80, 0xF8, 0xF8, 0x80, 0xF8, 0xF8, 0x80, 0xF8, 0xF8, 0x80 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 4, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 4, 4 } } /* Disable DIP switch in matrix data */ #define MATRIX_MASKED diff --git a/keyboards/keychron/q7/iso/keymaps/default/keymap.c b/keyboards/keychron/q7/iso/keymaps/default/keymap.c index 5a649f062c..6b57e8175b 100644 --- a/keyboards/keychron/q7/iso/keymaps/default/keymap.c +++ b/keyboards/keychron/q7/iso/keymaps/default/keymap.c @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(WIN_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN1] = LAYOUT_iso_73( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG, + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/keychron/q7/iso/keymaps/via/keymap.c b/keyboards/keychron/q7/iso/keymaps/via/keymap.c index 5a649f062c..6b57e8175b 100644 --- a/keyboards/keychron/q7/iso/keymaps/via/keymap.c +++ b/keyboards/keychron/q7/iso/keymaps/via/keymap.c @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(WIN_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN1] = LAYOUT_iso_73( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG, + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/keychron/q7/iso/rules.mk b/keyboards/keychron/q7/iso/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q7/iso/rules.mk +++ b/keyboards/keychron/q7/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q8/ansi/rules.mk b/keyboards/keychron/q8/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q8/ansi/rules.mk +++ b/keyboards/keychron/q8/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q8/ansi_encoder/rules.mk b/keyboards/keychron/q8/ansi_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q8/ansi_encoder/rules.mk +++ b/keyboards/keychron/q8/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q8/config.h b/keyboards/keychron/q8/config.h index 1978ebc1fc..5e506a004e 100644 --- a/keyboards/keychron/q8/config.h +++ b/keyboards/keychron/q8/config.h @@ -38,10 +38,7 @@ { 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 4, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 4, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/q8/iso/rules.mk b/keyboards/keychron/q8/iso/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q8/iso/rules.mk +++ b/keyboards/keychron/q8/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q8/iso_encoder/rules.mk b/keyboards/keychron/q8/iso_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q8/iso_encoder/rules.mk +++ b/keyboards/keychron/q8/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q8/q8.c b/keyboards/keychron/q8/q8.c index bce9389336..e903b1f70a 100644 --- a/keyboards/keychron/q8/q8.c +++ b/keyboards/keychron/q8/q8.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b111111111111111, @@ -34,14 +33,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q9/ansi/keymaps/default/keymap.c b/keyboards/keychron/q9/ansi/keymaps/default/keymap.c index 90eb98c51b..195f4cdb85 100644 --- a/keyboards/keychron/q9/ansi/keymaps/default/keymap.c +++ b/keyboards/keychron/q9/ansi/keymaps/default/keymap.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN1] = LAYOUT_ansi_52( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), diff --git a/keyboards/keychron/q9/ansi/keymaps/via/keymap.c b/keyboards/keychron/q9/ansi/keymaps/via/keymap.c index 90eb98c51b..195f4cdb85 100644 --- a/keyboards/keychron/q9/ansi/keymaps/via/keymap.c +++ b/keyboards/keychron/q9/ansi/keymaps/via/keymap.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN1] = LAYOUT_ansi_52( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), diff --git a/keyboards/keychron/q9/ansi/rules.mk b/keyboards/keychron/q9/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q9/ansi/rules.mk +++ b/keyboards/keychron/q9/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q9/ansi_encoder/info.json b/keyboards/keychron/q9/ansi_encoder/info.json index 3f79b80c44..a11eb3b913 100644 --- a/keyboards/keychron/q9/ansi_encoder/info.json +++ b/keyboards/keychron/q9/ansi_encoder/info.json @@ -13,7 +13,7 @@ "command": false, "console": false, "dip_switch": true, - "encoder": false, + "encoder": true, "extrakey": true, "mousekey": true, "nkro": true, diff --git a/keyboards/keychron/q9/ansi_encoder/keymaps/default/keymap.c b/keyboards/keychron/q9/ansi_encoder/keymaps/default/keymap.c index 3d459862bd..d20ed4cea3 100644 --- a/keyboards/keychron/q9/ansi_encoder/keymaps/default/keymap.c +++ b/keyboards/keychron/q9/ansi_encoder/keymaps/default/keymap.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN1] = LAYOUT_ansi_52( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), diff --git a/keyboards/keychron/q9/ansi_encoder/keymaps/via/keymap.c b/keyboards/keychron/q9/ansi_encoder/keymaps/via/keymap.c index 3d459862bd..d20ed4cea3 100644 --- a/keyboards/keychron/q9/ansi_encoder/keymaps/via/keymap.c +++ b/keyboards/keychron/q9/ansi_encoder/keymaps/via/keymap.c @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(WIN_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), [MAC_FN1] = LAYOUT_ansi_52( - KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), diff --git a/keyboards/keychron/q9/ansi_encoder/rules.mk b/keyboards/keychron/q9/ansi_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q9/ansi_encoder/rules.mk +++ b/keyboards/keychron/q9/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q9/config.h b/keyboards/keychron/q9/config.h index a601af77b8..1902ef5883 100644 --- a/keyboards/keychron/q9/config.h +++ b/keyboards/keychron/q9/config.h @@ -20,10 +20,7 @@ #define MATRIX_MASKED /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 3, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 3, 4 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/q9/iso/rules.mk b/keyboards/keychron/q9/iso/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q9/iso/rules.mk +++ b/keyboards/keychron/q9/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q9/iso_encoder/rules.mk b/keyboards/keychron/q9/iso_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/q9/iso_encoder/rules.mk +++ b/keyboards/keychron/q9/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/q9/q9.c b/keyboards/keychron/q9/q9.c index b23f507d3b..a1ebd1ddb2 100644 --- a/keyboards/keychron/q9/q9.c +++ b/keyboards/keychron/q9/q9.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b111111111111111, @@ -33,14 +32,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/q9/readme.md b/keyboards/keychron/q9/readme.md index 3e288088be..754634fb63 100644 --- a/keyboards/keychron/q9/readme.md +++ b/keyboards/keychron/q9/readme.md @@ -6,7 +6,7 @@ A customizable 40% keyboard. * Keyboard Maintainer: [Keychron](https://github.com/keychron) * Hardware Supported: Keychron Q9 -* Hardware Availability: [Keychron](https://www.keychron.com) +* Hardware Availability: [Keychron Q9 QMK Custom Mechanical Keyboard](https://www.keychron.com/products/keychron-q9-qmk-custom-mechanical-keyboard) Make example for this keyboard (after setting up your build environment): @@ -18,7 +18,7 @@ Make example for this keyboard (after setting up your build environment): Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) make keychron/q9/ansi:default:flash - make keychron/q9/ansi:default:flash + make keychron/q9/ansi_encoder:default:flash make keychron/q9/iso:default:flash make keychron/q9/iso_encoder:default:flash diff --git a/keyboards/keychron/q9_plus/ansi_encoder/ansi_encoder.c b/keyboards/keychron/q9_plus/ansi_encoder/ansi_encoder.c new file mode 100644 index 0000000000..7ff63fd889 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/ansi_encoder.c @@ -0,0 +1,112 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "quantum.h" + +#ifdef RGB_MATRIX_ENABLE +// clang-format off +const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { +/* Refer to CKLED2001 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, L_16, J_16, K_16}, + {0, L_15, J_15, K_15}, + {0, L_14, J_14, K_14}, + {0, L_13, J_13, K_13}, + {0, L_12, J_12, K_12}, + {0, L_11, J_11, K_11}, + {0, L_10, J_10, K_10}, + {0, L_9, J_9, K_9}, + {0, L_8, J_8, K_8}, + {0, L_7, J_7, K_7}, + {0, L_6, J_6, K_6}, + {0, L_5, J_5, K_5}, + {0, L_4, J_4, K_4}, + {0, L_3, J_3, K_3}, + // {0, L_2, J_2, K_2}, + + {0, C_16, A_16, B_16}, + {0, C_15, A_15, B_15}, + {0, C_14, A_14, B_14}, + {0, C_13, A_13, B_13}, + {0, C_12, A_12, B_12}, + {0, C_11, A_11, B_11}, + {0, C_10, A_10, B_10}, + {0, C_9, A_9, B_9}, + {0, C_8, A_8, B_8}, + {0, C_7, A_7, B_7}, + {0, C_6, A_6, B_6}, + {0, C_5, A_5, B_5}, + {0, C_3, A_3, B_3}, + {0, C_2, A_2, B_2}, + + {0, I_16, G_16, H_16}, + {0, I_14, G_14, H_14}, + {0, I_13, G_13, H_13}, + {0, I_12, G_12, H_12}, + {0, I_11, G_11, H_11}, + {0, I_10, G_10, H_10}, + {0, I_9, G_9, H_9}, + {0, I_8, G_8, H_8}, + {0, I_7, G_7, H_7}, + {0, I_6, G_6, H_6}, + {0, I_5, G_5, H_5}, + {0, I_3, G_3, H_3}, + {0, I_2, G_2, H_2}, + + {0, F_16, D_16, E_16}, + {0, F_15, D_15, E_15}, + {0, F_14, D_14, E_14}, + {0, F_13, D_13, E_13}, + {0, F_10, D_10, E_10}, + {0, F_7, D_7, E_7}, + {0, F_6, D_6, E_6}, + {0, F_5, D_5, E_5}, + {0, F_4, D_4, E_4}, + {0, F_3, D_3, E_3}, + {0, F_2, D_2, E_2}, + {0, C_4, A_4, B_4} +}; + +#define __ NO_LED + +led_config_t g_led_config = { + { + // Key Matrix to LED Index + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, __ }, + { 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 52, 26, 27 }, + { 28, __, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, __, 39, 40 }, + { 41, 42, 43, 44, __, __, 45, __, __, 46, 47, 48, 49, 50, 51 }, + }, + { + // LED Index to Physical Position + {2,0}, {20,0}, {35,0}, {50,0}, {65,0}, {80,0}, {94,0}, {109,0}, {124,0}, {139,0}, {154,0}, {168,0}, {183,0}, {202,0}, + {4,21}, {24,21}, {39,21}, {54,21}, {68,21}, {83,21}, {98,21}, {113,21}, {128,21}, {142,21}, {157,21}, {172,21}, {196,21}, {224,27}, + {7,43}, {31,43}, {46,43}, {61,43}, {76,43}, {91,43}, {105,43}, {120,43}, {135,43}, {150,43}, {165,43}, {185,43}, {205,43}, + {0,64}, {18,64}, {37,64}, {55,64}, {81,64}, {118,64}, {146,64}, {161,64}, {176,64}, {190,64}, {205,64}, {220,64}, + }, + { + // RGB LED Index to Flag + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, + 1, 1, 1, 4, 4, 4, 1, 4, 4, 1, 1, 1, + } +}; +#endif diff --git a/keyboards/keychron/q9_plus/ansi_encoder/config.h b/keyboards/keychron/q9_plus/ansi_encoder/config.h new file mode 100644 index 0000000000..e88f3d8252 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/config.h @@ -0,0 +1,27 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* RGB Matrix Configuration */ +#define DRIVER_1_LED_TOTAL 54 +#define RGB_MATRIX_LED_COUNT DRIVER_1_LED_TOTAL + +/* Encoder Configuration */ +#define ENCODER_DEFAULT_POS 0x3 + +/* Enable caps-lock LED */ +#define CAPS_LOCK_LED_INDEX 14 diff --git a/keyboards/keychron/q9_plus/ansi_encoder/info.json b/keyboards/keychron/q9_plus/ansi_encoder/info.json new file mode 100644 index 0000000000..21bc9be2f2 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/info.json @@ -0,0 +1,100 @@ +{ + "keyboard_name": "Keychron Q9 Plus", + "manufacturer": "Keychron", + "url": "https://github.com/Keychron", + "maintainer": "lalalademaxiya1", + "usb": { + "vid": "0x3434", + "pid": "0x0194", + "device_version": "1.0.0" + }, + "features": { + "bootmagic": true, + "command": false, + "console": false, + "dip_switch": true, + "encoder": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "rgb_matrix": true + }, + "rgb_matrix": { + "driver": "CKLED2001" + }, + "matrix_pins": { + "cols": ["A10", "A9", "A8", "B1", "B0", "A7", "A6", "A5", "A4", "A3", "A2", "A1", "A0", "C15", "C14"], + "rows": ["B3", "A15", "A14", "A13"] + }, + "diode_direction": "ROW2COL", + "encoder": { + "rotary": [ + {"pin_a": "B4", "pin_b": "B5"} + ] + }, + "processor": "STM32L432", + "bootloader": "stm32-dfu", + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix":[0,0], "x":0, "y":0, "w":1.5}, + {"matrix":[0,1], "x":1.5, "y":0}, + {"matrix":[0,2], "x":2.5, "y":0}, + {"matrix":[0,3], "x":3.5, "y":0}, + {"matrix":[0,4], "x":4.5, "y":0}, + {"matrix":[0,5], "x":5.5, "y":0}, + {"matrix":[0,6], "x":6.5, "y":0}, + {"matrix":[0,7], "x":7.5, "y":0}, + {"matrix":[0,8], "x":8.5, "y":0}, + {"matrix":[0,9], "x":9.5, "y":0}, + {"matrix":[0,10], "x":10.5, "y":0}, + {"matrix":[0,11], "x":11.5, "y":0}, + {"matrix":[0,12], "x":12.5, "y":0}, + {"matrix":[0,13], "x":13.5, "y":0, "w":1.5}, + {"matrix":[0,14], "x":15.25, "y":0}, + + {"matrix":[1,0], "x":0, "y":1, "w":1.75}, + {"matrix":[1,1], "x":1.75, "y":1}, + {"matrix":[1,2], "x":2.75, "y":1}, + {"matrix":[1,3], "x":3.75, "y":1}, + {"matrix":[1,4], "x":4.75, "y":1}, + {"matrix":[1,5], "x":5.75, "y":1}, + {"matrix":[1,6], "x":6.75, "y":1}, + {"matrix":[1,7], "x":7.75, "y":1}, + {"matrix":[1,8], "x":8.75, "y":1}, + {"matrix":[1,9], "x":9.75, "y":1}, + {"matrix":[1,10], "x":10.75, "y":1}, + {"matrix":[1,11], "x":11.75, "y":1}, + {"matrix":[1,13], "x":12.75, "y":1, "w":2.25}, + {"matrix":[1,14], "x":15.25, "y":1.25}, + + {"matrix":[2,0], "x":0, "y":2, "w":2.25}, + {"matrix":[2,2], "x":2.25, "y":2}, + {"matrix":[2,3], "x":3.25, "y":2}, + {"matrix":[2,4], "x":4.25, "y":2}, + {"matrix":[2,5], "x":5.25, "y":2}, + {"matrix":[2,6], "x":6.25, "y":2}, + {"matrix":[2,7], "x":7.25, "y":2}, + {"matrix":[2,8], "x":8.25, "y":2}, + {"matrix":[2,9], "x":9.25, "y":2}, + {"matrix":[2,10], "x":10.25, "y":2}, + {"matrix":[2,11], "x":11.25, "y":2}, + {"matrix":[2,13], "x":12.25, "y":2, "w":1.75}, + {"matrix":[2,14], "x":14, "y":2}, + + {"matrix":[3,0], "x":0, "y":3, "w":1.25}, + {"matrix":[3,1], "x":1.25, "y":3, "w":1.25}, + {"matrix":[3,2], "x":2.5, "y":3, "w":1.25}, + {"matrix":[3,3], "x":3.75, "y":3, "w":1.25}, + {"matrix":[3,6], "x":5, "y":3, "w":2.25}, + {"matrix":[3,9], "x":7.25, "y":3, "w":2.75}, + {"matrix":[3,10], "x":10, "y":3}, + {"matrix":[3,11], "x":11, "y":3}, + {"matrix":[3,12], "x":12, "y":3}, + {"matrix":[3,13], "x":13, "y":3}, + {"matrix":[3,14], "x":14, "y":3}, + {"matrix":[1,12], "x":15, "y":3} + ] + } + } +} diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c new file mode 100644 index 0000000000..abeafa4922 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c @@ -0,0 +1,72 @@ +/* Copyright 2022 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +// clang-format off + +enum layers{ + MAC_BASE, + WIN_BASE, + MAC_FN1, + WIN_FN1, + FN2 +}; + +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_MUTE, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LOPT, KC_LCMD, MO(MAC_FN1), KC_SPC, KC_SPC, KC_RCMD, MO(MAC_FN1), MO(FN2), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_MUTE, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LWIN, KC_LALT, MO(WIN_FN1), KC_SPC, KC_SPC, KC_RALT, MO(WIN_FN1), MO(FN2), KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN1] = LAYOUT( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [WIN_FN1] = LAYOUT( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [FN2] = LAYOUT( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, _______, + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN1] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_FN1] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [FN2] = {ENCODER_CCW_CW(_______, _______)} +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/rules.mk b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/config.h b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/config.h new file mode 100644 index 0000000000..76cdab7392 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/config.h @@ -0,0 +1,17 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#define DYNAMIC_KEYMAP_LAYER_COUNT 5 diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c new file mode 100644 index 0000000000..c8a4f2e272 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c @@ -0,0 +1,90 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H +#include "keychron_common.h" +#include "keychron_ft_common.h" + +// clang-format off + +enum layers{ + MAC_BASE, + WIN_BASE, + MAC_FN1, + WIN_FN1, + FN2 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_MUTE, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LOPTN, KC_LCMMD, MO(MAC_FN1), KC_SPC, KC_SPC, KC_RCMMD, MO(MAC_FN1), MO(FN2), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_MUTE, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LWIN, KC_LALT, MO(WIN_FN1), KC_SPC, KC_SPC, KC_RALT, MO(WIN_FN1), MO(FN2), KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN1] = LAYOUT( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [WIN_FN1] = LAYOUT( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [FN2] = LAYOUT( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, _______, + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN1] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_FN1] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [FN2] = {ENCODER_CCW_CW(_______, _______)} +}; +#endif // ENCODER_MAP_ENABLE + +// clang-format on + +void housekeeping_task_user(void) { + housekeeping_task_keychron(); + housekeeping_task_keychron_ft(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_keychron(keycode, record)) { + return false; + } + + if (!process_record_keychron_ft(keycode, record)) { + return false; + } + + return true; +} diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/rules.mk b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/rules.mk new file mode 100644 index 0000000000..88c27a468a --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/rules.mk @@ -0,0 +1,5 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes + +VPATH += keyboards/keychron/common +SRC += keychron_common.c keychron_ft_common.c diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/config.h b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/config.h new file mode 100644 index 0000000000..76cdab7392 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/config.h @@ -0,0 +1,17 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#define DYNAMIC_KEYMAP_LAYER_COUNT 5 diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c new file mode 100644 index 0000000000..abeafa4922 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c @@ -0,0 +1,72 @@ +/* Copyright 2022 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +// clang-format off + +enum layers{ + MAC_BASE, + WIN_BASE, + MAC_FN1, + WIN_FN1, + FN2 +}; + +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_MUTE, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LOPT, KC_LCMD, MO(MAC_FN1), KC_SPC, KC_SPC, KC_RCMD, MO(MAC_FN1), MO(FN2), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_MUTE, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LWIN, KC_LALT, MO(WIN_FN1), KC_SPC, KC_SPC, KC_RALT, MO(WIN_FN1), MO(FN2), KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN1] = LAYOUT( + KC_GRV, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [WIN_FN1] = LAYOUT( + KC_GRV, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, RGB_TOG, + RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [FN2] = LAYOUT( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, _______, + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [MAC_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [WIN_BASE] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}, + [MAC_FN1] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [WIN_FN1] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI)}, + [FN2] = {ENCODER_CCW_CW(_______, _______)} +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/rules.mk b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/rules.mk new file mode 100644 index 0000000000..f1adcab005 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/keychron/q9_plus/ansi_encoder/rules.mk b/keyboards/keychron/q9_plus/ansi_encoder/rules.mk new file mode 100644 index 0000000000..bbe678bed5 --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/rules.mk @@ -0,0 +1,8 @@ +# Build Options +# change yes to no to disable +# +EEPROM_DRIVER = wear_leveling +WEAR_LEVELING_DRIVER = embedded_flash + +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE diff --git a/keyboards/keychron/q9_plus/config.h b/keyboards/keychron/q9_plus/config.h new file mode 100644 index 0000000000..6dea4a6464 --- /dev/null +++ b/keyboards/keychron/q9_plus/config.h @@ -0,0 +1,102 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* Disable DIP switch in matrix data */ +#define MATRIX_MASKED + +/* DIP switch */ +#define DIP_SWITCH_MATRIX_GRID { { 3, 4 } } +#define SCAN_COUNT_MAX 100 + +/* RGB Matrix Driver Configuration */ +#define DRIVER_COUNT 1 +#define DRIVER_ADDR_1 0b1110100 + +/* Increase I2C speed to 1000 KHz */ +#define I2C1_TIMINGR_PRESC 0U +#define I2C1_TIMINGR_SCLDEL 3U +#define I2C1_TIMINGR_SDADEL 0U +#define I2C1_TIMINGR_SCLH 15U +#define I2C1_TIMINGR_SCLL 51U + +/* Set LED driver current */ +#define CKLED2001_CURRENT_TUNE \ + { 0xF8, 0xF8, 0x70, 0xF8, 0xF8, 0x70, 0xF8, 0xF8, 0x70, 0xF8, 0xF8, 0x70 } + +/* turn off effects when suspended */ +#define RGB_DISABLE_WHEN_USB_SUSPENDED + +/* EEPROM Driver Configuration */ +#define WEAR_LEVELING_LOGICAL_SIZE 2048 +#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2) + +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +// #define ENABLE_RGB_MATRIX_ALPHAS_MODS +// #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +// #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_BREATHING +// #define ENABLE_RGB_MATRIX_BAND_SAT +// #define ENABLE_RGB_MATRIX_BAND_VAL +// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +// #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +// #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +#define ENABLE_RGB_MATRIX_CYCLE_ALL +#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +#define ENABLE_RGB_MATRIX_DUAL_BEACON +#define ENABLE_RGB_MATRIX_RAINBOW_BEACON +// #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +// #define ENABLE_RGB_MATRIX_RAINDROPS +#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +// #define ENABLE_RGB_MATRIX_HUE_BREATHING +// #define ENABLE_RGB_MATRIX_HUE_PENDULUM +// #define ENABLE_RGB_MATRIX_HUE_WAVE +#define ENABLE_RGB_MATRIX_PIXEL_RAIN +// #define ENABLE_RGB_MATRIX_PIXEL_FLOW +// #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL + +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +#define ENABLE_RGB_MATRIX_TYPING_HEATMAP +#define ENABLE_RGB_MATRIX_DIGITAL_RAIN + +#define RGB_MATRIX_KEYPRESSES +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE +// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#define ENABLE_RGB_MATRIX_SPLASH +// #define ENABLE_RGB_MATRIX_MULTISPLASH +#define ENABLE_RGB_MATRIX_SOLID_SPLASH +// #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH + +/* Factory test keys */ +#define FN_KEY1 MO(4) diff --git a/keyboards/keychron/q9_plus/halconf.h b/keyboards/keychron/q9_plus/halconf.h new file mode 100644 index 0000000000..463d177eab --- /dev/null +++ b/keyboards/keychron/q9_plus/halconf.h @@ -0,0 +1,24 @@ +/* Copyright 2020 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#define HAL_USE_I2C TRUE +#ifdef ENCODER_ENABLE +# define PAL_USE_CALLBACKS TRUE +#endif + +#include_next diff --git a/keyboards/keychron/q9_plus/mcuconf.h b/keyboards/keychron/q9_plus/mcuconf.h new file mode 100644 index 0000000000..0ca8c64850 --- /dev/null +++ b/keyboards/keychron/q9_plus/mcuconf.h @@ -0,0 +1,22 @@ +/* Copyright 2020 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include_next + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE diff --git a/keyboards/keychron/q9_plus/q9_plus.c b/keyboards/keychron/q9_plus/q9_plus.c new file mode 100644 index 0000000000..1c742a26ad --- /dev/null +++ b/keyboards/keychron/q9_plus/q9_plus.c @@ -0,0 +1,34 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#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)) { return false;} + if (index == 0) { + default_layer_set(1UL << (active ? 1 : 0)); + } + return true; +} +#endif diff --git a/keyboards/keychron/q9_plus/readme.md b/keyboards/keychron/q9_plus/readme.md new file mode 100644 index 0000000000..174cf8c232 --- /dev/null +++ b/keyboards/keychron/q9_plus/readme.md @@ -0,0 +1,21 @@ +# Keychron Q9 Plus + +![Keychron Q9 Plus]() + +A customizable 40% keyboard. + +* Keyboard Maintainer: [Keychron](https://github.com/keychron) +* Hardware Supported: Keychron Q9 Plus +* Hardware Availability: []() + +Make example for this keyboard (after setting up your build environment): + + make keychron/q9/ansi_encoder:default + +Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) + + make keychron/q9/ansi:default:flash + +**Reset Key**: Hold down the key located at *K00*, programmed as *TAB* while plugging in the keyboard. + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/keychron/s1/ansi/rgb/keymaps/via/keymap.c b/keyboards/keychron/s1/ansi/rgb/keymaps/via/keymap.c index d5b5a636f1..62df94d330 100644 --- a/keyboards/keychron/s1/ansi/rgb/keymaps/via/keymap.c +++ b/keyboards/keychron/s1/ansi/rgb/keymaps/via/keymap.c @@ -30,7 +30,7 @@ enum layers { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_75_ansi( - KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_DEL, RGB_MOD, + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_DEL, RGB_MOD, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, diff --git a/keyboards/keychron/s1/ansi/rgb/rules.mk b/keyboards/keychron/s1/ansi/rgb/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/s1/ansi/rgb/rules.mk +++ b/keyboards/keychron/s1/ansi/rgb/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/s1/ansi/white/keymaps/default/keymap.c b/keyboards/keychron/s1/ansi/white/keymaps/default/keymap.c index 8e1d96fb7b..75b81b5c60 100644 --- a/keyboards/keychron/s1/ansi/white/keymaps/default/keymap.c +++ b/keyboards/keychron/s1/ansi/white/keymaps/default/keymap.c @@ -30,7 +30,7 @@ enum layers{ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_75_ansi( - KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_DEL, BL_STEP, + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_DEL, BL_STEP, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, diff --git a/keyboards/keychron/s1/ansi/white/keymaps/via/keymap.c b/keyboards/keychron/s1/ansi/white/keymaps/via/keymap.c index a9e08d71a7..bf45ace9b3 100644 --- a/keyboards/keychron/s1/ansi/white/keymaps/via/keymap.c +++ b/keyboards/keychron/s1/ansi/white/keymaps/via/keymap.c @@ -30,7 +30,7 @@ enum layers { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MAC_BASE] = LAYOUT_75_ansi( - KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LAPD, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_DEL, BL_STEP, + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, BL_DOWN, BL_UP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_DEL, BL_STEP, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, diff --git a/keyboards/keychron/s1/ansi/white/rules.mk b/keyboards/keychron/s1/ansi/white/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/s1/ansi/white/rules.mk +++ b/keyboards/keychron/s1/ansi/white/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/s1/config.h b/keyboards/keychron/s1/config.h index e70c1fdb7a..c74e0b4a49 100644 --- a/keyboards/keychron/s1/config.h +++ b/keyboards/keychron/s1/config.h @@ -20,10 +20,7 @@ #define MATRIX_MASKED /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* EEPROM Driver Configuration */ @@ -39,4 +36,4 @@ /* Factory test keys */ #define FN_KEY1 MO(1) -#define FN_KEY2 MO(3) \ No newline at end of file +#define FN_KEY2 MO(3) diff --git a/keyboards/keychron/v1/ansi/rules.mk b/keyboards/keychron/v1/ansi/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v1/ansi/rules.mk +++ b/keyboards/keychron/v1/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v1/ansi_encoder/rules.mk b/keyboards/keychron/v1/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v1/ansi_encoder/rules.mk +++ b/keyboards/keychron/v1/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v1/config.h b/keyboards/keychron/v1/config.h index 0701d1c933..afddf76d17 100644 --- a/keyboards/keychron/v1/config.h +++ b/keyboards/keychron/v1/config.h @@ -20,10 +20,7 @@ #define MATRIX_MASKED /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* RGB Matrix Driver Configuration */ diff --git a/keyboards/keychron/v1/iso/rules.mk b/keyboards/keychron/v1/iso/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v1/iso/rules.mk +++ b/keyboards/keychron/v1/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v1/iso_encoder/rules.mk b/keyboards/keychron/v1/iso_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v1/iso_encoder/rules.mk +++ b/keyboards/keychron/v1/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v1/jis/rules.mk b/keyboards/keychron/v1/jis/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v1/jis/rules.mk +++ b/keyboards/keychron/v1/jis/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v1/jis_encoder/rules.mk b/keyboards/keychron/v1/jis_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v1/jis_encoder/rules.mk +++ b/keyboards/keychron/v1/jis_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v1/v1.c b/keyboards/keychron/v1/v1.c index 44f6099155..374a80e09a 100644 --- a/keyboards/keychron/v1/v1.c +++ b/keyboards/keychron/v1/v1.c @@ -36,15 +36,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) -#include "keychron_common.h" - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/v10/ansi_encoder/rules.mk b/keyboards/keychron/v10/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v10/ansi_encoder/rules.mk +++ b/keyboards/keychron/v10/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v10/config.h b/keyboards/keychron/v10/config.h index 2d02c6b9ec..1895c52910 100644 --- a/keyboards/keychron/v10/config.h +++ b/keyboards/keychron/v10/config.h @@ -35,10 +35,7 @@ { 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A, 0x98, 0x98, 0x4A } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 5 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 5 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/v10/iso_encoder/rules.mk b/keyboards/keychron/v10/iso_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v10/iso_encoder/rules.mk +++ b/keyboards/keychron/v10/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v10/v10.c b/keyboards/keychron/v10/v10.c index 6138d44c95..66c66afd86 100644 --- a/keyboards/keychron/v10/v10.c +++ b/keyboards/keychron/v10/v10.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b1111111111111111, @@ -37,14 +36,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/v2/ansi/rules.mk b/keyboards/keychron/v2/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v2/ansi/rules.mk +++ b/keyboards/keychron/v2/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v2/ansi_encoder/rules.mk b/keyboards/keychron/v2/ansi_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v2/ansi_encoder/rules.mk +++ b/keyboards/keychron/v2/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v2/config.h b/keyboards/keychron/v2/config.h index ae6a6cb98a..11b41476fb 100644 --- a/keyboards/keychron/v2/config.h +++ b/keyboards/keychron/v2/config.h @@ -41,10 +41,7 @@ #define MATRIX_MASKED /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 4, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 4, 4 } } #define SCAN_COUNT_MAX 100 /* turn off effects when suspended */ diff --git a/keyboards/keychron/v2/iso/rules.mk b/keyboards/keychron/v2/iso/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v2/iso/rules.mk +++ b/keyboards/keychron/v2/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v2/iso_encoder/rules.mk b/keyboards/keychron/v2/iso_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v2/iso_encoder/rules.mk +++ b/keyboards/keychron/v2/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v2/jis/rules.mk b/keyboards/keychron/v2/jis/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v2/jis/rules.mk +++ b/keyboards/keychron/v2/jis/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v2/jis_encoder/rules.mk b/keyboards/keychron/v2/jis_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v2/jis_encoder/rules.mk +++ b/keyboards/keychron/v2/jis_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v2/v2.c b/keyboards/keychron/v2/v2.c index bce9389336..e903b1f70a 100644 --- a/keyboards/keychron/v2/v2.c +++ b/keyboards/keychron/v2/v2.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b111111111111111, @@ -34,14 +33,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/v3/ansi/rules.mk b/keyboards/keychron/v3/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v3/ansi/rules.mk +++ b/keyboards/keychron/v3/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v3/ansi_encoder/rules.mk b/keyboards/keychron/v3/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v3/ansi_encoder/rules.mk +++ b/keyboards/keychron/v3/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v3/config.h b/keyboards/keychron/v3/config.h index cd9340a38f..10f2c6cebb 100644 --- a/keyboards/keychron/v3/config.h +++ b/keyboards/keychron/v3/config.h @@ -38,10 +38,7 @@ { 0x98, 0x98, 0x44, 0x98, 0x98, 0x44, 0x98, 0x98, 0x44, 0x98, 0x98, 0x44 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 #define OS_SWITCH_REVERSE diff --git a/keyboards/keychron/v3/iso/rules.mk b/keyboards/keychron/v3/iso/rules.mk index 41120843c9..9077e5e2e3 100644 --- a/keyboards/keychron/v3/iso/rules.mk +++ b/keyboards/keychron/v3/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v3/iso_encoder/rules.mk b/keyboards/keychron/v3/iso_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v3/iso_encoder/rules.mk +++ b/keyboards/keychron/v3/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v3/jis/rules.mk b/keyboards/keychron/v3/jis/rules.mk index 41120843c9..9077e5e2e3 100644 --- a/keyboards/keychron/v3/jis/rules.mk +++ b/keyboards/keychron/v3/jis/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v3/jis_encoder/rules.mk b/keyboards/keychron/v3/jis_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v3/jis_encoder/rules.mk +++ b/keyboards/keychron/v3/jis_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v3/v3.c b/keyboards/keychron/v3/v3.c index 930910d1d2..2d9d7921f0 100644 --- a/keyboards/keychron/v3/v3.c +++ b/keyboards/keychron/v3/v3.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" // clang-format off @@ -45,14 +44,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/v4/ansi/rules.mk b/keyboards/keychron/v4/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v4/ansi/rules.mk +++ b/keyboards/keychron/v4/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v4/config.h b/keyboards/keychron/v4/config.h index 751d261cd7..9e7d9f29d1 100644 --- a/keyboards/keychron/v4/config.h +++ b/keyboards/keychron/v4/config.h @@ -32,10 +32,7 @@ { 0xD0, 0xD0, 0x60, 0xD0, 0xD0, 0x60, 0xD0, 0xD0, 0x60, 0xD0, 0xD0, 0x60 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 4, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 4, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/v4/iso/rules.mk b/keyboards/keychron/v4/iso/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v4/iso/rules.mk +++ b/keyboards/keychron/v4/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v5/ansi/rules.mk b/keyboards/keychron/v5/ansi/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v5/ansi/rules.mk +++ b/keyboards/keychron/v5/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v5/ansi_encoder/rules.mk b/keyboards/keychron/v5/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v5/ansi_encoder/rules.mk +++ b/keyboards/keychron/v5/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v5/config.h b/keyboards/keychron/v5/config.h index 4fc0818422..edf2414bd3 100644 --- a/keyboards/keychron/v5/config.h +++ b/keyboards/keychron/v5/config.h @@ -33,10 +33,7 @@ { 0xB0, 0xB0, 0x56, 0xB0, 0xB0, 0x56, 0xB0, 0xB0, 0x56, 0xB0, 0xB0, 0x56 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/v5/iso/rules.mk b/keyboards/keychron/v5/iso/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v5/iso/rules.mk +++ b/keyboards/keychron/v5/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v5/iso_encoder/rules.mk b/keyboards/keychron/v5/iso_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v5/iso_encoder/rules.mk +++ b/keyboards/keychron/v5/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v5/v5.c b/keyboards/keychron/v5/v5.c index 9cc795e0dc..883f7c573b 100644 --- a/keyboards/keychron/v5/v5.c +++ b/keyboards/keychron/v5/v5.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b111111111111111111, @@ -37,14 +36,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/v6/ansi/rules.mk b/keyboards/keychron/v6/ansi/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v6/ansi/rules.mk +++ b/keyboards/keychron/v6/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v6/ansi_encoder/rules.mk b/keyboards/keychron/v6/ansi_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v6/ansi_encoder/rules.mk +++ b/keyboards/keychron/v6/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v6/config.h b/keyboards/keychron/v6/config.h index eaed10bca8..6c902e824c 100644 --- a/keyboards/keychron/v6/config.h +++ b/keyboards/keychron/v6/config.h @@ -33,10 +33,7 @@ { 0xA8, 0xA8, 0x48, 0xA8, 0xA8, 0x48, 0xA8, 0xA8, 0x48, 0xA8, 0xA8, 0x48 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 5, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/v6/iso/rules.mk b/keyboards/keychron/v6/iso/rules.mk index 2aa5535093..aa286a1616 100644 --- a/keyboards/keychron/v6/iso/rules.mk +++ b/keyboards/keychron/v6/iso/rules.mk @@ -1,5 +1,6 @@ # Build Options -RGB_MATRIX_DRIVER = CKLED2001 +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v6/iso_encoder/rules.mk b/keyboards/keychron/v6/iso_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v6/iso_encoder/rules.mk +++ b/keyboards/keychron/v6/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v6/jis_encoder/rules.mk b/keyboards/keychron/v6/jis_encoder/rules.mk index 56c9b06014..aa286a1616 100644 --- a/keyboards/keychron/v6/jis_encoder/rules.mk +++ b/keyboards/keychron/v6/jis_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v6/v6.c b/keyboards/keychron/v6/v6.c index 8740fc0698..eeabe98007 100644 --- a/keyboards/keychron/v6/v6.c +++ b/keyboards/keychron/v6/v6.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" // clang-format off const matrix_row_t matrix_mask[] = { @@ -42,14 +41,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif diff --git a/keyboards/keychron/v7/ansi/rules.mk b/keyboards/keychron/v7/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v7/ansi/rules.mk +++ b/keyboards/keychron/v7/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v7/config.h b/keyboards/keychron/v7/config.h index aec18ea7c9..d71c959144 100644 --- a/keyboards/keychron/v7/config.h +++ b/keyboards/keychron/v7/config.h @@ -35,10 +35,7 @@ { 0xFC, 0xFC, 0x70, 0xFC, 0xFC, 0x70, 0xFC, 0xFC, 0x70, 0xFC, 0xFC, 0x70 } // v7 iso /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 4, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 4, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/v7/iso/rules.mk b/keyboards/keychron/v7/iso/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v7/iso/rules.mk +++ b/keyboards/keychron/v7/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v8/ansi/rules.mk b/keyboards/keychron/v8/ansi/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v8/ansi/rules.mk +++ b/keyboards/keychron/v8/ansi/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v8/ansi_encoder/rules.mk b/keyboards/keychron/v8/ansi_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v8/ansi_encoder/rules.mk +++ b/keyboards/keychron/v8/ansi_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v8/config.h b/keyboards/keychron/v8/config.h index 2dffc68eb6..03977b1b2e 100644 --- a/keyboards/keychron/v8/config.h +++ b/keyboards/keychron/v8/config.h @@ -38,10 +38,7 @@ { 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60, 0xC4, 0xC4, 0x60 } /* DIP switch */ -#define DIP_SWITCH_MATRIX_GRID \ - { \ - { 4, 4 } \ - } +#define DIP_SWITCH_MATRIX_GRID { { 4, 4 } } #define SCAN_COUNT_MAX 100 /* Disable DIP switch in matrix data */ diff --git a/keyboards/keychron/v8/iso/rules.mk b/keyboards/keychron/v8/iso/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v8/iso/rules.mk +++ b/keyboards/keychron/v8/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v8/iso_encoder/rules.mk b/keyboards/keychron/v8/iso_encoder/rules.mk index 804c007b36..4bc1e23a57 100644 --- a/keyboards/keychron/v8/iso_encoder/rules.mk +++ b/keyboards/keychron/v8/iso_encoder/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash diff --git a/keyboards/keychron/v8/v8.c b/keyboards/keychron/v8/v8.c index 5377a882e0..1c2f36f199 100644 --- a/keyboards/keychron/v8/v8.c +++ b/keyboards/keychron/v8/v8.c @@ -15,7 +15,6 @@ */ #include "quantum.h" -#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b111111111111111, @@ -34,14 +33,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { return true; } #endif - -#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) - -void keyboard_post_init_kb(void) { - keyboard_post_init_keychron(); - - // allow user keymaps to do custom post_init - keyboard_post_init_user(); -} - -#endif