From eaf047a65c07e5d044590e00171956c47752c4f1 Mon Sep 17 00:00:00 2001 From: lalalademaxiya1 <2831039915@qq.com> Date: Tue, 31 Jan 2023 09:58:46 +0800 Subject: [PATCH] Move MCU and bootloader definitions into info.json --- keyboards/keychron/v6/readme.md | 8 ++------ keyboards/keychron/v6/v6.c | 16 +++++++++++++++- .../keychron/v6/v6_ansi_stm32l432/info.json | 2 ++ keyboards/keychron/v6/v6_ansi_stm32l432/rules.mk | 6 ------ .../keychron/v6/v6_ansi_stm32l432_ec11/info.json | 4 +++- .../keychron/v6/v6_ansi_stm32l432_ec11/rules.mk | 6 ------ keyboards/keychron/v6/v6_iso_stm32l432/info.json | 4 +++- keyboards/keychron/v6/v6_iso_stm32l432/rules.mk | 6 ------ .../keychron/v6/v6_iso_stm32l432_ec11/info.json | 4 +++- .../keychron/v6/v6_iso_stm32l432_ec11/rules.mk | 6 ------ 10 files changed, 28 insertions(+), 34 deletions(-) diff --git a/keyboards/keychron/v6/readme.md b/keyboards/keychron/v6/readme.md index 0cc2714199..d8a68846bd 100644 --- a/keyboards/keychron/v6/readme.md +++ b/keyboards/keychron/v6/readme.md @@ -8,15 +8,11 @@ A customizable 100% keyboard. Make example for this keyboard (after setting up your build environment): -```base -make keychron/v6/v6_ansi_stm32l432:default -``` + make keychron/v6/v6_ansi_stm32l432:default Flashing example for this keyboard: -```base -make keychron/v6/v6_ansi_stm32l432:flash -``` + make keychron/v6/v6_ansi_stm32l432:flash **Reset Key**: Hold down the key located at *K00*, commonly programmed as *Esc* while plugging in the keyboard. diff --git a/keyboards/keychron/v6/v6.c b/keyboards/keychron/v6/v6.c index ea3afa1d6a..1f18f8060b 100644 --- a/keyboards/keychron/v6/v6.c +++ b/keyboards/keychron/v6/v6.c @@ -136,4 +136,18 @@ bool led_update_kb(led_t led_state) { return res; } -#endif // CAPS_LOCK_LED_INDEX or NUM_LOCK_LED_INDEX +#endif // CAPS_LOCK_LED_INDEX + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + } + return true; +} +#endif diff --git a/keyboards/keychron/v6/v6_ansi_stm32l432/info.json b/keyboards/keychron/v6/v6_ansi_stm32l432/info.json index 3937fefc30..c3470eb73c 100644 --- a/keyboards/keychron/v6/v6_ansi_stm32l432/info.json +++ b/keyboards/keychron/v6/v6_ansi_stm32l432/info.json @@ -8,6 +8,8 @@ "pid": "0x0360", "device_version": "1.0.3" }, + "processor": "STM32L432", + "bootloader": "stm32-dfu", "layouts": { "LAYOUT_ansi_108": { "layout": [ diff --git a/keyboards/keychron/v6/v6_ansi_stm32l432/rules.mk b/keyboards/keychron/v6/v6_ansi_stm32l432/rules.mk index 89a1fab586..6a4ce9a9a9 100644 --- a/keyboards/keychron/v6/v6_ansi_stm32l432/rules.mk +++ b/keyboards/keychron/v6/v6_ansi_stm32l432/rules.mk @@ -1,9 +1,3 @@ -# MCU name -MCU = STM32L432 - -# Bootloader selection -BOOTLOADER = stm32-dfu - # Build Options # change yes to no to disable. # diff --git a/keyboards/keychron/v6/v6_ansi_stm32l432_ec11/info.json b/keyboards/keychron/v6/v6_ansi_stm32l432_ec11/info.json index 593f9e173c..37a9a6965c 100644 --- a/keyboards/keychron/v6/v6_ansi_stm32l432_ec11/info.json +++ b/keyboards/keychron/v6/v6_ansi_stm32l432_ec11/info.json @@ -6,8 +6,10 @@ "usb": { "vid": "0x3434", "pid": "0x0361", - "device_version": "1.0.2" + "device_version": "1.0.3" }, + "processor": "STM32L432", + "bootloader": "stm32-dfu", "layouts": { "LAYOUT_ansi_109": { "layout": [ diff --git a/keyboards/keychron/v6/v6_ansi_stm32l432_ec11/rules.mk b/keyboards/keychron/v6/v6_ansi_stm32l432_ec11/rules.mk index ce63d0a1fb..f76ec9b08d 100644 --- a/keyboards/keychron/v6/v6_ansi_stm32l432_ec11/rules.mk +++ b/keyboards/keychron/v6/v6_ansi_stm32l432_ec11/rules.mk @@ -1,9 +1,3 @@ -# MCU name -MCU = STM32L432 - -# Bootloader selection -BOOTLOADER = stm32-dfu - # Build Options # change yes to no to disable. # diff --git a/keyboards/keychron/v6/v6_iso_stm32l432/info.json b/keyboards/keychron/v6/v6_iso_stm32l432/info.json index 9a314f42ed..8b56e0f3e6 100644 --- a/keyboards/keychron/v6/v6_iso_stm32l432/info.json +++ b/keyboards/keychron/v6/v6_iso_stm32l432/info.json @@ -6,8 +6,10 @@ "usb": { "vid": "0x3434", "pid": "0x0362", - "device_version": "1.0.2" + "device_version": "1.0.3" }, + "processor": "STM32L432", + "bootloader": "stm32-dfu", "layouts": { "LAYOUT_iso_109": { "layout": [ diff --git a/keyboards/keychron/v6/v6_iso_stm32l432/rules.mk b/keyboards/keychron/v6/v6_iso_stm32l432/rules.mk index 89a1fab586..6a4ce9a9a9 100644 --- a/keyboards/keychron/v6/v6_iso_stm32l432/rules.mk +++ b/keyboards/keychron/v6/v6_iso_stm32l432/rules.mk @@ -1,9 +1,3 @@ -# MCU name -MCU = STM32L432 - -# Bootloader selection -BOOTLOADER = stm32-dfu - # Build Options # change yes to no to disable. # diff --git a/keyboards/keychron/v6/v6_iso_stm32l432_ec11/info.json b/keyboards/keychron/v6/v6_iso_stm32l432_ec11/info.json index c02ee47440..a891aaf892 100644 --- a/keyboards/keychron/v6/v6_iso_stm32l432_ec11/info.json +++ b/keyboards/keychron/v6/v6_iso_stm32l432_ec11/info.json @@ -6,8 +6,10 @@ "usb": { "vid": "0x3434", "pid": "0x0363", - "device_version": "1.0.1" + "device_version": "1.0.2" }, + "processor": "STM32L432", + "bootloader": "stm32-dfu", "layouts": { "LAYOUT_iso_110": { "layout": [ diff --git a/keyboards/keychron/v6/v6_iso_stm32l432_ec11/rules.mk b/keyboards/keychron/v6/v6_iso_stm32l432_ec11/rules.mk index ce63d0a1fb..f76ec9b08d 100644 --- a/keyboards/keychron/v6/v6_iso_stm32l432_ec11/rules.mk +++ b/keyboards/keychron/v6/v6_iso_stm32l432_ec11/rules.mk @@ -1,9 +1,3 @@ -# MCU name -MCU = STM32L432 - -# Bootloader selection -BOOTLOADER = stm32-dfu - # Build Options # change yes to no to disable. #