Skip to content

Commit

Permalink
Move TUP_DCD_EDPT_ISO_ALLOC outside usbd_edpt_close() loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
HiFiPhile committed Apr 6, 2024
1 parent 5fd6241 commit e642066
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/class/video/video_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,20 +755,20 @@ static bool _open_vs_itf(uint8_t rhport, videod_streaming_interface_t *stm, uint
TU_LOG_DRV(" reopen VS %d\r\n", altnum);
uint8_t const *desc = _videod_itf[stm->index_vc].beg;

#ifndef TUP_DCD_EDPT_ISO_ALLOC
/* Close endpoints of previous settings. */
for (i = 0; i < TU_ARRAY_SIZE(stm->desc.ep); ++i) {
uint_fast16_t ofs_ep = stm->desc.ep[i];
if (!ofs_ep) break;
tusb_desc_endpoint_t const *ep = (tusb_desc_endpoint_t const*)(desc + ofs_ep);
/* Only ISO endpoints needs to be closed */
if(ep->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS) {
#ifndef TUP_DCD_EDPT_ISO_ALLOC
usbd_edpt_close(rhport, ep->bEndpointAddress);
#endif
stm->desc.ep[i] = 0;
TU_LOG_DRV(" close EP%02x\r\n", ep->bEndpointAddress);
}
}
#endif

/* clear transfer management information */
stm->buffer = NULL;
Expand Down

0 comments on commit e642066

Please sign in to comment.