Skip to content

Commit

Permalink
Merge pull request #46 from r2axz/r2axz-remove-cdc-polling-from-main
Browse files Browse the repository at this point in the history
Move CDC polling out of main
  • Loading branch information
r2axz authored Sep 28, 2021
2 parents 368fee2 + 4cafa8c commit f7d8576
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include "status_led.h"
#include "device_config.h"
#include "usb.h"
#include "usb_cdc.h"


int main() {
system_clock_init();
Expand All @@ -21,6 +19,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 f7d8576

Please sign in to comment.