From 940411d2cb1702e2b3cb5e0e563d328da1005029 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Tue, 15 Aug 2023 11:50:34 +0800 Subject: [PATCH 1/5] Add pad interrupt of k11 pro knob version --- keyboards/keychron/k11_pro/k11_pro.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboards/keychron/k11_pro/k11_pro.c b/keyboards/keychron/k11_pro/k11_pro.c index 9189ef8586..3c02df0c4f 100755 --- a/keyboards/keychron/k11_pro/k11_pro.c +++ b/keyboards/keychron/k11_pro/k11_pro.c @@ -135,8 +135,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return true; } -#if defined(KC_BLUETOOTH_ENABLE) && defined(ENCODER_ENBALE) -static void encoder0_pad_cb(void *param) { +#if defined(KC_BLUETOOTH_ENABLE) && defined(ENCODER_ENABLE) +static void encoder_pad_cb(void *param) { encoder_inerrupt_read((uint32_t)param & 0xFF); } #endif @@ -157,16 +157,16 @@ void keyboard_post_init_kb(void) { ckbt51_init(false); bluetooth_init(); -#endif -#ifdef ENCODER_ENBALE +# ifdef ENCODER_ENABLE 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++) { + 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, &i); - palSetLineCallback(encoders_pad_b[i], encoder_pad_cb, &i); + palSetLineCallback(encoders_pad_a[i], encoder_pad_cb, (void *)i); + palSetLineCallback(encoders_pad_b[i], encoder_pad_cb, (void *)i); } +# endif #endif power_on_indicator_timer_buffer = sync_timer_read32() | 1; From 49a82abb206b347d7c3cddcf29baf6f873e18429 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Tue, 15 Aug 2023 15:49:24 +0800 Subject: [PATCH 2/5] Update k1 pro iso version --- keyboards/keychron/k1_pro/iso/rgb/info.json | 2 +- keyboards/keychron/k1_pro/iso/white/info.json | 2 +- keyboards/keychron/k1_pro/k1_pro.c | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/keyboards/keychron/k1_pro/iso/rgb/info.json b/keyboards/keychron/k1_pro/iso/rgb/info.json index f25288fc2b..528089dc74 100755 --- a/keyboards/keychron/k1_pro/iso/rgb/info.json +++ b/keyboards/keychron/k1_pro/iso/rgb/info.json @@ -1,7 +1,7 @@ { "usb": { "pid": "0x0211", - "device_version": "1.0.1" + "device_version": "1.0.2" }, "features": { "rgb_matrix": true diff --git a/keyboards/keychron/k1_pro/iso/white/info.json b/keyboards/keychron/k1_pro/iso/white/info.json index 73a5808e6b..d04fde6f9b 100755 --- a/keyboards/keychron/k1_pro/iso/white/info.json +++ b/keyboards/keychron/k1_pro/iso/white/info.json @@ -1,7 +1,7 @@ { "usb": { "pid": "0x0214", - "device_version": "1.0.0" + "device_version": "1.0.1" }, "features": { "led_matrix": true diff --git a/keyboards/keychron/k1_pro/k1_pro.c b/keyboards/keychron/k1_pro/k1_pro.c index fede3e5b0b..e67642cb3a 100644 --- a/keyboards/keychron/k1_pro/k1_pro.c +++ b/keyboards/keychron/k1_pro/k1_pro.c @@ -317,3 +317,9 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { } } #endif + +void suspend_wakeup_init_kb(void) { + // code will run on keyboard wakeup + clear_keyboard(); + send_keyboard_report(); +} From d044197f7658abde287c51a5112e97c7a4406cea Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Tue, 15 Aug 2023 17:41:53 +0800 Subject: [PATCH 3/5] Update q8 pro --- keyboards/keychron/q8_pro/ansi_encoder/config.h | 2 ++ .../keychron/q8_pro/ansi_encoder/keymaps/default/rules.mk | 1 - .../keychron/q8_pro/ansi_encoder/keymaps/via/rules.mk | 1 - keyboards/keychron/q8_pro/info.json | 3 +++ keyboards/keychron/q8_pro/iso_encoder/config.h | 2 ++ .../keychron/q8_pro/iso_encoder/keymaps/via/rules.mk | 1 - keyboards/keychron/q8_pro/q8_pro.c | 8 +++++++- keyboards/keychron/q8_pro/readme.md | 4 ++-- 8 files changed, 16 insertions(+), 6 deletions(-) diff --git a/keyboards/keychron/q8_pro/ansi_encoder/config.h b/keyboards/keychron/q8_pro/ansi_encoder/config.h index 98446227c4..5efaf6b5ee 100755 --- a/keyboards/keychron/q8_pro/ansi_encoder/config.h +++ b/keyboards/keychron/q8_pro/ansi_encoder/config.h @@ -21,6 +21,8 @@ # define DRIVER_COUNT 2 # define DRIVER_ADDR_1 0b1110111 # define DRIVER_ADDR_2 0b1110100 + +/* RGB Matrix Configuration */ # define DRIVER_1_LED_TOTAL 29 # define DRIVER_2_LED_TOTAL 39 # define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) diff --git a/keyboards/keychron/q8_pro/ansi_encoder/keymaps/default/rules.mk b/keyboards/keychron/q8_pro/ansi_encoder/keymaps/default/rules.mk index 2408ee532a..ee32568148 100644 --- a/keyboards/keychron/q8_pro/ansi_encoder/keymaps/default/rules.mk +++ b/keyboards/keychron/q8_pro/ansi_encoder/keymaps/default/rules.mk @@ -1,2 +1 @@ ENCODER_MAP_ENABLE = yes -OPT_DEFS += -DDYNAMIC_KEYMAP_LAYER_COUNT=5 diff --git a/keyboards/keychron/q8_pro/ansi_encoder/keymaps/via/rules.mk b/keyboards/keychron/q8_pro/ansi_encoder/keymaps/via/rules.mk index b8562c8f4e..f1adcab005 100644 --- a/keyboards/keychron/q8_pro/ansi_encoder/keymaps/via/rules.mk +++ b/keyboards/keychron/q8_pro/ansi_encoder/keymaps/via/rules.mk @@ -1,3 +1,2 @@ VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes -OPT_DEFS += -DDYNAMIC_KEYMAP_LAYER_COUNT=5 diff --git a/keyboards/keychron/q8_pro/info.json b/keyboards/keychron/q8_pro/info.json index 64754e2ac4..827e0c9352 100755 --- a/keyboards/keychron/q8_pro/info.json +++ b/keyboards/keychron/q8_pro/info.json @@ -57,5 +57,8 @@ "rotary": [ {"pin_a": "A0", "pin_b": "A10"} ] + }, + "dynamic_keymap": { + "layer_count": 5 } } diff --git a/keyboards/keychron/q8_pro/iso_encoder/config.h b/keyboards/keychron/q8_pro/iso_encoder/config.h index 1f3e014278..4e80c93740 100755 --- a/keyboards/keychron/q8_pro/iso_encoder/config.h +++ b/keyboards/keychron/q8_pro/iso_encoder/config.h @@ -21,6 +21,8 @@ # define DRIVER_COUNT 2 # define DRIVER_ADDR_1 0b1110111 # define DRIVER_ADDR_2 0b1110100 + +/* RGB Matrix Configuration */ # define DRIVER_1_LED_TOTAL 29 # define DRIVER_2_LED_TOTAL 40 # define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) diff --git a/keyboards/keychron/q8_pro/iso_encoder/keymaps/via/rules.mk b/keyboards/keychron/q8_pro/iso_encoder/keymaps/via/rules.mk index b8562c8f4e..f1adcab005 100755 --- a/keyboards/keychron/q8_pro/iso_encoder/keymaps/via/rules.mk +++ b/keyboards/keychron/q8_pro/iso_encoder/keymaps/via/rules.mk @@ -1,3 +1,2 @@ VIA_ENABLE = yes ENCODER_MAP_ENABLE = yes -OPT_DEFS += -DDYNAMIC_KEYMAP_LAYER_COUNT=5 diff --git a/keyboards/keychron/q8_pro/q8_pro.c b/keyboards/keychron/q8_pro/q8_pro.c index eade1dce33..14bb965a82 100755 --- a/keyboards/keychron/q8_pro/q8_pro.c +++ b/keyboards/keychron/q8_pro/q8_pro.c @@ -136,7 +136,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { #if defined(KC_BLUETOOTH_ENABLE) && defined(ENCODER_ENABLE) static void encoder_pad_cb(void *param) { - encoder_inerrupt_read((uint32_t)param & 0XFF); + encoder_inerrupt_read((uint32_t)param & 0xFF); } #endif @@ -312,3 +312,9 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { } } #endif + +void suspend_wakeup_init_kb(void) { + // code will run on keyboard wakeup + clear_keyboard(); + send_keyboard_report(); +} diff --git a/keyboards/keychron/q8_pro/readme.md b/keyboards/keychron/q8_pro/readme.md index 62631503d5..6a3ed73d34 100755 --- a/keyboards/keychron/q8_pro/readme.md +++ b/keyboards/keychron/q8_pro/readme.md @@ -1,12 +1,12 @@ # Keychron Q8 Pro -![Keychron Q8 Pro] +![Keychron Q8 Pro](https://i.imgur.com/dZBGbrs.jpg) A customizable 65% Alice keyboard. * Keyboard Maintainer: [Keychron](https://github.com/keychron) * Hardware Supported: Keychron Q8 Pro -* Hardware Availability: +* Hardware Availability:[Keychron Q8 Pro (Alice Layout) QMK/VIA Wireless Custom Mechanical Keyboard](https://www.keychron.com/products/keychron-q8-pro-alice-layout-qmk-via-wireless-custom-mechanical-keyboard) Make example for this keyboard (after setting up your build environment): From 6e229860d74887e25cb19f1ea4c64b126195dd64 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Tue, 15 Aug 2023 17:49:41 +0800 Subject: [PATCH 4/5] Update json of q8 pro ansi version --- keyboards/keychron/q8_pro/via_json/q8_pro_ansi_encoder.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/keychron/q8_pro/via_json/q8_pro_ansi_encoder.json b/keyboards/keychron/q8_pro/via_json/q8_pro_ansi_encoder.json index 68ecbe6f3d..148c8e1d3d 100644 --- a/keyboards/keychron/q8_pro/via_json/q8_pro_ansi_encoder.json +++ b/keyboards/keychron/q8_pro/via_json/q8_pro_ansi_encoder.json @@ -137,15 +137,15 @@ "1,11", "1,12", { - "w": 1.5 + "w": 1.5, + "c": "#aaaaaa" }, "1,13" ], [ { "y": -0.9, - "x": 17.3, - "c": "#aaaaaa" + "x": 17.3 }, "1,14" ], From 031f5132817f56f3c874be396815b3999349f8a2 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Mon, 28 Aug 2023 10:11:32 +0800 Subject: [PATCH 5/5] Update q8 pro and k11 pro --- keyboards/keychron/k11_pro/k11_pro.c | 6 +++--- keyboards/keychron/q8_pro/halconf.h | 5 ++++- keyboards/keychron/q8_pro/q8_pro.c | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/keyboards/keychron/k11_pro/k11_pro.c b/keyboards/keychron/k11_pro/k11_pro.c index 3c02df0c4f..6ad7649bab 100755 --- a/keyboards/keychron/k11_pro/k11_pro.c +++ b/keyboards/keychron/k11_pro/k11_pro.c @@ -135,7 +135,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return true; } -#if defined(KC_BLUETOOTH_ENABLE) && defined(ENCODER_ENABLE) +#if defined(ENCODER_ENABLE) static void encoder_pad_cb(void *param) { encoder_inerrupt_read((uint32_t)param & 0xFF); } @@ -156,8 +156,9 @@ void keyboard_post_init_kb(void) { ckbt51_init(false); bluetooth_init(); +#endif -# ifdef ENCODER_ENABLE +#ifdef ENCODER_ENABLE 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++) { @@ -166,7 +167,6 @@ void keyboard_post_init_kb(void) { palSetLineCallback(encoders_pad_a[i], encoder_pad_cb, (void *)i); palSetLineCallback(encoders_pad_b[i], encoder_pad_cb, (void *)i); } -# endif #endif power_on_indicator_timer_buffer = sync_timer_read32() | 1; diff --git a/keyboards/keychron/q8_pro/halconf.h b/keyboards/keychron/q8_pro/halconf.h index 8d8e138e4e..35209171cc 100755 --- a/keyboards/keychron/q8_pro/halconf.h +++ b/keyboards/keychron/q8_pro/halconf.h @@ -20,8 +20,11 @@ #define HAL_USE_I2C TRUE -#ifdef KC_BLUETOOTH_ENABLE +#if defined(ENCODER_ENBALE) || defined(KC_BLUETOOTH_ENABLE) # define PAL_USE_CALLBACKS TRUE +#endif + +#ifdef KC_BLUETOOTH_ENABLE # define HAL_USE_SERIAL TRUE # define HAL_USE_RTC TRUE #endif diff --git a/keyboards/keychron/q8_pro/q8_pro.c b/keyboards/keychron/q8_pro/q8_pro.c index 14bb965a82..aa0426149a 100755 --- a/keyboards/keychron/q8_pro/q8_pro.c +++ b/keyboards/keychron/q8_pro/q8_pro.c @@ -134,7 +134,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return true; } -#if defined(KC_BLUETOOTH_ENABLE) && defined(ENCODER_ENABLE) +#if defined(ENCODER_ENABLE) static void encoder_pad_cb(void *param) { encoder_inerrupt_read((uint32_t)param & 0xFF); } @@ -156,8 +156,9 @@ void keyboard_post_init_kb(void) { ckbt51_init(false); bluetooth_init(); +#endif -# ifdef ENCODER_ENABLE +#ifdef ENCODER_ENABLE 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++) { @@ -166,7 +167,6 @@ void keyboard_post_init_kb(void) { palSetLineCallback(encoders_pad_a[i], encoder_pad_cb, (void *)i); palSetLineCallback(encoders_pad_b[i], encoder_pad_cb, (void *)i); } -# endif #endif keyboard_post_init_user();