diff options
| author | sakumisu <[email protected]> | 2022-02-14 22:38:50 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2022-02-14 22:38:50 +0800 |
| commit | 0825cbc68a6dfd2ce892ba578f76169da80e1ec4 (patch) | |
| tree | 4f3a3f0f2ae18e6fe5ed8b36686071e70771b528 | |
| parent | 739d83a8a93642e4fe96cc30b69367242be2e5ae (diff) | |
wakeup sem for all error transfer channel
| -rw-r--r-- | port/synopsys/usb_hc_synopsys.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/port/synopsys/usb_hc_synopsys.c b/port/synopsys/usb_hc_synopsys.c index c0a9e248..3a76ff30 100644 --- a/port/synopsys/usb_hc_synopsys.c +++ b/port/synopsys/usb_hc_synopsys.c @@ -832,18 +832,18 @@ void HAL_HCD_Disconnect_Callback(HCD_HandleTypeDef *hhcd) g_usbhost.connected = false; usb_synopsys_chan_freeall(&g_usbhost); - if (g_usbhost.chan[0].waiter) { - /* Wake'em up! */ - g_usbhost.chan[0].waiter = false; - usb_osal_sem_give(g_usbhost.chan[0].waitsem); - } - if (g_usbhost.chan[1].waiter) { - /* Wake'em up! */ - g_usbhost.chan[1].waiter = false; - usb_osal_sem_give(g_usbhost.chan[1].waitsem); + for (uint8_t chnum = 0; chnum < CONFIG_USBHOST_CHANNELS; chnum++) { + { + if (g_usbhost.chan[chnum].waiter) { + /* Wake'em up! */ + g_usbhost.chan[chnum].waiter = false; + usb_osal_sem_give(g_usbhost.chan[chnum].waitsem); + } + } + + extern void usbh_event_notify_handler(uint8_t event, uint8_t rhport); + usbh_event_notify_handler(USBH_EVENT_REMOVED, 1); } - extern void usbh_event_notify_handler(uint8_t event, uint8_t rhport); - usbh_event_notify_handler(USBH_EVENT_REMOVED, 1); } } |
