Refactor vusb to protocol use pre/post task (#14944)
This commit is contained in:
parent
4bbfecae90
commit
63dd131d81
5 changed files with 35 additions and 61 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue