From 9e06f870173f7abcaf4c3b32dbfbb6e6e19c6ae3 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <66767061+lalalademaxiya1@users.noreply.github.com> Date: Wed, 22 Mar 2023 16:08:00 +0800 Subject: [PATCH 01/13] Update v8 knob include ansi and iso version --- keyboards/keychron/v8/v8.c | 77 ------------------- .../v8/v8_ansi_stm32l432_ec11/config.h | 4 +- .../v8/v8_ansi_stm32l432_ec11/info.json | 2 +- .../keymaps/keychron/keymap.c | 14 +--- .../keymaps/keychron/rules.mk | 3 +- .../v8_ansi_stm32l432_ec11.c | 2 +- .../v8/v8_iso_stm32l432_ec11/info.json | 2 +- .../keymaps/keychron/keymap.c | 14 +--- .../keymaps/keychron/rules.mk | 3 +- .../v8_iso_stm32l432_ec11.c | 2 +- quantum/encoder.c | 11 ++- quantum/encoder.h | 1 + 12 files changed, 23 insertions(+), 112 deletions(-) diff --git a/keyboards/keychron/v8/v8.c b/keyboards/keychron/v8/v8.c index 2b3584f1c4..2700343348 100644 --- a/keyboards/keychron/v8/v8.c +++ b/keyboards/keychron/v8/v8.c @@ -35,80 +35,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { } #endif // DIP_SWITCH_ENABLE - -#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX) - -# define CAPS_LOCK_MAX_BRIGHTNESS 0xFF -# ifdef RGB_MATRIX_MAXIMUM_BRIGHTNESS -# undef CAPS_LOCK_MAX_BRIGHTNESS -# define CAPS_LOCK_MAX_BRIGHTNESS RGB_MATRIX_MAXIMUM_BRIGHTNESS -# endif - -# define CAPS_LOCK_VAL_STEP 8 -# ifdef RGB_MATRIX_VAL_STEP -# undef CAPS_LOCK_VAL_STEP -# define CAPS_LOCK_VAL_STEP RGB_MATRIX_VAL_STEP -# endif - -extern void rgb_matrix_update_pwm_buffers(void); - -static uint8_t light_brightness_get(void) { - uint8_t value = rgb_matrix_get_val(); - if (value < CAPS_LOCK_VAL_STEP) { - value = CAPS_LOCK_VAL_STEP; - } else if (value < (CAPS_LOCK_MAX_BRIGHTNESS - CAPS_LOCK_VAL_STEP)) { - value += CAPS_LOCK_VAL_STEP; // one step more than current brightness - } else { - value = CAPS_LOCK_MAX_BRIGHTNESS; - } - - return value; -} - -bool rgb_matrix_indicators_kb(void) { - if (!rgb_matrix_indicators_user()) { - return false; - } - if (host_keyboard_led_state().caps_lock) { - uint8_t v = light_brightness_get(); - rgb_matrix_set_color(CAPS_LOCK_LED_INDEX, v, v, v); // white, with the adjusted brightness - } - return true; -} - -void rgb_matrix_indicators_none_kb(void) { - rgb_matrix_indicators_kb(); - rgb_matrix_update_pwm_buffers(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - - if (rgb_matrix_is_enabled() -# if defined(ENABLE_RGB_MATRIX_RAINDROPS) - && (rgb_matrix_get_mode() != RGB_MATRIX_RAINDROPS) -# endif -# if defined(ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS) - && (rgb_matrix_get_mode() != RGB_MATRIX_JELLYBEAN_RAINDROPS) -# endif -# if defined(ENABLE_RGB_MATRIX_PIXEL_RAIN) - && (rgb_matrix_get_mode() != RGB_MATRIX_PIXEL_RAIN) -# endif - ) { - return res; - } - - if (res) { - if (led_state.caps_lock) { - uint8_t v = light_brightness_get(); - rgb_matrix_set_color(CAPS_LOCK_LED_INDEX, v, v, v); - } else { - rgb_matrix_set_color(CAPS_LOCK_LED_INDEX, 0, 0, 0); - } - rgb_matrix_update_pwm_buffers(); - } - - return res; -} - -#endif // CAPS_LOCK_LED_INDEX diff --git a/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/config.h b/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/config.h index 6d749eed37..7aa9137c9f 100644 --- a/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/config.h +++ b/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/config.h @@ -22,8 +22,8 @@ #define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) /* Encoder Configuration */ -#define ENCODERS_PAD_A { A10 } -#define ENCODERS_PAD_B { B5 } +#define ENCODERS_PAD_A { B5 } +#define ENCODERS_PAD_B { A10 } #define ENCODER_RESOLUTION 4 #define ENCODER_DEFAULT_POS 0x3 diff --git a/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/info.json b/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/info.json index f4975e7372..f0a2fc8d3e 100644 --- a/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/info.json +++ b/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/info.json @@ -6,7 +6,7 @@ "usb": { "vid": "0x3434", "pid": "0x0381", - "device_version": "1.0.1" + "device_version": "1.0.2" }, "processor": "STM32L432", "bootloader": "stm32-dfu", diff --git a/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/keymaps/keychron/keymap.c b/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/keymaps/keychron/keymap.c index 16cbfcb979..a2202aecf0 100644 --- a/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/keymaps/keychron/keymap.c +++ b/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/keymaps/keychron/keymap.c @@ -16,6 +16,7 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" +#include "keychron_ft_common.h" // clang-format off @@ -84,21 +85,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_keychron(keycode, record)) { return false; } - return true; -} -bool dip_switch_update_user(uint8_t index, bool active) { - if (!dip_switch_update_keychron(index, active)) { + if (!process_record_keychron_ft(keycode, record)) { return false; } - return true; -} -#ifdef RGB_MATRIX_ENABLE -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - if (!rgb_matrix_indicators_advanced_keychron(led_min, led_max)) { - return false; - } return true; } -#endif // RGB_MATRIX_ENABLE diff --git a/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/keymaps/keychron/rules.mk b/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/keymaps/keychron/rules.mk index f33d417444..88c27a468a 100644 --- a/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/keymaps/keychron/rules.mk +++ b/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/keymaps/keychron/rules.mk @@ -2,5 +2,4 @@ VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes VPATH += keyboards/keychron/common -SRC += keychron_common.c -SRC += keychron_factory_test_common.c +SRC += keychron_common.c keychron_ft_common.c diff --git a/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/v8_ansi_stm32l432_ec11.c b/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/v8_ansi_stm32l432_ec11.c index 028416a95c..48e65c7f81 100644 --- a/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/v8_ansi_stm32l432_ec11.c +++ b/keyboards/keychron/v8/v8_ansi_stm32l432_ec11/v8_ansi_stm32l432_ec11.c @@ -139,7 +139,7 @@ led_config_t g_led_config = { void encoder0_pad_cb(void *param) { (void)param; - encoder_insert_state(); + encoder_insert_state(0); } void keyboard_post_init_kb(void) { diff --git a/keyboards/keychron/v8/v8_iso_stm32l432_ec11/info.json b/keyboards/keychron/v8/v8_iso_stm32l432_ec11/info.json index 678f887a4f..3c135cf483 100644 --- a/keyboards/keychron/v8/v8_iso_stm32l432_ec11/info.json +++ b/keyboards/keychron/v8/v8_iso_stm32l432_ec11/info.json @@ -6,7 +6,7 @@ "usb": { "vid": "0x3434", "pid": "0x0383", - "device_version": "1.0.1" + "device_version": "1.0.2" }, "processor": "STM32L432", "bootloader": "stm32-dfu", diff --git a/keyboards/keychron/v8/v8_iso_stm32l432_ec11/keymaps/keychron/keymap.c b/keyboards/keychron/v8/v8_iso_stm32l432_ec11/keymaps/keychron/keymap.c index 355ea736ce..18ea36afda 100644 --- a/keyboards/keychron/v8/v8_iso_stm32l432_ec11/keymaps/keychron/keymap.c +++ b/keyboards/keychron/v8/v8_iso_stm32l432_ec11/keymaps/keychron/keymap.c @@ -16,6 +16,7 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" +#include "keychron_ft_common.h" // clang-format off @@ -84,21 +85,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_keychron(keycode, record)) { return false; } - return true; -} -bool dip_switch_update_user(uint8_t index, bool active) { - if (!dip_switch_update_keychron(index, active)) { + if (!process_record_keychron_ft(keycode, record)) { return false; } - return true; -} -#ifdef RGB_MATRIX_ENABLE -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - if (!rgb_matrix_indicators_advanced_keychron(led_min, led_max)) { - return false; - } return true; } -#endif // RGB_MATRIX_ENABLE diff --git a/keyboards/keychron/v8/v8_iso_stm32l432_ec11/keymaps/keychron/rules.mk b/keyboards/keychron/v8/v8_iso_stm32l432_ec11/keymaps/keychron/rules.mk index f33d417444..88c27a468a 100644 --- a/keyboards/keychron/v8/v8_iso_stm32l432_ec11/keymaps/keychron/rules.mk +++ b/keyboards/keychron/v8/v8_iso_stm32l432_ec11/keymaps/keychron/rules.mk @@ -2,5 +2,4 @@ VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes VPATH += keyboards/keychron/common -SRC += keychron_common.c -SRC += keychron_factory_test_common.c +SRC += keychron_common.c keychron_ft_common.c diff --git a/keyboards/keychron/v8/v8_iso_stm32l432_ec11/v8_iso_stm32l432_ec11.c b/keyboards/keychron/v8/v8_iso_stm32l432_ec11/v8_iso_stm32l432_ec11.c index ea7c780ce8..6b816dfc0f 100644 --- a/keyboards/keychron/v8/v8_iso_stm32l432_ec11/v8_iso_stm32l432_ec11.c +++ b/keyboards/keychron/v8/v8_iso_stm32l432_ec11/v8_iso_stm32l432_ec11.c @@ -139,7 +139,7 @@ led_config_t g_led_config = { void encoder0_pad_cb(void *param) { (void)param; - encoder_insert_state(); + encoder_insert_state(0); } void keyboard_post_init_kb(void) { diff --git a/quantum/encoder.c b/quantum/encoder.c index 3aee340249..a6a4542f15 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c @@ -56,6 +56,7 @@ static int8_t encoder_LUT[] = {0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, static uint8_t encoder_state[NUM_ENCODERS] = {0}; static int8_t encoder_pulses[NUM_ENCODERS] = {0}; +static bool encoder_external_update[NUM_ENCODERS] = {false}; // encoder counts static uint8_t thisCount; @@ -221,10 +222,11 @@ bool encoder_read(void) { bool changed = false; for (uint8_t i = 0; i < thisCount; i++) { uint8_t new_status = (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1); - if ((encoder_state[i] & 0x3) != new_status) { + if ((encoder_state[i] & 0x3) != new_status || encoder_external_update[i]) { encoder_state[i] <<= 2; encoder_state[i] |= new_status; changed |= encoder_update(i, encoder_state[i]); + encoder_external_update[i] = false; } } return changed; @@ -268,3 +270,10 @@ void encoder_update_raw(uint8_t *slave_state) { if (changed) last_encoder_activity_trigger(); } #endif + +void encoder_insert_state(uint8_t index) { + encoder_state[index] <<= 2; + encoder_state[index] |= (readPin(encoders_pad_a[index]) << 0) | (readPin(encoders_pad_b[index]) << 1); + encoder_pulses[index] += encoder_LUT[encoder_state[index] & 0xF]; + encoder_external_update[index] = true; +} diff --git a/quantum/encoder.h b/quantum/encoder.h index 4eb67fa25d..54c97c8dc6 100644 --- a/quantum/encoder.h +++ b/quantum/encoder.h @@ -25,6 +25,7 @@ bool encoder_read(void); bool encoder_update_kb(uint8_t index, bool clockwise); bool encoder_update_user(uint8_t index, bool clockwise); +void encoder_insert_state(uint8_t index); #ifdef SPLIT_KEYBOARD From 77e6996b5ccaee5365787d136c9be9c83f5e0a3a Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <66767061+lalalademaxiya1@users.noreply.github.com> Date: Mon, 27 Mar 2023 14:51:38 +0800 Subject: [PATCH 02/13] Update v2 --- keyboards/keychron/v2/config.h | 19 +---- keyboards/keychron/v2/v2.c | 77 ------------------- .../v2/v2_ansi_stm32l432_ec11/config.h | 3 - .../v2/v2_ansi_stm32l432_ec11/info.json | 12 ++- .../keymaps/keychron/keymap.c | 14 +--- .../keymaps/keychron/rules.mk | 3 +- .../v2/v2_ansi_stm32l432_ec11/rules.mk | 2 - .../v2_ansi_stm32l432_ec11.c | 28 +++++-- quantum/encoder.c | 10 +-- quantum/encoder.h | 2 +- 10 files changed, 47 insertions(+), 123 deletions(-) diff --git a/keyboards/keychron/v2/config.h b/keyboards/keychron/v2/config.h index 56d381a578..cd7361118e 100644 --- a/keyboards/keychron/v2/config.h +++ b/keyboards/keychron/v2/config.h @@ -16,13 +16,6 @@ #pragma once -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION ROW2COL - -/* key matrix pins */ -#define MATRIX_ROW_PINS { B4, B3, A15, A14, A13 } -#define MATRIX_COL_PINS { C14, C15, A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, A8, A9, H3 } - /* If uses PH3 with a stronger pull resistor then the following definition should be included */ // #define MATRIX_UNSELECT_DRIVE_HIGH @@ -87,6 +80,10 @@ #define ENABLE_RGB_MATRIX_PIXEL_RAIN // #define ENABLE_RGB_MATRIX_PIXEL_FLOW // #define ENABLE_RGB_MATRIX_PIXEL_FRACTAL + +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#define RGB_MATRIX_KEYPRESSES + // enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined #define ENABLE_RGB_MATRIX_TYPING_HEATMAP #define ENABLE_RGB_MATRIX_DIGITAL_RAIN @@ -103,11 +100,3 @@ // #define ENABLE_RGB_MATRIX_MULTISPLASH #define ENABLE_RGB_MATRIX_SOLID_SPLASH // #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH - -#define RGB_MATRIX_KEYPRESSES -#define RGB_MATRIX_FRAMEBUFFER_EFFECTS - -/* Enable receive custom command from host */ -#define RAW_HID_CMD 0xAB - -#define HOLD_ON_OTHER_KEY_PRESS diff --git a/keyboards/keychron/v2/v2.c b/keyboards/keychron/v2/v2.c index 019dc5f890..26e992723e 100644 --- a/keyboards/keychron/v2/v2.c +++ b/keyboards/keychron/v2/v2.c @@ -35,80 +35,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) { } #endif // DIP_SWITCH_ENABLE - -#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX) - -# define CAPS_LOCK_MAX_BRIGHTNESS 0xFF -# ifdef RGB_MATRIX_MAXIMUM_BRIGHTNESS -# undef CAPS_LOCK_MAX_BRIGHTNESS -# define CAPS_LOCK_MAX_BRIGHTNESS RGB_MATRIX_MAXIMUM_BRIGHTNESS -# endif - -# define CAPS_LOCK_VAL_STEP 8 -# ifdef RGB_MATRIX_VAL_STEP -# undef CAPS_LOCK_VAL_STEP -# define CAPS_LOCK_VAL_STEP RGB_MATRIX_VAL_STEP -# endif - -extern void rgb_matrix_update_pwm_buffers(void); - -static uint8_t light_brightness_get(void) { - uint8_t value = rgb_matrix_get_val(); - if (value < CAPS_LOCK_VAL_STEP) { - value = CAPS_LOCK_VAL_STEP; - } else if (value < (CAPS_LOCK_MAX_BRIGHTNESS - CAPS_LOCK_VAL_STEP)) { - value += CAPS_LOCK_VAL_STEP; // one step more than current brightness - } else { - value = CAPS_LOCK_MAX_BRIGHTNESS; - } - - return value; -} - -bool rgb_matrix_indicators_kb(void) { - if (!rgb_matrix_indicators_user()) { - return false; - } - if (host_keyboard_led_state().caps_lock) { - uint8_t v = light_brightness_get(); - rgb_matrix_set_color(CAPS_LOCK_LED_INDEX, v, v, v); // white, with the adjusted brightness - } - return true; -} - -void rgb_matrix_indicators_none_kb(void) { - rgb_matrix_indicators_kb(); - rgb_matrix_update_pwm_buffers(); -} - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - - if (rgb_matrix_is_enabled() -# if defined(ENABLE_RGB_MATRIX_RAINDROPS) - && (rgb_matrix_get_mode() != RGB_MATRIX_RAINDROPS) -# endif -# if defined(ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS) - && (rgb_matrix_get_mode() != RGB_MATRIX_JELLYBEAN_RAINDROPS) -# endif -# if defined(ENABLE_RGB_MATRIX_PIXEL_RAIN) - && (rgb_matrix_get_mode() != RGB_MATRIX_PIXEL_RAIN) -# endif - ) { - return res; - } - - if (res) { - if (led_state.caps_lock) { - uint8_t v = light_brightness_get(); - rgb_matrix_set_color(CAPS_LOCK_LED_INDEX, v, v, v); - } else { - rgb_matrix_set_color(CAPS_LOCK_LED_INDEX, 0, 0, 0); - } - rgb_matrix_update_pwm_buffers(); - } - - return res; -} - -#endif // CAPS_LOCK_LED_INDEX diff --git a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/config.h b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/config.h index 9fa6121c6c..9f850f1b79 100644 --- a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/config.h +++ b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/config.h @@ -24,9 +24,6 @@ #define CKLED2001_CURRENT_TUNE { 0xCA, 0xCA, 0x60, 0xCA, 0xCA, 0x60, 0xCA, 0xCA, 0x60, 0xCA, 0xCA, 0x60 } /* Encoder Configuration */ -#define ENCODERS_PAD_A { A10 } -#define ENCODERS_PAD_B { B5 } -#define ENCODER_RESOLUTION 4 #define ENCODER_DEFAULT_POS 0x3 /* Enable caps-lock LED */ diff --git a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/info.json b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/info.json index 6b8ba63872..e73e236108 100644 --- a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/info.json +++ b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/info.json @@ -6,7 +6,17 @@ "usb": { "vid": "0x3434", "pid": "0x0321", - "device_version": "1.0.3" + "device_version": "1.0.4" + }, + "matrix_pins": { + "cols": ["C14", "C15", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "B0", "B1", "A8", "A9", "H3"], + "rows": ["B4", "B3", "A15", "A14", "A13"] + }, + "diode_direction": "ROW2COL", + "encoder": { + "rotary": [ + {"pin_a": "A10", "pin_b": "B5"} + ] }, "processor": "STM32L432", "bootloader": "stm32-dfu", diff --git a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/keymaps/keychron/keymap.c b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/keymaps/keychron/keymap.c index 88fa58b6fa..5f3bf6b679 100644 --- a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/keymaps/keychron/keymap.c +++ b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/keymaps/keychron/keymap.c @@ -16,6 +16,7 @@ #include QMK_KEYBOARD_H #include "keychron_common.h" +#include "keychron_ft_common.h" // clang-format off @@ -84,21 +85,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_keychron(keycode, record)) { return false; } - return true; -} -bool dip_switch_update_user(uint8_t index, bool active) { - if (!dip_switch_update_keychron(index, active)) { + if (!process_record_keychron_ft(keycode, record)) { return false; } - return true; -} -#ifdef RGB_MATRIX_ENABLE -bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - if(!rgb_matrix_indicators_advanced_keychron(led_min, led_max)) { - return false; - } return true; } -#endif // RGB_MATRIX_ENABLE diff --git a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/keymaps/keychron/rules.mk b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/keymaps/keychron/rules.mk index f33d417444..88c27a468a 100644 --- a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/keymaps/keychron/rules.mk +++ b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/keymaps/keychron/rules.mk @@ -2,5 +2,4 @@ VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes VPATH += keyboards/keychron/common -SRC += keychron_common.c -SRC += keychron_factory_test_common.c +SRC += keychron_common.c keychron_ft_common.c diff --git a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/rules.mk b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/rules.mk index f2cbf4a660..a5dbd2a938 100644 --- a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/rules.mk +++ b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/rules.mk @@ -7,8 +7,6 @@ EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = yes # Enable USB N-key Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output ENCODER_ENABLE = yes # Enable Encoder ENCODER_MAP_ENABLE = no diff --git a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/v2_ansi_stm32l432_ec11.c b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/v2_ansi_stm32l432_ec11.c index 23273cdbab..8472f99600 100644 --- a/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/v2_ansi_stm32l432_ec11.c +++ b/keyboards/keychron/v2/v2_ansi_stm32l432_ec11/v2_ansi_stm32l432_ec11.c @@ -125,7 +125,7 @@ led_config_t g_led_config = { 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 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, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 4, 1, 4, 1, 1, 1, 1 } }; @@ -136,18 +136,36 @@ led_config_t g_led_config = { void encoder0_pad_cb(void *param) { (void)param; - encoder_insert_state(); + encoder_inerrupt_read(0); } -void keyboard_post_init_kb(void) { +void encoder1_pad_cb(void *param) { + (void)param; + + encoder_inerrupt_read(1); +} + +void encoder_interrupt_init(void) { pin_t encoders_pad_a[NUM_ENCODERS] = ENCODERS_PAD_A; pin_t encoders_pad_b[NUM_ENCODERS] = ENCODERS_PAD_B; for (uint8_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], encoder0_pad_cb, NULL); - palSetLineCallback(encoders_pad_b[i], encoder0_pad_cb, NULL); } + if (NUM_ENCODERS > 0) { + palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL); + palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL); + } + if (NUM_ENCODERS > 1) { + palSetLineCallback(encoders_pad_a[1], encoder1_pad_cb, NULL); + palSetLineCallback(encoders_pad_b[1], encoder1_pad_cb, NULL); + } +} + +void keyboard_post_init_kb(void) { +#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS) + encoder_interrupt_init(); +#endif // allow user keymaps to do custom post_init keyboard_post_init_user(); diff --git a/quantum/encoder.c b/quantum/encoder.c index a6a4542f15..8cd7a45c7a 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c @@ -56,7 +56,7 @@ static int8_t encoder_LUT[] = {0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, static uint8_t encoder_state[NUM_ENCODERS] = {0}; static int8_t encoder_pulses[NUM_ENCODERS] = {0}; -static bool encoder_external_update[NUM_ENCODERS] = {false}; +static bool encoder_interrupt_update[NUM_ENCODERS] = {false}; // encoder counts static uint8_t thisCount; @@ -222,11 +222,11 @@ bool encoder_read(void) { bool changed = false; for (uint8_t i = 0; i < thisCount; i++) { uint8_t new_status = (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1); - if ((encoder_state[i] & 0x3) != new_status || encoder_external_update[i]) { + if ((encoder_state[i] & 0x3) != new_status || encoder_interrupt_update[i]) { encoder_state[i] <<= 2; encoder_state[i] |= new_status; changed |= encoder_update(i, encoder_state[i]); - encoder_external_update[i] = false; + encoder_interrupt_update[i] = false; } } return changed; @@ -271,9 +271,9 @@ void encoder_update_raw(uint8_t *slave_state) { } #endif -void encoder_insert_state(uint8_t index) { +void encoder_inerrupt_read(uint8_t index) { encoder_state[index] <<= 2; encoder_state[index] |= (readPin(encoders_pad_a[index]) << 0) | (readPin(encoders_pad_b[index]) << 1); encoder_pulses[index] += encoder_LUT[encoder_state[index] & 0xF]; - encoder_external_update[index] = true; + encoder_interrupt_update[index] = true; } diff --git a/quantum/encoder.h b/quantum/encoder.h index 54c97c8dc6..fb0fd18aa8 100644 --- a/quantum/encoder.h +++ b/quantum/encoder.h @@ -25,7 +25,7 @@ bool encoder_read(void); bool encoder_update_kb(uint8_t index, bool clockwise); bool encoder_update_user(uint8_t index, bool clockwise); -void encoder_insert_state(uint8_t index); +void encoder_inerrupt_read(uint8_t index); #ifdef SPLIT_KEYBOARD From 38fdb3190242c4eabaf427aaada2926e09d4fd05 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <66767061+lalalademaxiya1@users.noreply.github.com> Date: Wed, 12 Apr 2023 14:54:29 +0800 Subject: [PATCH 03/13] Add q11 iso version --- keyboards/keychron/q11/config.h | 2 +- keyboards/keychron/q11/iso_encoder/config.h | 20 ++ keyboards/keychron/q11/iso_encoder/info.json | 162 ++++++++++++++++ .../keychron/q11/iso_encoder/iso_encoder.c | 182 ++++++++++++++++++ .../q11/iso_encoder/keymaps/default/keymap.c | 71 +++++++ .../q11/iso_encoder/keymaps/default/rules.mk | 1 + .../q11/iso_encoder/keymaps/keychron/keymap.c | 90 +++++++++ .../q11/iso_encoder/keymaps/keychron/rules.mk | 5 + .../q11/iso_encoder/keymaps/via/keymap.c | 72 +++++++ .../q11/iso_encoder/keymaps/via/rules.mk | 2 + keyboards/keychron/q11/iso_encoder/rules.mk | 7 + keyboards/keychron/q11/readme.md | 2 + 12 files changed, 615 insertions(+), 1 deletion(-) create mode 100755 keyboards/keychron/q11/iso_encoder/config.h create mode 100755 keyboards/keychron/q11/iso_encoder/info.json create mode 100755 keyboards/keychron/q11/iso_encoder/iso_encoder.c create mode 100755 keyboards/keychron/q11/iso_encoder/keymaps/default/keymap.c create mode 100755 keyboards/keychron/q11/iso_encoder/keymaps/default/rules.mk create mode 100755 keyboards/keychron/q11/iso_encoder/keymaps/keychron/keymap.c create mode 100755 keyboards/keychron/q11/iso_encoder/keymaps/keychron/rules.mk create mode 100755 keyboards/keychron/q11/iso_encoder/keymaps/via/keymap.c create mode 100755 keyboards/keychron/q11/iso_encoder/keymaps/via/rules.mk create mode 100755 keyboards/keychron/q11/iso_encoder/rules.mk diff --git a/keyboards/keychron/q11/config.h b/keyboards/keychron/q11/config.h index d7de124681..e5ee05fbd9 100755 --- a/keyboards/keychron/q11/config.h +++ b/keyboards/keychron/q11/config.h @@ -36,7 +36,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..7562a47bdc --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/info.json @@ -0,0 +1,162 @@ +{ + "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": [42, 48] + }, + "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..52b8338eab --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/iso_encoder.c @@ -0,0 +1,182 @@ +/* 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}, // NUBS + {0, J_11, L_11, K_11}, // Shift_J + {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, + 1, 1, 4, 4, 4, 4, 4, 4, + 1, 1, 4, 4, 4, 4, 4, + 1, 8, 4, 4, 4, 4, 4, + 1, 1, 4, 4, 4, 4, 4, 4, + 1, 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/q11/iso_encoder/keymaps/default/rules.mk b/keyboards/keychron/q11/iso_encoder/keymaps/default/rules.mk new file mode 100755 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/keychron/q11/iso_encoder/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes 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/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. From 72e2db543eb5b53ff68ed5a28d9ce8257f22d66b Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <66767061+lalalademaxiya1@users.noreply.github.com> Date: Wed, 12 Apr 2023 16:01:05 +0800 Subject: [PATCH 04/13] Update info.json --- keyboards/keychron/q11/iso_encoder/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/keychron/q11/iso_encoder/info.json b/keyboards/keychron/q11/iso_encoder/info.json index 7562a47bdc..7b2bef4bbe 100755 --- a/keyboards/keychron/q11/iso_encoder/info.json +++ b/keyboards/keychron/q11/iso_encoder/info.json @@ -34,7 +34,7 @@ "processor": "STM32L432", "rgb_matrix": { "driver": "CKLED2001", - "split_count": [42, 48] + "split_count": [43, 47] }, "split": { "enabled": true, From bd2e97adad80772c384f0afc805d7a69d13201d2 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Thu, 13 Apr 2023 12:28:26 +0800 Subject: [PATCH 05/13] Update q11 iso version --- keyboards/keychron/q11/iso_encoder/info.json | 5 +++++ .../keychron/q11/iso_encoder/iso_encoder.c | 17 +++++++++-------- keyboards/keychron/q11/q11.c | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/keyboards/keychron/q11/iso_encoder/info.json b/keyboards/keychron/q11/iso_encoder/info.json index 7b2bef4bbe..e6954978ee 100755 --- a/keyboards/keychron/q11/iso_encoder/info.json +++ b/keyboards/keychron/q11/iso_encoder/info.json @@ -81,6 +81,7 @@ {"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 }, @@ -97,6 +98,7 @@ {"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 }, @@ -112,6 +114,7 @@ {"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 }, @@ -128,6 +131,7 @@ {"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 }, @@ -143,6 +147,7 @@ {"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 }, diff --git a/keyboards/keychron/q11/iso_encoder/iso_encoder.c b/keyboards/keychron/q11/iso_encoder/iso_encoder.c index 52b8338eab..8cff7d5555 100755 --- a/keyboards/keychron/q11/iso_encoder/iso_encoder.c +++ b/keyboards/keychron/q11/iso_encoder/iso_encoder.c @@ -60,8 +60,8 @@ const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { {0, J_7, L_7, K_7}, // G {0, J_9, L_9, K_9}, // M4 - {0, J_10, L_10, K_10}, // NUBS - {0, J_11, L_11, K_11}, // Shift_J + {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 @@ -140,10 +140,11 @@ led_config_t g_led_config = { { 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 }, + { 67, 68, 69, 70, 71, 72, __, 73, 75 }, { 76, 77, 78, 79, 80, 81, __, 82, __ }, { __, 83, 84, 85, 86, __, 87, 88, 89 }, }, @@ -165,11 +166,11 @@ led_config_t g_led_config = { { // RGB LED Index to Flag 1, 1, 1, 1, 1, 1, 1, - 1, 1, 4, 4, 4, 4, 4, 4, - 1, 1, 4, 4, 4, 4, 4, - 1, 8, 4, 4, 4, 4, 4, - 1, 1, 4, 4, 4, 4, 4, 4, - 1, 1, 1, 1, 4, 4, + 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, diff --git a/keyboards/keychron/q11/q11.c b/keyboards/keychron/q11/q11.c index b97d6e4b6e..25a01bbd21 100755 --- a/keyboards/keychron/q11/q11.c +++ b/keyboards/keychron/q11/q11.c @@ -25,9 +25,9 @@ const matrix_row_t matrix_mask[] = { 0b011111111, 0b011111111, - 0b011111111, + 0b011011111, 0b001111111, - 0b011111101, + 0b011111111, 0b001011111, 0b111111111, 0b101111111, From 53b3468dbf20338f88a0f627fbd3e489aba49482 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Fri, 21 Apr 2023 10:29:55 +0800 Subject: [PATCH 06/13] Added q9 plus --- keyboards/keychron/q9/readme.md | 4 +- .../q9_plus/ansi_encoder/ansi_encoder.c | 112 ++++++++++++++++++ .../keychron/q9_plus/ansi_encoder/config.h | 27 +++++ .../keychron/q9_plus/ansi_encoder/info.json | 100 ++++++++++++++++ .../ansi_encoder/keymaps/default/keymap.c | 72 +++++++++++ .../ansi_encoder/keymaps/default/rules.mk | 1 + .../ansi_encoder/keymaps/keychron/config.h | 17 +++ .../ansi_encoder/keymaps/keychron/keymap.c | 90 ++++++++++++++ .../ansi_encoder/keymaps/keychron/rules.mk | 5 + .../q9_plus/ansi_encoder/keymaps/via/config.h | 17 +++ .../q9_plus/ansi_encoder/keymaps/via/keymap.c | 72 +++++++++++ .../q9_plus/ansi_encoder/keymaps/via/rules.mk | 2 + .../keychron/q9_plus/ansi_encoder/rules.mk | 8 ++ keyboards/keychron/q9_plus/config.h | 102 ++++++++++++++++ keyboards/keychron/q9_plus/halconf.h | 24 ++++ keyboards/keychron/q9_plus/mcuconf.h | 22 ++++ keyboards/keychron/q9_plus/q9_plus.c | 45 +++++++ keyboards/keychron/q9_plus/readme.md | 21 ++++ 18 files changed, 739 insertions(+), 2 deletions(-) create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/ansi_encoder.c create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/config.h create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/info.json create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/rules.mk create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/config.h create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/rules.mk create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/config.h create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/rules.mk create mode 100644 keyboards/keychron/q9_plus/ansi_encoder/rules.mk create mode 100644 keyboards/keychron/q9_plus/config.h create mode 100644 keyboards/keychron/q9_plus/halconf.h create mode 100644 keyboards/keychron/q9_plus/mcuconf.h create mode 100644 keyboards/keychron/q9_plus/q9_plus.c create mode 100644 keyboards/keychron/q9_plus/readme.md 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..4175e9be2b --- /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, 1, + 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..34dab32f2f --- /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 15 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..e3be0ac60f --- /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": false, + "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..3d459862bd --- /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_ansi_52( + 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, KC_SPC, KC_RCMD, MO(MAC_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_ansi_52( + 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, 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, + 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_ansi_52( + 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_ansi_52( + 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..54bbaf673f --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/config.h @@ -0,0 +1,17 @@ +/* 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 . + */ + +#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..a9bfa25aff --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_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, + WIN_BASE, + MAC_FN1, + WIN_FN1, + _FN2 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_52( + 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, KC_SPC, KC_RCMMD, MO(MAC_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_ansi_52( + 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, 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_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_ansi_52( + 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, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [_FN3] = LAYOUT_ansi_52( + 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..54bbaf673f --- /dev/null +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/config.h @@ -0,0 +1,17 @@ +/* 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 . + */ + +#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..3d459862bd --- /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_ansi_52( + 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, KC_SPC, KC_RCMD, MO(MAC_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_BASE] = LAYOUT_ansi_52( + 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, 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, + 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_ansi_52( + 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_ansi_52( + 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..a7be02c0b2 --- /dev/null +++ b/keyboards/keychron/q9_plus/q9_plus.c @@ -0,0 +1,45 @@ +/* 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 + +#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_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). From d6b4ba561c568624dfd6253dceb49a553ec87351 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <66767061+lalalademaxiya1@users.noreply.github.com> Date: Fri, 21 Apr 2023 11:29:21 +0800 Subject: [PATCH 07/13] Update q9 plus --- .../q6/iso_encoder/keymaps/default/keymap.c | 2 +- .../q6/iso_encoder/keymaps/via/keymap.c | 2 +- .../q65/ansi_encoder/keymaps/default/keymap.c | 2 +- .../keychron/q7/iso/keymaps/default/keymap.c | 2 +- .../keychron/q7/iso/keymaps/via/keymap.c | 2 +- .../keychron/q9/ansi/keymaps/default/keymap.c | 2 +- .../keychron/q9/ansi/keymaps/via/keymap.c | 2 +- .../q9/ansi_encoder/keymaps/default/keymap.c | 2 +- .../q9/ansi_encoder/keymaps/via/keymap.c | 2 +- .../ansi_encoder/keymaps/default/keymap.c | 54 +++++++++--------- .../ansi_encoder/keymaps/keychron/config.h | 2 +- .../ansi_encoder/keymaps/keychron/keymap.c | 56 +++++++++---------- .../q9_plus/ansi_encoder/keymaps/via/config.h | 2 +- .../q9_plus/ansi_encoder/keymaps/via/keymap.c | 54 +++++++++--------- .../keychron/s1/ansi/rgb/keymaps/via/keymap.c | 2 +- .../s1/ansi/white/keymaps/default/keymap.c | 2 +- .../s1/ansi/white/keymaps/via/keymap.c | 2 +- 17 files changed, 96 insertions(+), 96 deletions(-) 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/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/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/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_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_plus/ansi_encoder/keymaps/default/keymap.c b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c index 3d459862bd..b8ea1a01dd 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c @@ -23,42 +23,42 @@ enum layers{ WIN_BASE, MAC_FN1, WIN_FN1, - _FN2 + 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_ansi_52( - 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, KC_SPC, KC_RCMD, MO(MAC_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), + [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_ansi_52( - 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, KC_SPC, KC_RALT, MO(WIN_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_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, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + [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_ansi_52( - 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, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + [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_ansi_52( - 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, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + [_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) @@ -67,6 +67,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { [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(_______, _______)} + [FN2] = {ENCODER_CCW_CW(_______, _______)} }; #endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/config.h b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/config.h index 54bbaf673f..76cdab7392 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/config.h +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/config.h @@ -1,4 +1,4 @@ -/* Copyright 2022 @ Keychron (https://www.keychron.com) +/* 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 diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c index a9bfa25aff..e420a75351 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2022 @ Keychron (https://www.keychron.com) +/* 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 @@ -25,39 +25,39 @@ enum layers{ WIN_BASE, MAC_FN1, WIN_FN1, - _FN2 + FN2 }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [MAC_BASE] = LAYOUT_ansi_52( - 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, KC_SPC, KC_RCMMD, MO(MAC_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), + [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_ansi_52( - 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, KC_SPC, KC_RALT, MO(WIN_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_ansi_52( - 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, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + [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_ansi_52( - 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, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + [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, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - [_FN3] = LAYOUT_ansi_52( - 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, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + [_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) @@ -66,7 +66,7 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { [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(_______, _______)} + [FN2] = {ENCODER_CCW_CW(_______, _______)} }; #endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/config.h b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/config.h index 54bbaf673f..76cdab7392 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/config.h +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/config.h @@ -1,4 +1,4 @@ -/* Copyright 2022 @ Keychron (https://www.keychron.com) +/* 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 diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c index 3d459862bd..b8ea1a01dd 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c @@ -23,42 +23,42 @@ enum layers{ WIN_BASE, MAC_FN1, WIN_FN1, - _FN2 + 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_ansi_52( - 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, KC_SPC, KC_RCMD, MO(MAC_FN1), MO(_FN2), KC_LEFT, KC_DOWN, KC_RGHT), + [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_ansi_52( - 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, KC_SPC, KC_RALT, MO(WIN_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_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, - RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + [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_ansi_52( - 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, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + [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_ansi_52( - 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, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + [_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) @@ -67,6 +67,6 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { [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(_______, _______)} + [FN2] = {ENCODER_CCW_CW(_______, _______)} }; #endif // ENCODER_MAP_ENABLE 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/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, From 238263b8173a8f31e8598af357586fb4703b6584 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <66767061+lalalademaxiya1@users.noreply.github.com> Date: Fri, 21 Apr 2023 12:07:44 +0800 Subject: [PATCH 08/13] Update Q9 Plus --- keyboards/keychron/q9/ansi_encoder/info.json | 2 +- keyboards/keychron/q9_plus/ansi_encoder/ansi_encoder.c | 2 +- keyboards/keychron/q9_plus/ansi_encoder/config.h | 2 +- keyboards/keychron/q9_plus/ansi_encoder/info.json | 2 +- .../keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c | 6 +++--- .../keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c | 6 +++--- .../keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c | 6 +++--- keyboards/keychron/q9_plus/q9_plus.c | 1 + 8 files changed, 14 insertions(+), 13 deletions(-) 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_plus/ansi_encoder/ansi_encoder.c b/keyboards/keychron/q9_plus/ansi_encoder/ansi_encoder.c index 4175e9be2b..7ff63fd889 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/ansi_encoder.c +++ b/keyboards/keychron/q9_plus/ansi_encoder/ansi_encoder.c @@ -103,7 +103,7 @@ led_config_t g_led_config = { }, { // RGB LED Index to Flag - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 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, diff --git a/keyboards/keychron/q9_plus/ansi_encoder/config.h b/keyboards/keychron/q9_plus/ansi_encoder/config.h index 34dab32f2f..e88f3d8252 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/config.h +++ b/keyboards/keychron/q9_plus/ansi_encoder/config.h @@ -24,4 +24,4 @@ #define ENCODER_DEFAULT_POS 0x3 /* Enable caps-lock LED */ -#define CAPS_LOCK_LED_INDEX 15 +#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 index e3be0ac60f..21bc9be2f2 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/info.json +++ b/keyboards/keychron/q9_plus/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_plus/ansi_encoder/keymaps/default/keymap.c b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c index b8ea1a01dd..abeafa4922 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/default/keymap.c @@ -34,13 +34,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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), + 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), + 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, @@ -54,7 +54,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - [_FN2] = LAYOUT( + [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, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c index e420a75351..c8a4f2e272 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/keychron/keymap.c @@ -33,13 +33,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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), + 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), + 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, @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - [_FN2] = LAYOUT( + [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, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c index b8ea1a01dd..abeafa4922 100644 --- a/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c +++ b/keyboards/keychron/q9_plus/ansi_encoder/keymaps/via/keymap.c @@ -34,13 +34,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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), + 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), + 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, @@ -54,7 +54,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - [_FN2] = LAYOUT( + [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, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/keychron/q9_plus/q9_plus.c b/keyboards/keychron/q9_plus/q9_plus.c index a7be02c0b2..339f5639d8 100644 --- a/keyboards/keychron/q9_plus/q9_plus.c +++ b/keyboards/keychron/q9_plus/q9_plus.c @@ -15,6 +15,7 @@ */ #include "quantum.h" +#include "keychron_common.h" const matrix_row_t matrix_mask[] = { 0b111111111111111, From 4e97b06ddee1efb718f985e366dffa6de607a95d Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Sat, 22 Apr 2023 12:31:45 +0800 Subject: [PATCH 09/13] Update keychron_common.c --- keyboards/keychron/common/keychron_common.c | 24 +------------------ .../keychron/common/keychron_ft_common.c | 5 ++++ keyboards/keychron/q1/q1.c | 12 ---------- 3 files changed, 6 insertions(+), 35 deletions(-) diff --git a/keyboards/keychron/common/keychron_common.c b/keyboards/keychron/common/keychron_common.c index 424dbed617..1d16514708 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) { +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/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 From d9a0827a466f2625d81b41c8a6ad878dbadaee4a Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Sat, 22 Apr 2023 14:59:08 +0800 Subject: [PATCH 10/13] Move encoder interrupt into common file --- keyboards/keychron/c1/ansi/rgb/rules.mk | 2 ++ keyboards/keychron/c1/ansi/white/rules.mk | 2 ++ keyboards/keychron/c2/ansi/rgb/rules.mk | 2 ++ keyboards/keychron/c2/ansi/white/rules.mk | 2 ++ keyboards/keychron/common/matrix.c | 6 +++--- keyboards/keychron/q0/q0.c | 12 ------------ keyboards/keychron/q0/rev_0130/rules.mk | 2 ++ keyboards/keychron/q0/rev_0131/rules.mk | 2 ++ keyboards/keychron/q1/ansi_stm32l432/rules.mk | 2 ++ .../q1/ansi_stm32l432_encoder/rules.mk | 2 ++ keyboards/keychron/q1/iso_stm32l432/rules.mk | 2 ++ .../keychron/q1/iso_stm32l432_encoder/rules.mk | 2 ++ keyboards/keychron/q1/jis_stm32l432/rules.mk | 2 ++ .../keychron/q1/jis_stm32l432_encoder/rules.mk | 2 ++ keyboards/keychron/q10/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/q10/iso_encoder/rules.mk | 2 ++ keyboards/keychron/q10/q10.c | 11 ----------- keyboards/keychron/q11/config.h | 3 +-- keyboards/keychron/q11/q11.c | 18 +++++++++++++++--- keyboards/keychron/q12/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/q12/iso_encoder/rules.mk | 2 ++ keyboards/keychron/q12/q12.c | 11 ----------- keyboards/keychron/q2/ansi/rules.mk | 2 ++ keyboards/keychron/q2/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/q2/iso/rules.mk | 2 ++ keyboards/keychron/q2/iso_encoder/rules.mk | 2 ++ keyboards/keychron/q2/jis/rules.mk | 2 ++ keyboards/keychron/q2/jis_encoder/rules.mk | 2 ++ keyboards/keychron/q2/q2.c | 12 ------------ keyboards/keychron/q3/ansi/rules.mk | 2 ++ keyboards/keychron/q3/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/q3/iso/rules.mk | 2 ++ keyboards/keychron/q3/iso_encoder/rules.mk | 2 ++ keyboards/keychron/q3/jis/rules.mk | 2 ++ keyboards/keychron/q3/jis_encoder/rules.mk | 2 ++ keyboards/keychron/q3/q3.c | 12 ------------ keyboards/keychron/q4/ansi_v1/rules.mk | 2 ++ keyboards/keychron/q4/ansi_v2/rules.mk | 2 ++ keyboards/keychron/q4/iso/rules.mk | 2 ++ keyboards/keychron/q5/ansi/rules.mk | 2 ++ keyboards/keychron/q5/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/q5/iso/rules.mk | 2 ++ keyboards/keychron/q5/iso_encoder/rules.mk | 2 ++ keyboards/keychron/q5/q5.c | 11 ----------- keyboards/keychron/q6/ansi/rules.mk | 2 ++ keyboards/keychron/q6/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/q6/iso/rules.mk | 2 ++ keyboards/keychron/q6/iso_encoder/rules.mk | 2 ++ keyboards/keychron/q6/q6.c | 11 ----------- keyboards/keychron/q60/ansi/rules.mk | 2 ++ keyboards/keychron/q65/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/q65/q65.c | 11 ----------- keyboards/keychron/q7/ansi/rules.mk | 2 ++ keyboards/keychron/q7/iso/rules.mk | 2 ++ keyboards/keychron/q8/ansi/rules.mk | 2 ++ keyboards/keychron/q8/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/q8/iso/rules.mk | 2 ++ keyboards/keychron/q8/iso_encoder/rules.mk | 2 ++ keyboards/keychron/q8/q8.c | 11 ----------- keyboards/keychron/q9/ansi/rules.mk | 2 ++ keyboards/keychron/q9/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/q9/iso/rules.mk | 2 ++ keyboards/keychron/q9/iso_encoder/rules.mk | 2 ++ keyboards/keychron/q9/q9.c | 11 ----------- keyboards/keychron/q9_plus/q9_plus.c | 11 ----------- keyboards/keychron/s1/ansi/rgb/rules.mk | 2 ++ keyboards/keychron/s1/ansi/white/rules.mk | 2 ++ keyboards/keychron/v1/ansi/rules.mk | 2 ++ keyboards/keychron/v1/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/v1/iso/rules.mk | 2 ++ keyboards/keychron/v1/iso_encoder/rules.mk | 2 ++ keyboards/keychron/v1/jis/rules.mk | 2 ++ keyboards/keychron/v1/jis_encoder/rules.mk | 2 ++ keyboards/keychron/v1/v1.c | 11 ----------- keyboards/keychron/v10/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/v10/iso_encoder/rules.mk | 2 ++ keyboards/keychron/v10/v10.c | 11 ----------- keyboards/keychron/v2/ansi/rules.mk | 2 ++ keyboards/keychron/v2/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/v2/iso/rules.mk | 2 ++ keyboards/keychron/v2/iso_encoder/rules.mk | 2 ++ keyboards/keychron/v2/jis/rules.mk | 2 ++ keyboards/keychron/v2/jis_encoder/rules.mk | 2 ++ keyboards/keychron/v2/v2.c | 11 ----------- keyboards/keychron/v3/ansi/rules.mk | 2 ++ keyboards/keychron/v3/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/v3/iso/rules.mk | 2 ++ keyboards/keychron/v3/iso_encoder/rules.mk | 2 ++ keyboards/keychron/v3/jis/rules.mk | 2 ++ keyboards/keychron/v3/jis_encoder/rules.mk | 2 ++ keyboards/keychron/v3/v3.c | 11 ----------- keyboards/keychron/v4/ansi/rules.mk | 2 ++ keyboards/keychron/v4/iso/rules.mk | 2 ++ keyboards/keychron/v5/ansi/rules.mk | 2 ++ keyboards/keychron/v5/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/v5/iso/rules.mk | 2 ++ keyboards/keychron/v5/iso_encoder/rules.mk | 2 ++ keyboards/keychron/v5/v5.c | 11 ----------- keyboards/keychron/v6/ansi/rules.mk | 2 ++ keyboards/keychron/v6/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/v6/iso/rules.mk | 2 ++ keyboards/keychron/v6/iso_encoder/rules.mk | 2 ++ keyboards/keychron/v6/jis_encoder/rules.mk | 2 ++ keyboards/keychron/v6/v6.c | 11 ----------- keyboards/keychron/v7/ansi/rules.mk | 2 ++ keyboards/keychron/v7/iso/rules.mk | 2 ++ keyboards/keychron/v8/ansi/rules.mk | 2 ++ keyboards/keychron/v8/ansi_encoder/rules.mk | 2 ++ keyboards/keychron/v8/iso/rules.mk | 2 ++ keyboards/keychron/v8/iso_encoder/rules.mk | 2 ++ keyboards/keychron/v8/v8.c | 11 ----------- 111 files changed, 199 insertions(+), 209 deletions(-) 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/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/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/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/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_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/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/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/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/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/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/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/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 2e26f8605e..66c66afd86 100644 --- a/keyboards/keychron/q10/q10.c +++ b/keyboards/keychron/q10/q10.c @@ -36,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 e5ee05fbd9..8ab51727eb 100755 --- a/keyboards/keychron/q11/config.h +++ b/keyboards/keychron/q11/config.h @@ -20,8 +20,7 @@ #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 diff --git a/keyboards/keychron/q11/q11.c b/keyboards/keychron/q11/q11.c index 25a01bbd21..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 @@ -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/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/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 47efe941dd..c13cd641e9 100644 --- a/keyboards/keychron/q12/q12.c +++ b/keyboards/keychron/q12/q12.c @@ -37,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/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/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/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/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/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/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/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 80d900ba69..883f7c573b 100644 --- a/keyboards/keychron/q5/q5.c +++ b/keyboards/keychron/q5/q5.c @@ -36,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/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/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 a703f77fea..9a02067c7d 100644 --- a/keyboards/keychron/q6/q6.c +++ b/keyboards/keychron/q6/q6.c @@ -36,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/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/q65.c b/keyboards/keychron/q65/q65.c index 64b9b14257..0cb6a646a5 100644 --- a/keyboards/keychron/q65/q65.c +++ b/keyboards/keychron/q65/q65.c @@ -33,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/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/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 f2a6f645db..e903b1f70a 100644 --- a/keyboards/keychron/q8/q8.c +++ b/keyboards/keychron/q8/q8.c @@ -33,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/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/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/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 45d724c528..a1ebd1ddb2 100644 --- a/keyboards/keychron/q9/q9.c +++ b/keyboards/keychron/q9/q9.c @@ -32,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_plus/q9_plus.c b/keyboards/keychron/q9_plus/q9_plus.c index a7be02c0b2..1c742a26ad 100644 --- a/keyboards/keychron/q9_plus/q9_plus.c +++ b/keyboards/keychron/q9_plus/q9_plus.c @@ -32,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/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/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/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/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 0a32a6181f..374a80e09a 100644 --- a/keyboards/keychron/v1/v1.c +++ b/keyboards/keychron/v1/v1.c @@ -36,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/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/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 2e26f8605e..66c66afd86 100644 --- a/keyboards/keychron/v10/v10.c +++ b/keyboards/keychron/v10/v10.c @@ -36,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/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 f2a6f645db..e903b1f70a 100644 --- a/keyboards/keychron/v2/v2.c +++ b/keyboards/keychron/v2/v2.c @@ -33,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/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 e9e3b837eb..2d9d7921f0 100644 --- a/keyboards/keychron/v3/v3.c +++ b/keyboards/keychron/v3/v3.c @@ -44,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/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/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 80d900ba69..883f7c573b 100644 --- a/keyboards/keychron/v5/v5.c +++ b/keyboards/keychron/v5/v5.c @@ -36,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/iso/rules.mk b/keyboards/keychron/v6/iso/rules.mk index 2aa5535093..b643065648 100644 --- a/keyboards/keychron/v6/iso/rules.mk +++ b/keyboards/keychron/v6/iso/rules.mk @@ -1,4 +1,6 @@ # Build Options +# change yes to no to disable. +# RGB_MATRIX_DRIVER = CKLED2001 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 a8272c9708..eeabe98007 100644 --- a/keyboards/keychron/v6/v6.c +++ b/keyboards/keychron/v6/v6.c @@ -41,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/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/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 b7518a60af..1c2f36f199 100644 --- a/keyboards/keychron/v8/v8.c +++ b/keyboards/keychron/v8/v8.c @@ -33,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 From eae897fee1580a6d3398708ec7708988fd3cb8c8 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Sat, 22 Apr 2023 15:23:33 +0800 Subject: [PATCH 11/13] Delete Debounce delay which is 5 in default --- keyboards/keychron/c2/config.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/keyboards/keychron/c2/config.h b/keyboards/keychron/c2/config.h index 2d30aae8e8..4ab73090a8 100644 --- a/keyboards/keychron/c2/config.h +++ b/keyboards/keychron/c2/config.h @@ -16,9 +16,6 @@ #pragma once -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - /* DIP switch */ #define DIP_SWITCH_MATRIX_GRID { { 5, 4 } } #define SCAN_COUNT_MAX 100 From 8770893f95a4d97ab4c63918959d32e74c83cb7b Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Sat, 22 Apr 2023 16:29:01 +0800 Subject: [PATCH 12/13] Update q2 --- keyboards/keychron/common/keychron_common.c | 2 +- keyboards/keychron/q2/ansi_encoder/info.json | 2 +- keyboards/keychron/q2/iso_encoder/info.json | 2 +- keyboards/keychron/q2/jis_encoder/info.json | 3 ++- .../keychron/q2/jis_encoder/keymaps/default/rules.mk | 1 - .../q2/jis_encoder/keymaps/keychron/keymap.c | 12 +++++++++--- .../q2/jis_encoder/keymaps/keychron/rules.mk | 1 - .../keychron/q2/jis_encoder/keymaps/via/rules.mk | 1 - keyboards/keychron/v6/iso/rules.mk | 1 - 9 files changed, 14 insertions(+), 11 deletions(-) delete mode 100644 keyboards/keychron/q2/jis_encoder/keymaps/default/rules.mk diff --git a/keyboards/keychron/common/keychron_common.c b/keyboards/keychron/common/keychron_common.c index 1d16514708..e9cff63011 100644 --- a/keyboards/keychron/common/keychron_common.c +++ b/keyboards/keychron/common/keychron_common.c @@ -194,7 +194,7 @@ static void encoder_pad_cb(void *param) { encoder_inerrupt_read((uint32_t)param & 0XFF); } -void keyboard_post_init_kb(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/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/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/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/default/rules.mk b/keyboards/keychron/q2/jis_encoder/keymaps/default/rules.mk deleted file mode 100644 index ee32568148..0000000000 --- a/keyboards/keychron/q2/jis_encoder/keymaps/default/rules.mk +++ /dev/null @@ -1 +0,0 @@ -ENCODER_MAP_ENABLE = yes 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/v6/iso/rules.mk b/keyboards/keychron/v6/iso/rules.mk index b643065648..aa286a1616 100644 --- a/keyboards/keychron/v6/iso/rules.mk +++ b/keyboards/keychron/v6/iso/rules.mk @@ -1,7 +1,6 @@ # Build Options # change yes to no to disable. # -RGB_MATRIX_DRIVER = CKLED2001 EEPROM_DRIVER = wear_leveling WEAR_LEVELING_DRIVER = embedded_flash From 30a36aec8c9fb0a8c76c0b5d9270a52ae2432c3c Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <66767061+lalalademaxiya1@users.noreply.github.com> Date: Sat, 22 Apr 2023 16:49:49 +0800 Subject: [PATCH 13/13] Update q0 plus encoder used pin --- keyboards/keychron/q0/rev_0131/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": {