rp2xxx: added rp2usb_deinit() to fix 'No spinlocks are available'

This commit is contained in:
Geurt Vos
2026-07-29 11:36:01 +02:00
parent 538ec3e332
commit 84e938bd76
3 changed files with 8 additions and 0 deletions

View File

@ -387,6 +387,9 @@ bool dcd_deinit(uint8_t rhport) {
reset_block(RESETS_RESET_USBCTRL_BITS);
unreset_block_wait(RESETS_RESET_USBCTRL_BITS);
// Release allocated resources
rp2usb_deinit();
return true;
}

View File

@ -85,6 +85,10 @@ void rp2usb_init(void) {
critical_section_init(&rp2usb_lock);
}
void rp2usb_deinit(void) {
critical_section_deinit(&rp2usb_lock);
}
void __tusb_irq_path_func(rp2usb_reset_transfer)(hw_endpoint_t *ep) {
ep->state = EPSTATE_IDLE;
ep->remaining_len = 0;

View File

@ -147,6 +147,7 @@ extern volatile uint32_t e15_last_sof;
#endif
void rp2usb_init(void);
void rp2usb_deinit(void);
// if usb hardware is in host mode
TU_ATTR_ALWAYS_INLINE static inline bool rp2usb_is_host_mode(void) {