Skip to content

Commit e642066

Browse files
committed
Move TUP_DCD_EDPT_ISO_ALLOC outside usbd_edpt_close() loop.
1 parent 5fd6241 commit e642066

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/class/video/video_device.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -755,20 +755,20 @@ static bool _open_vs_itf(uint8_t rhport, videod_streaming_interface_t *stm, uint
755755
TU_LOG_DRV(" reopen VS %d\r\n", altnum);
756756
uint8_t const *desc = _videod_itf[stm->index_vc].beg;
757757

758+
#ifndef TUP_DCD_EDPT_ISO_ALLOC
758759
/* Close endpoints of previous settings. */
759760
for (i = 0; i < TU_ARRAY_SIZE(stm->desc.ep); ++i) {
760761
uint_fast16_t ofs_ep = stm->desc.ep[i];
761762
if (!ofs_ep) break;
762763
tusb_desc_endpoint_t const *ep = (tusb_desc_endpoint_t const*)(desc + ofs_ep);
763764
/* Only ISO endpoints needs to be closed */
764765
if(ep->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS) {
765-
#ifndef TUP_DCD_EDPT_ISO_ALLOC
766766
usbd_edpt_close(rhport, ep->bEndpointAddress);
767-
#endif
768767
stm->desc.ep[i] = 0;
769768
TU_LOG_DRV(" close EP%02x\r\n", ep->bEndpointAddress);
770769
}
771770
}
771+
#endif
772772

773773
/* clear transfer management information */
774774
stm->buffer = NULL;

0 commit comments

Comments
 (0)