From dce568aac1d14b6d876ea52eb970e33812a95df3 Mon Sep 17 00:00:00 2001 From: "Ryan P. Bitanga" Date: Mon, 5 Sep 2022 22:33:22 +0800 Subject: [PATCH] Fix merge --- app/src/usb.c | 1 + app/src/usb_hid.c | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/usb.c b/app/src/usb.c index 5f170ee6..f4ece7fd 100644 --- a/app/src/usb.c +++ b/app/src/usb.c @@ -33,6 +33,7 @@ enum zmk_usb_conn_state zmk_usb_get_conn_state() { switch (usb_status) { case USB_DC_SUSPEND: case USB_DC_CONFIGURED: + case USB_DC_SOF: return ZMK_USB_CONN_HID; case USB_DC_DISCONNECTED: diff --git a/app/src/usb_hid.c b/app/src/usb_hid.c index 31bbeb60..c46df45a 100644 --- a/app/src/usb_hid.c +++ b/app/src/usb_hid.c @@ -65,11 +65,6 @@ static uint8_t hid_protocol = HID_PROTOCOL_REPORT; void zmk_usb_set_proto_cb(const struct device *dev, uint8_t protocol) { hid_protocol = protocol; } - -#if IS_ENABLED(CONFIG_ZMK_USB_BOOT) - -#endif - #endif static const struct device *hid_dev; @@ -142,15 +137,15 @@ static int zmk_usb_hid_init(const struct device *_arg) { } #if IS_ENABLED(CONFIG_ZMK_USB_BOOT) -static int hid_listener(const zmk_event_t *eh) { +static int usb_hid_listener(const zmk_event_t *eh) { if (as_zmk_usb_conn_state_changed(eh) && zmk_usb_get_status() == USB_DC_RESET) { hid_protocol = HID_PROTOCOL_REPORT; } return 0; } -ZMK_LISTENER(hid_listener, hid_listener); -ZMK_SUBSCRIPTION(hid_listener, zmk_usb_conn_state_changed); +ZMK_LISTENER(usb_hid_listener, usb_hid_listener); +ZMK_SUBSCRIPTION(usb_hid_listener, zmk_usb_conn_state_changed); #endif SYS_INIT(zmk_usb_hid_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);