Implements tuh_deinit() and tud_deinit() to uninitialize host/device mode.
This commit is contained in:
committed by
hathach
parent
bc10394e66
commit
47c12a07f2
@@ -407,6 +407,18 @@ void dcd_init(uint8_t rhport) {
|
||||
dcd_connect(rhport);
|
||||
}
|
||||
|
||||
void dcd_deinit(uint8_t rhport) {
|
||||
assert(rhport == 0);
|
||||
|
||||
dcd_disconnect(rhport);
|
||||
reset_non_control_endpoints();
|
||||
irq_remove_handler(USBCTRL_IRQ, dcd_rp2040_irq);
|
||||
|
||||
// reset usb hardware into initial state
|
||||
reset_block(RESETS_RESET_USBCTRL_BITS);
|
||||
unreset_block_wait(RESETS_RESET_USBCTRL_BITS);
|
||||
}
|
||||
|
||||
void dcd_int_enable(__unused uint8_t rhport) {
|
||||
assert(rhport == 0);
|
||||
irq_set_enabled(USBCTRL_IRQ, true);
|
||||
|
||||
Reference in New Issue
Block a user