Allow reinitializing USB
This commit is contained in:
parent
e121ecd896
commit
4afb598453
10
usb.c
10
usb.c
|
@ -314,15 +314,19 @@ void usb_setup() {
|
|||
}
|
||||
|
||||
/* Initialize the device... */
|
||||
usb_reinit();
|
||||
|
||||
/* And use interrupts instead of polling. */
|
||||
// nvic_enable_irq(NVIC_OTG_FS_IRQ);
|
||||
}
|
||||
|
||||
void usb_reinit() {
|
||||
g_usbd_dev = usbd_init(&otgfs_usb_driver, &dev, &config,
|
||||
(char const * const *)usb_strings,
|
||||
(sizeof usb_strings) / sizeof(usb_strings[0]),
|
||||
usbd_control_buffer, sizeof(usbd_control_buffer));
|
||||
|
||||
usbd_register_set_config_callback(g_usbd_dev, cdcacm_set_config);
|
||||
|
||||
/* And use interrupts instead of polling. */
|
||||
// nvic_enable_irq(NVIC_OTG_FS_IRQ);
|
||||
}
|
||||
|
||||
//void __attribute__((weak)) otg_fs_isr() { }
|
||||
|
|
Loading…
Reference in New Issue
Block a user