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/vusb.c | |
parent | 4bbfecae90e994b4a7d9bf5db06a995fb05d6ab2 (diff) |
Refactor vusb to protocol use pre/post task (#14944)
Diffstat (limited to 'tmk_core/protocol/vusb/vusb.c')
-rw-r--r-- | tmk_core/protocol/vusb/vusb.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c index cfeeed3712..c8ab494253 100644 --- a/tmk_core/protocol/vusb/vusb.c +++ b/tmk_core/protocol/vusb/vusb.c @@ -162,6 +162,12 @@ __attribute__((weak)) void raw_hid_receive(uint8_t *data, uint8_t length) { } void raw_hid_task(void) { + usbPoll(); + + if (!usbConfiguration || !usbInterruptIsReady4()) { + return; + } + if (raw_output_received_bytes == RAW_BUFFER_SIZE) { raw_hid_receive(raw_output_buffer, RAW_BUFFER_SIZE); raw_output_received_bytes = 0; @@ -182,7 +188,9 @@ int8_t sendchar(uint8_t c) { } void console_task(void) { - if (!usbConfiguration) { + usbPoll(); + + if (!usbConfiguration || !usbInterruptIsReady3()) { return; } |