From 7a2314ef59a3eebf68ce187fd9b90925fdab8cf9 Mon Sep 17 00:00:00 2001 From: Kellen Carey Date: Sun, 11 Oct 2020 17:36:32 -0700 Subject: [PATCH 1/7] refactor kconfig to look nicer --- app/Kconfig | 121 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 51 deletions(-) diff --git a/app/Kconfig b/app/Kconfig index fca49124..ab1f6c52 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -1,5 +1,8 @@ mainmenu "ZMK Firmware" +menu "ZMK" + +menu "Basic Keyboard Setup" config ZMK_KEYBOARD_NAME string "Keyboard Name" @@ -9,10 +12,6 @@ config USB_DEVICE_PRODUCT config BT_DEVICE_NAME default ZMK_KEYBOARD_NAME -config ZMK_KSCAN_EVENT_QUEUE_SIZE - int "Size of the event queue for KSCAN events to buffer events" - default 4 - menu "HID Output Types" menuconfig ZMK_USB @@ -27,13 +26,16 @@ config ZMK_USB_INIT_PRIORITY int "Init Priority" default 50 +#USB endif +#Where does this get set? if ZMK_USB config USB_NUMOF_EP_WRITE_RETRIES default 10 +#ZMK_USB endif menuconfig ZMK_BLE @@ -72,42 +74,12 @@ config ZMK_BLE_PASSKEY_ENTRY bool "Experimental: Requiring typing passkey from host to pair BLE connection" default n +#ZMK_BLE endif +#ZMK_BLE endmenu -menuconfig ZMK_SLEEP - bool "Enable deep sleep support" - imply USB - -if ZMK_SLEEP - -config SYS_POWER_DEEP_SLEEP_STATES - default y - -choice SYS_PM_POLICY - default SYS_PM_POLICY_APP -endchoice - -config ZMK_IDLE_SLEEP_TIMEOUT - int "Milliseconds to wait to sleep when going idle" - default 900000 - -endif - -config ZMK_EXT_POWER - bool "Enable support to control external power output" - default y - -config ZMK_DISPLAY - bool "ZMK display support" - default n - select DISPLAY - select LVGL - select LVGL_THEMES - select LVGL_THEME_MONO - select LVGL_OBJ_LABEL - menu "Split Support" config ZMK_SPLIT @@ -184,23 +156,19 @@ endif endmenu -config ZMK_KSCAN_MOCK_DRIVER - bool "Enable mock kscan driver to simulate key presses" - default n - - -config ZMK_KSCAN_COMPOSITE_DRIVER - bool "Enable composite kscan driver to combine kscan devices" - default n - -menu "ZMK Actions" - -config ZMK_ACTION_MOD_TAP - bool "Enable the Mod-Tap Action" - +#ZMK basic keyboard setup endmenu -menu "ZMK Lighting" +menu "Display/LED Options" + +config ZMK_DISPLAY + bool "ZMK display support" + default n + select DISPLAY + select LVGL + select LVGL_THEMES + select LVGL_THEME_MONO + select LVGL_OBJ_LABEL menuconfig ZMK_RGB_UNDERGLOW bool "RGB Adressable LED Underglow" @@ -222,6 +190,57 @@ config ZMK_RGB_UNDERGLOW_BRT_STEP endif +#ZMK display/led options +endmenu + +menu "Power Management" + +menuconfig ZMK_SLEEP + bool "Enable deep sleep support" + imply USB + +if ZMK_SLEEP + +config SYS_POWER_DEEP_SLEEP_STATES + default y + +choice SYS_PM_POLICY + default SYS_PM_POLICY_APP +endchoice + +config ZMK_IDLE_SLEEP_TIMEOUT + int "Milliseconds to wait to sleep when going idle" + default 900000 + +#ZMK_SLEEP +endif + +config ZMK_EXT_POWER + bool "Enable support to control external power output" + default y + +#Power management +endmenu + +menu "KSCAN Settings (Advanced)" + +config ZMK_KSCAN_EVENT_QUEUE_SIZE + int "Size of the event queue for KSCAN events to buffer events" + default 4 + +config ZMK_KSCAN_MOCK_DRIVER + bool "Enable mock kscan driver to simulate key presses" + default n + +config ZMK_KSCAN_COMPOSITE_DRIVER + bool "Enable composite kscan driver to combine kscan devices" + default n + +#kscan settings +endmenu + +#ZMK ugly + endmenu config HEAP_MEM_POOL_SIZE From 8e298ec7010254011d83f0dcc66c00ab0a5470ec Mon Sep 17 00:00:00 2001 From: Kellen Carey Date: Sun, 11 Oct 2020 18:05:27 -0700 Subject: [PATCH 2/7] happy with layout, need to improve interactions --- app/Kconfig | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/app/Kconfig b/app/Kconfig index ab1f6c52..462c053f 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -3,6 +3,7 @@ mainmenu "ZMK Firmware" menu "ZMK" menu "Basic Keyboard Setup" + config ZMK_KEYBOARD_NAME string "Keyboard Name" @@ -14,31 +15,25 @@ config BT_DEVICE_NAME menu "HID Output Types" -menuconfig ZMK_USB +config ZMK_USB bool "USB" select USB select USB_DEVICE_STACK select USB_DEVICE_HID -if USB +if ZMK_USB config ZMK_USB_INIT_PRIORITY - int "Init Priority" + int "USB Init Priority" default 50 -#USB -endif - -#Where does this get set? -if ZMK_USB - config USB_NUMOF_EP_WRITE_RETRIES default 10 #ZMK_USB endif -menuconfig ZMK_BLE +config ZMK_BLE bool "BLE (HID over GATT)" select BT select BT_SMP @@ -53,7 +48,7 @@ menuconfig ZMK_BLE if ZMK_BLE config ZMK_BLE_INIT_PRIORITY - int "Init Priority" + int "BLE Init Priority" default 50 config SYSTEM_WORKQUEUE_STACK_SIZE @@ -77,7 +72,7 @@ config ZMK_BLE_PASSKEY_ENTRY #ZMK_BLE endif -#ZMK_BLE +#HID Output Types endmenu menu "Split Support" @@ -122,12 +117,16 @@ config BT_MAX_CONN config BT_GAP_AUTO_UPDATE_CONN_PARAMS default n +#ZMK_SPLIT_BLE_ROLE_PERIPHERAL endif +#ZMK_SPLIT_BLE_ROLE endchoice +#ZMK_SPLIT_BLE endif +#ZMK_SPLIT endif if ZMK_BLE @@ -140,6 +139,7 @@ config BT_MAX_CONN config BT_MAX_PAIRED default 6 +#ZMK_SPLIT_BLE && ZMK_SPLIT_BLE_ROLE_CENTRAL endif if !ZMK_SPLIT_BLE @@ -150,13 +150,16 @@ config BT_MAX_CONN config BT_MAX_PAIRED default 5 +#!ZMK_SPLIT_BLE endif +#ZMK_BLE endif +#Split Support endmenu -#ZMK basic keyboard setup +#Basic Keyboard Setup endmenu menu "Display/LED Options" @@ -170,7 +173,7 @@ config ZMK_DISPLAY select LVGL_THEME_MONO select LVGL_OBJ_LABEL -menuconfig ZMK_RGB_UNDERGLOW +config ZMK_RGB_UNDERGLOW bool "RGB Adressable LED Underglow" select LED_STRIP @@ -188,14 +191,15 @@ config ZMK_RGB_UNDERGLOW_BRT_STEP int "RGB underglow brightness step in percent" default 10 +#ZMK_RGB_UNDERGLOW endif -#ZMK display/led options +#Display/LED Options endmenu menu "Power Management" -menuconfig ZMK_SLEEP +config ZMK_SLEEP bool "Enable deep sleep support" imply USB @@ -219,7 +223,7 @@ config ZMK_EXT_POWER bool "Enable support to control external power output" default y -#Power management +#Power Management endmenu menu "KSCAN Settings (Advanced)" @@ -236,11 +240,10 @@ config ZMK_KSCAN_COMPOSITE_DRIVER bool "Enable composite kscan driver to combine kscan devices" default n -#kscan settings +#KSCAN Settings (Advanced) endmenu -#ZMK ugly - +#ZMK endmenu config HEAP_MEM_POOL_SIZE From 8b9b24759280c5c40de108ca2312a8f160523963 Mon Sep 17 00:00:00 2001 From: Kellen Carey Date: Sun, 11 Oct 2020 20:11:19 -0700 Subject: [PATCH 3/7] allow ble to be enabled if split transport is ble --- app/Kconfig | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/Kconfig b/app/Kconfig index 462c053f..f06a92c5 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -85,9 +85,17 @@ if ZMK_SPLIT config ZMK_SPLIT_BLE bool "Split keyboard support via BLE transport" - depends on ZMK_BLE default y select BT_USER_PHY_UPDATE + select BT + select BT_SMP + select BT_SMP_SC_PAIR_ONLY + select BT_SMP_APP_PAIRING_ACCEPT + select BT_PERIPHERAL + select BT_GATT_DIS + select BT_GATT_BAS + select BT_SETTINGS + select SETTINGS if ZMK_SPLIT_BLE @@ -129,7 +137,7 @@ endif #ZMK_SPLIT endif -if ZMK_BLE +if ZMK_BLE || ZMK_SPLIT_BLE if ZMK_SPLIT_BLE && ZMK_SPLIT_BLE_ROLE_CENTRAL @@ -153,7 +161,7 @@ config BT_MAX_PAIRED #!ZMK_SPLIT_BLE endif -#ZMK_BLE +#ZMK_BLE || ZMK_SPLIT_BLE endif #Split Support From 26057c0200add18ed1a08d3795116e36a34b14b4 Mon Sep 17 00:00:00 2001 From: Kellen Carey Date: Mon, 12 Oct 2020 06:48:35 -0700 Subject: [PATCH 4/7] update build.yml --- .github/workflows/build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60c337de..b8da4b19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: name: Build Test strategy: matrix: - board: [proton_c, nice_nano, bluemicro840_v1, nrfmicro_13] + board: [nice_nano, bluemicro840_v1, nrfmicro_13] shield: - corne_left - corne_right @@ -26,6 +26,12 @@ jobs: include: - board: proton_c shield: clueboard_california + - board: proton_c + shield: romac + - board: proton_c + shield: romac_plus + - board: proton_c + shield: settings_reset steps: # To use this repository's private action, # you must check out the repository From 6aae66782682ffcabf953d785308b83ee16fc3b6 Mon Sep 17 00:00:00 2001 From: Carey Date: Tue, 20 Oct 2020 21:47:49 -0500 Subject: [PATCH 5/7] merge changes from master --- app/Kconfig | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/app/Kconfig b/app/Kconfig index f06a92c5..e8bfa3c2 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -13,6 +13,15 @@ config USB_DEVICE_PRODUCT config BT_DEVICE_NAME default ZMK_KEYBOARD_NAME +config USB_DEVICE_VID + default 0x1D50 + +config USB_DEVICE_PID + default 0x615E + +config USB_DEVICE_MANUFACTURER + default "ZMK Project" + menu "HID Output Types" config ZMK_USB @@ -187,6 +196,10 @@ config ZMK_RGB_UNDERGLOW if ZMK_RGB_UNDERGLOW +# This default value cuts down on tons of excess .conf files, if you're using GPIO, manually disable this +config SPI + default y + config ZMK_RGB_UNDERGLOW_HUE_STEP int "RGB underglow hue step in degrees of 360" default 10 @@ -199,6 +212,30 @@ config ZMK_RGB_UNDERGLOW_BRT_STEP int "RGB underglow brightness step in percent" default 10 +config ZMK_RGB_UNDERGLOW_HUE_START + int "RGB underglow start hue value from 0-359" + default 0 + +config ZMK_RGB_UNDERGLOW_SAT_START + int "RGB underglow start saturations value from 0-100" + default 100 + +config ZMK_RGB_UNDERGLOW_BRT_START + int "RGB underglow start brightness value from 0-100" + default 100 + +config ZMK_RGB_UNDERGLOW_SPD_START + int "RGB underglow start animation speed value from 1-5" + default 3 + +config ZMK_RGB_UNDERGLOW_EFF_START + int "RGB underglow start effect int value related to the effect enum list" + default 0 + +config ZMK_RGB_UNDERGLOW_ON_START + bool "Whether RGB underglow starts on by default" + default y + #ZMK_RGB_UNDERGLOW endif From c5172e433752942026822d498a2c7d956f5237a5 Mon Sep 17 00:00:00 2001 From: Carey Date: Wed, 28 Oct 2020 07:47:22 -0500 Subject: [PATCH 6/7] move initialization priorities to advanced menu --- app/Kconfig | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/app/Kconfig b/app/Kconfig index e8bfa3c2..ed6244a2 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -30,16 +30,12 @@ config ZMK_USB select USB_DEVICE_STACK select USB_DEVICE_HID -if ZMK_USB - -config ZMK_USB_INIT_PRIORITY - int "USB Init Priority" - default 50 +if USB config USB_NUMOF_EP_WRITE_RETRIES default 10 -#ZMK_USB +#USB endif config ZMK_BLE @@ -56,10 +52,6 @@ config ZMK_BLE if ZMK_BLE -config ZMK_BLE_INIT_PRIORITY - int "BLE Init Priority" - default 50 - config SYSTEM_WORKQUEUE_STACK_SIZE default 2048 @@ -271,7 +263,32 @@ config ZMK_EXT_POWER #Power Management endmenu -menu "KSCAN Settings (Advanced)" +menu "Advanced" + +menu "Initialization Priorities" + +if USB + +config ZMK_USB_INIT_PRIORITY + int "USB Init Priority" + default 50 + +#USB +endif + +if ZMK_BLE || ZMK_SPLIT_BLE + +config ZMK_BLE_INIT_PRIORITY + int "BLE Init Priority" + default 50 + +#ZMK_BLE || ZMK_SPLIT_BLE +endif + +#Initialization Priorities +endmenu + +menu "KSCAN Settings" config ZMK_KSCAN_EVENT_QUEUE_SIZE int "Size of the event queue for KSCAN events to buffer events" @@ -285,7 +302,10 @@ config ZMK_KSCAN_COMPOSITE_DRIVER bool "Enable composite kscan driver to combine kscan devices" default n -#KSCAN Settings (Advanced) +#KSCAN Settings +endmenu + +#Advanced endmenu #ZMK From 3f4d47a06e5a2280a11a1735995e13b914ed9a6e Mon Sep 17 00:00:00 2001 From: Carey Date: Sat, 31 Oct 2020 07:24:38 -0500 Subject: [PATCH 7/7] focus on refactor --- .github/workflows/build.yml | 8 +------- app/Kconfig | 18 +++++------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e7e23fd..e22dc653 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: name: Build Test strategy: matrix: - board: [nice_nano, bluemicro840_v1, nrfmicro_13] + board: [proton_c, nice_nano, bluemicro840_v1, nrfmicro_13] shield: - boardsource3x4 - corne_left @@ -29,12 +29,6 @@ jobs: include: - board: proton_c shield: clueboard_california - - board: proton_c - shield: romac - - board: proton_c - shield: romac_plus - - board: proton_c - shield: settings_reset steps: # To use this repository's private action, # you must check out the repository diff --git a/app/Kconfig b/app/Kconfig index ed6244a2..28d2aa2e 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -30,12 +30,12 @@ config ZMK_USB select USB_DEVICE_STACK select USB_DEVICE_HID -if USB +if ZMK_USB config USB_NUMOF_EP_WRITE_RETRIES default 10 -#USB +#ZMK_USB endif config ZMK_BLE @@ -86,17 +86,9 @@ if ZMK_SPLIT config ZMK_SPLIT_BLE bool "Split keyboard support via BLE transport" + depends on ZMK_BLE default y select BT_USER_PHY_UPDATE - select BT - select BT_SMP - select BT_SMP_SC_PAIR_ONLY - select BT_SMP_APP_PAIRING_ACCEPT - select BT_PERIPHERAL - select BT_GATT_DIS - select BT_GATT_BAS - select BT_SETTINGS - select SETTINGS if ZMK_SPLIT_BLE @@ -138,7 +130,7 @@ endif #ZMK_SPLIT endif -if ZMK_BLE || ZMK_SPLIT_BLE +if ZMK_BLE if ZMK_SPLIT_BLE && ZMK_SPLIT_BLE_ROLE_CENTRAL @@ -162,7 +154,7 @@ config BT_MAX_PAIRED #!ZMK_SPLIT_BLE endif -#ZMK_BLE || ZMK_SPLIT_BLE +#ZMK_BLE endif #Split Support