From 7be955ff7285a1003455b4d573e843ef713ac584 Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Fri, 21 Jun 2024 13:12:13 -0600 Subject: [PATCH] fix(usb): Ensure USB init is last * To avoid USB init issues due to other initialization disrupting USB setup, move USB setup to a lower priority. --- app/Kconfig | 6 +++++- app/src/usb_hid.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Kconfig b/app/Kconfig index 5aedd9d9030..8f690175ddc 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -490,7 +490,11 @@ if USB_DEVICE_STACK config ZMK_USB_INIT_PRIORITY int "USB Init Priority" - default 50 + default 94 + +config ZMK_USB_HID_INIT_PRIORITY + int "USB HID Init Priority" + default 95 #USB endif diff --git a/app/src/usb_hid.c b/app/src/usb_hid.c index cd3ef920391..9db10952c95 100644 --- a/app/src/usb_hid.c +++ b/app/src/usb_hid.c @@ -195,4 +195,4 @@ static int zmk_usb_hid_init(void) { return 0; } -SYS_INIT(zmk_usb_hid_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); +SYS_INIT(zmk_usb_hid_init, APPLICATION, CONFIG_ZMK_USB_HID_INIT_PRIORITY);