Skip to content

Commit

Permalink
FIX: move cdc polling out of main to the dedicated device-level polli…
Browse files Browse the repository at this point in the history
…ng function
  • Loading branch information
r2axz committed Aug 27, 2021
1 parent a1b6948 commit 7fb76af
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ int main() {
usb_init();
while (1) {
usb_poll();
usb_cdc_poll();
}
}
4 changes: 4 additions & 0 deletions usb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ void usb_device_handle_frame() {
usb_cdc_frame();
}

void usb_device_poll() {
usb_cdc_poll();
}

/* Device Descriptor Requests Handling */

usb_status_t usb_control_endpoint_process_get_descriptor(usb_setup_t *setup,
Expand Down
1 change: 1 addition & 0 deletions usb_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ void usb_device_handle_configured();
void usb_device_handle_suspend();
void usb_device_handle_wakeup();
void usb_device_handle_frame();
void usb_device_poll();

#endif /* USB_CORE_H */
1 change: 1 addition & 0 deletions usb_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,5 @@ void usb_poll() {
}
usb_device_handle_frame();
}
usb_device_poll();
}

0 comments on commit 7fb76af

Please sign in to comment.