diff options
author | Joel Challis <git@zvecr.com> | 2024-03-14 10:45:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-14 21:45:12 +1100 |
commit | 63dd131d812be4b8d4894fc20ca9968e25996b07 (patch) | |
tree | b51902172408e9325aef625034cbf8f6a92e55e0 /tmk_core/protocol/vusb/protocol.c | |
parent | 4bbfecae90e994b4a7d9bf5db06a995fb05d6ab2 (diff) |
Refactor vusb to protocol use pre/post task (#14944)
Diffstat (limited to 'tmk_core/protocol/vusb/protocol.c')
-rw-r--r-- | tmk_core/protocol/vusb/protocol.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/tmk_core/protocol/vusb/protocol.c b/tmk_core/protocol/vusb/protocol.c index 6178d48ef2..41ccf451fd 100644 --- a/tmk_core/protocol/vusb/protocol.c +++ b/tmk_core/protocol/vusb/protocol.c @@ -31,14 +31,6 @@ # include "sleep_led.h" #endif -#ifdef CONSOLE_ENABLE -void console_task(void); -#endif - -#ifdef RAW_ENABLE -void raw_hid_task(void); -#endif - /* This is from main.c of USBaspLoader */ static void initForUsbConnectivity(void) { uint8_t i = 0; @@ -136,7 +128,7 @@ static inline bool should_do_suspend(void) { return vusb_suspended; } -void protocol_task(void) { +void protocol_pre_task(void) { #if !defined(NO_USB_STARTUP_CHECK) if (should_do_suspend()) { dprintln("suspending keyboard"); @@ -159,7 +151,9 @@ void protocol_task(void) { vusb_wakeup(); } #endif +} +void protocol_keyboard_task(void) { usbPoll(); // TODO: configuration process is inconsistent. it sometime fails. @@ -167,20 +161,8 @@ void protocol_task(void) { if (usbConfiguration && usbInterruptIsReady()) { keyboard_task(); } +} -#ifdef RAW_ENABLE - usbPoll(); - - if (usbConfiguration && usbInterruptIsReady4()) { - raw_hid_task(); - } -#endif - -#ifdef CONSOLE_ENABLE - usbPoll(); - - if (usbConfiguration && usbInterruptIsReady3()) { - console_task(); - } -#endif +void protocol_post_task(void) { + // do nothing } |