Skip to content

Commit 433ffe2

Browse files
authored
Merge pull request hathach#1985 from kkitayam/uvc_bulk
Add the capability for video class to handle a bulk endpoint in the streaming interface.
2 parents 81450bc + 5ce60c5 commit 433ffe2

File tree

4 files changed

+192
-27
lines changed

4 files changed

+192
-27
lines changed

examples/device/video_capture/src/tusb_config.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@
100100
// video streaming endpoint size
101101
#define CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE 256
102102

103+
// use bulk endpoint for streaming interface
104+
#define CFG_TUD_VIDEO_STREAMING_BULK 0
105+
103106
#ifdef __cplusplus
104107
}
105108
#endif

examples/device/video_capture/src/usb_descriptors.c

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,27 @@ uint8_t const * tud_descriptor_device_cb(void)
7676
//--------------------------------------------------------------------+
7777

7878
#if defined(CFG_EXAMPLE_VIDEO_READONLY) && !defined(CFG_EXAMPLE_VIDEO_DISABLE_MJPEG)
79-
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_VIDEO_CAPTURE_DESC_MJPEG_LEN)
79+
# if 1 == CFG_TUD_VIDEO_STREAMING_BULK
80+
# define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_VIDEO_CAPTURE_DESC_MJPEG_BULK_LEN)
81+
# else
82+
# define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_VIDEO_CAPTURE_DESC_MJPEG_LEN)
83+
# endif
8084
#else
81-
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_VIDEO_CAPTURE_DESC_UNCOMPR_LEN)
85+
# if 1 == CFG_TUD_VIDEO_STREAMING_BULK
86+
# define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_VIDEO_CAPTURE_DESC_UNCOMPR_BULK_LEN)
87+
# else
88+
# define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_VIDEO_CAPTURE_DESC_UNCOMPR_LEN)
89+
# endif
8290
#endif
8391

8492
#if TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)
8593
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
8694
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In, 5 Bulk etc ...
95+
#if 1 == CFG_TUD_VIDEO_STREAMING_BULK
96+
#define EPNUM_VIDEO_IN 0x82
97+
#else
8798
#define EPNUM_VIDEO_IN 0x83
99+
#endif
88100

89101
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
90102
// nRF5x ISO can only be endpoint 8
@@ -102,13 +114,25 @@ uint8_t const desc_fs_configuration[] =
102114

103115
// IAD for Video Control
104116
#if defined(CFG_EXAMPLE_VIDEO_READONLY) && !defined(CFG_EXAMPLE_VIDEO_DISABLE_MJPEG)
117+
# if 1 == CFG_TUD_VIDEO_STREAMING_BULK
118+
TUD_VIDEO_CAPTURE_DESCRIPTOR_MJPEG_BULK(4, EPNUM_VIDEO_IN,
119+
FRAME_WIDTH, FRAME_HEIGHT, FRAME_RATE,
120+
64)
121+
# else
105122
TUD_VIDEO_CAPTURE_DESCRIPTOR_MJPEG(4, EPNUM_VIDEO_IN,
106123
FRAME_WIDTH, FRAME_HEIGHT, FRAME_RATE,
107124
CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE)
125+
# endif
108126
#else
127+
# if 1 == CFG_TUD_VIDEO_STREAMING_BULK
128+
TUD_VIDEO_CAPTURE_DESCRIPTOR_UNCOMPR_BULK(4, EPNUM_VIDEO_IN,
129+
FRAME_WIDTH, FRAME_HEIGHT, FRAME_RATE,
130+
64)
131+
# else
109132
TUD_VIDEO_CAPTURE_DESCRIPTOR_UNCOMPR(4, EPNUM_VIDEO_IN,
110133
FRAME_WIDTH, FRAME_HEIGHT, FRAME_RATE,
111134
CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE)
135+
# endif
112136
#endif
113137
};
114138

examples/device/video_capture/src/usb_descriptors.h

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,38 @@ enum {
7979
+ 7/* Endpoint */\
8080
)
8181

82+
#define TUD_VIDEO_CAPTURE_DESC_UNCOMPR_BULK_LEN (\
83+
TUD_VIDEO_DESC_IAD_LEN\
84+
/* control */\
85+
+ TUD_VIDEO_DESC_STD_VC_LEN\
86+
+ (TUD_VIDEO_DESC_CS_VC_LEN + 1/*bInCollection*/)\
87+
+ TUD_VIDEO_DESC_CAMERA_TERM_LEN\
88+
+ TUD_VIDEO_DESC_OUTPUT_TERM_LEN\
89+
/* Interface 1, Alternate 0 */\
90+
+ TUD_VIDEO_DESC_STD_VS_LEN\
91+
+ (TUD_VIDEO_DESC_CS_VS_IN_LEN + 1/*bNumFormats x bControlSize*/)\
92+
+ TUD_VIDEO_DESC_CS_VS_FMT_UNCOMPR_LEN\
93+
+ TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_CONT_LEN\
94+
+ TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING_LEN\
95+
+ 7/* Endpoint */\
96+
)
97+
98+
#define TUD_VIDEO_CAPTURE_DESC_MJPEG_BULK_LEN (\
99+
TUD_VIDEO_DESC_IAD_LEN\
100+
/* control */\
101+
+ TUD_VIDEO_DESC_STD_VC_LEN\
102+
+ (TUD_VIDEO_DESC_CS_VC_LEN + 1/*bInCollection*/)\
103+
+ TUD_VIDEO_DESC_CAMERA_TERM_LEN\
104+
+ TUD_VIDEO_DESC_OUTPUT_TERM_LEN\
105+
/* Interface 1, Alternate 0 */\
106+
+ TUD_VIDEO_DESC_STD_VS_LEN\
107+
+ (TUD_VIDEO_DESC_CS_VS_IN_LEN + 1/*bNumFormats x bControlSize*/)\
108+
+ TUD_VIDEO_DESC_CS_VS_FMT_MJPEG_LEN\
109+
+ TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_CONT_LEN\
110+
+ TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING_LEN\
111+
+ 7/* Endpoint */\
112+
)
113+
82114
/* Windows support YUY2 and NV12
83115
* https://docs.microsoft.com/en-us/windows-hardware/drivers/stream/usb-video-class-driver-overview */
84116

@@ -165,4 +197,75 @@ enum {
165197
/* EP */ \
166198
TUD_VIDEO_DESC_EP_ISO(_epin, _epsize, 1)
167199

200+
201+
#define TUD_VIDEO_CAPTURE_DESCRIPTOR_UNCOMPR_BULK(_stridx, _epin, _width, _height, _fps, _epsize) \
202+
TUD_VIDEO_DESC_IAD(ITF_NUM_VIDEO_CONTROL, /* 2 Interfaces */ 0x02, _stridx), \
203+
/* Video control 0 */ \
204+
TUD_VIDEO_DESC_STD_VC(ITF_NUM_VIDEO_CONTROL, 0, _stridx), \
205+
TUD_VIDEO_DESC_CS_VC( /* UVC 1.5*/ 0x0150, \
206+
/* wTotalLength - bLength */ \
207+
TUD_VIDEO_DESC_CAMERA_TERM_LEN + TUD_VIDEO_DESC_OUTPUT_TERM_LEN, \
208+
UVC_CLOCK_FREQUENCY, ITF_NUM_VIDEO_STREAMING), \
209+
TUD_VIDEO_DESC_CAMERA_TERM(UVC_ENTITY_CAP_INPUT_TERMINAL, 0, 0,\
210+
/*wObjectiveFocalLengthMin*/0, /*wObjectiveFocalLengthMax*/0,\
211+
/*wObjectiveFocalLength*/0, /*bmControls*/0), \
212+
TUD_VIDEO_DESC_OUTPUT_TERM(UVC_ENTITY_CAP_OUTPUT_TERMINAL, VIDEO_TT_STREAMING, 0, 1, 0), \
213+
/* Video stream alt. 0 */ \
214+
TUD_VIDEO_DESC_STD_VS(ITF_NUM_VIDEO_STREAMING, 0, 1, _stridx), \
215+
/* Video stream header for without still image capture */ \
216+
TUD_VIDEO_DESC_CS_VS_INPUT( /*bNumFormats*/1, \
217+
/*wTotalLength - bLength */\
218+
TUD_VIDEO_DESC_CS_VS_FMT_UNCOMPR_LEN\
219+
+ TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_CONT_LEN\
220+
+ TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING_LEN,\
221+
_epin, /*bmInfo*/0, /*bTerminalLink*/UVC_ENTITY_CAP_OUTPUT_TERMINAL, \
222+
/*bStillCaptureMethod*/0, /*bTriggerSupport*/0, /*bTriggerUsage*/0, \
223+
/*bmaControls(1)*/0), \
224+
/* Video stream format */ \
225+
TUD_VIDEO_DESC_CS_VS_FMT_YUY2(/*bFormatIndex*/1, /*bNumFrameDescriptors*/1, \
226+
/*bDefaultFrameIndex*/1, 0, 0, 0, /*bCopyProtect*/0), \
227+
/* Video stream frame format */ \
228+
TUD_VIDEO_DESC_CS_VS_FRM_UNCOMPR_CONT(/*bFrameIndex */1, 0, _width, _height, \
229+
_width * _height * 16, _width * _height * 16 * _fps, \
230+
_width * _height * 16, \
231+
(10000000/_fps), (10000000/_fps), (10000000/_fps)*_fps, (10000000/_fps)), \
232+
TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING(VIDEO_COLOR_PRIMARIES_BT709, VIDEO_COLOR_XFER_CH_BT709, VIDEO_COLOR_COEF_SMPTE170M), \
233+
TUD_VIDEO_DESC_EP_BULK(_epin, _epsize, 1)
234+
235+
#define TUD_VIDEO_CAPTURE_DESCRIPTOR_MJPEG_BULK(_stridx, _epin, _width, _height, _fps, _epsize) \
236+
TUD_VIDEO_DESC_IAD(ITF_NUM_VIDEO_CONTROL, /* 2 Interfaces */ 0x02, _stridx), \
237+
/* Video control 0 */ \
238+
TUD_VIDEO_DESC_STD_VC(ITF_NUM_VIDEO_CONTROL, 0, _stridx), \
239+
TUD_VIDEO_DESC_CS_VC( /* UVC 1.5*/ 0x0150, \
240+
/* wTotalLength - bLength */ \
241+
TUD_VIDEO_DESC_CAMERA_TERM_LEN + TUD_VIDEO_DESC_OUTPUT_TERM_LEN, \
242+
UVC_CLOCK_FREQUENCY, ITF_NUM_VIDEO_STREAMING), \
243+
TUD_VIDEO_DESC_CAMERA_TERM(UVC_ENTITY_CAP_INPUT_TERMINAL, 0, 0,\
244+
/*wObjectiveFocalLengthMin*/0, /*wObjectiveFocalLengthMax*/0,\
245+
/*wObjectiveFocalLength*/0, /*bmControls*/0), \
246+
TUD_VIDEO_DESC_OUTPUT_TERM(UVC_ENTITY_CAP_OUTPUT_TERMINAL, VIDEO_TT_STREAMING, 0, 1, 0), \
247+
/* Video stream alt. 0 */ \
248+
TUD_VIDEO_DESC_STD_VS(ITF_NUM_VIDEO_STREAMING, 0, 1, _stridx), \
249+
/* Video stream header for without still image capture */ \
250+
TUD_VIDEO_DESC_CS_VS_INPUT( /*bNumFormats*/1, \
251+
/*wTotalLength - bLength */\
252+
TUD_VIDEO_DESC_CS_VS_FMT_MJPEG_LEN\
253+
+ TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_CONT_LEN\
254+
+ TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING_LEN,\
255+
_epin, /*bmInfo*/0, /*bTerminalLink*/UVC_ENTITY_CAP_OUTPUT_TERMINAL, \
256+
/*bStillCaptureMethod*/0, /*bTriggerSupport*/0, /*bTriggerUsage*/0, \
257+
/*bmaControls(1)*/0), \
258+
/* Video stream format */ \
259+
TUD_VIDEO_DESC_CS_VS_FMT_MJPEG(/*bFormatIndex*/1, /*bNumFrameDescriptors*/1, \
260+
/*bmFlags*/0, /*bDefaultFrameIndex*/1, 0, 0, 0, /*bCopyProtect*/0), \
261+
/* Video stream frame format */ \
262+
TUD_VIDEO_DESC_CS_VS_FRM_MJPEG_CONT(/*bFrameIndex */1, 0, _width, _height, \
263+
_width * _height * 16, _width * _height * 16 * _fps, \
264+
_width * _height * 16 / 8, \
265+
(10000000/_fps), (10000000/_fps), (10000000/_fps)*_fps, (10000000/_fps)), \
266+
TUD_VIDEO_DESC_CS_VS_COLOR_MATCHING(VIDEO_COLOR_PRIMARIES_BT709, VIDEO_COLOR_XFER_CH_BT709, VIDEO_COLOR_COEF_SMPTE170M), \
267+
/* EP */ \
268+
TUD_VIDEO_DESC_EP_BULK(_epin, _epsize, 1)
269+
270+
168271
#endif

src/class/video/video_device.c

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
//--------------------------------------------------------------------+
3838
// MACRO CONSTANT TYPEDEF
3939
//--------------------------------------------------------------------+
40+
#define VS_STATE_PROBING 0 /* Configuration in progress */
41+
#define VS_STATE_COMMITTED 1 /* Ready for streaming or Streaming via bulk endpoint */
42+
#define VS_STATE_STREAMING 2 /* Streaming via isochronous endpoint */
43+
4044
typedef struct {
4145
tusb_desc_interface_t std;
4246
tusb_desc_cs_video_ctl_itf_hdr_t ctl;
@@ -102,6 +106,7 @@ typedef struct TU_ATTR_PACKED {
102106
uint32_t offset; /* offset for the next payload transfer */
103107
uint32_t max_payload_transfer_size;
104108
uint8_t error_code;/* error code */
109+
uint8_t state; /* 0:probing 1:committed 2:streaming */
105110
/*------------- From this point, data is not cleared by bus reset -------------*/
106111
CFG_TUSB_MEM_ALIGN uint8_t ep_buf[CFG_TUD_VIDEO_STREAMING_EP_BUFSIZE]; /* EP transfer buffer for streaming */
107112
} videod_streaming_interface_t;
@@ -639,6 +644,17 @@ static bool _open_vc_itf(uint8_t rhport, videod_interface_t *self, uint_fast8_t
639644
return true;
640645
}
641646

647+
static bool _init_vs_configuration(videod_streaming_interface_t *stm)
648+
{
649+
/* initialize streaming settings */
650+
stm->state = VS_STATE_PROBING;
651+
stm->max_payload_transfer_size = 0;
652+
video_probe_and_commit_control_t *param =
653+
(video_probe_and_commit_control_t *)&stm->ep_buf;
654+
tu_memclr(param, sizeof(*param));
655+
return _update_streaming_parameters(stm, param);
656+
}
657+
642658
/** Set the alternate setting to own video streaming interface.
643659
*
644660
* @param[in,out] stm Streaming interface context.
@@ -672,42 +688,32 @@ static bool _open_vs_itf(uint8_t rhport, videod_streaming_interface_t *stm, uint
672688

673689
uint_fast8_t numeps = ((tusb_desc_interface_t const *)cur)->bNumEndpoints;
674690
TU_ASSERT(numeps <= TU_ARRAY_SIZE(stm->desc.ep));
675-
stm->desc.cur = (uint16_t) (cur - desc); /* Save the offset of the new settings */
676-
if (!altnum) {
677-
/* initialize streaming settings */
678-
stm->max_payload_transfer_size = 0;
679-
video_probe_and_commit_control_t *param =
680-
(video_probe_and_commit_control_t *)&stm->ep_buf;
681-
tu_memclr(param, sizeof(*param));
682-
TU_LOG2(" done 0\n");
683-
return _update_streaming_parameters(stm, param);
691+
stm->desc.cur = (uint16_t)(cur - desc); /* Save the offset of the new settings */
692+
if (!altnum && (VS_STATE_COMMITTED != stm->state)) {
693+
TU_VERIFY(_init_vs_configuration(stm));
684694
}
685-
/* Open endpoints of the new settings. */
695+
/* Open bulk or isochronous endpoints of the new settings. */
686696
for (i = 0, cur = tu_desc_next(cur); i < numeps; ++i, cur = tu_desc_next(cur)) {
687697
cur = _find_desc_ep(cur, end);
688698
TU_ASSERT(cur < end);
689699
tusb_desc_endpoint_t const *ep = (tusb_desc_endpoint_t const*)cur;
690-
if (!stm->max_payload_transfer_size) {
691-
video_probe_and_commit_control_t const *param = (video_probe_and_commit_control_t const*)&stm->ep_buf;
692-
uint_fast32_t max_size = param->dwMaxPayloadTransferSize;
700+
uint_fast32_t max_size = stm->max_payload_transfer_size;
701+
if (altnum) {
693702
if ((TUSB_XFER_ISOCHRONOUS == ep->bmAttributes.xfer) &&
694-
(tu_edpt_packet_size(ep) < max_size))
695-
{
703+
(tu_edpt_packet_size(ep) < max_size)) {
696704
/* FS must be less than or equal to max packet size */
697705
return false;
698706
}
699-
/* Set the negotiated value */
700-
stm->max_payload_transfer_size = max_size;
707+
} else {
708+
TU_VERIFY(TUSB_XFER_BULK == ep->bmAttributes.xfer);
701709
}
702710
TU_ASSERT(usbd_edpt_open(rhport, ep));
703711
stm->desc.ep[i] = (uint16_t) (cur - desc);
704712
TU_LOG2(" open EP%02x\n", _desc_ep_addr(cur));
705713
}
706-
/* initialize payload header */
707-
tusb_video_payload_header_t *hdr = (tusb_video_payload_header_t*)stm->ep_buf;
708-
hdr->bHeaderLength = sizeof(*hdr);
709-
hdr->bmHeaderInfo = 0;
710-
714+
if (altnum) {
715+
stm->state = VS_STATE_STREAMING;
716+
}
711717
TU_LOG2(" done\n");
712718
return true;
713719
}
@@ -920,6 +926,10 @@ static int handle_video_stm_cs_req(uint8_t rhport, uint8_t stage,
920926
break;
921927

922928
case VIDEO_VS_CTL_PROBE:
929+
if (self->state != VS_STATE_PROBING) {
930+
self->state = VS_STATE_PROBING;
931+
_init_vs_configuration(self);
932+
}
923933
switch (request->bRequest) {
924934
case VIDEO_REQUEST_SET_CUR:
925935
if (stage == CONTROL_STAGE_SETUP) {
@@ -982,9 +992,23 @@ static int handle_video_stm_cs_req(uint8_t rhport, uint8_t stage,
982992
TU_VERIFY(sizeof(video_probe_and_commit_control_t) >= request->wLength, VIDEO_ERROR_UNKNOWN);
983993
TU_VERIFY(tud_control_xfer(rhport, request, self->ep_buf, sizeof(video_probe_and_commit_control_t)), VIDEO_ERROR_UNKNOWN);
984994
} else if (stage == CONTROL_STAGE_DATA) {
985-
TU_VERIFY(_update_streaming_parameters(self, (video_probe_and_commit_control_t*)self->ep_buf), VIDEO_ERROR_INVALID_VALUE_WITHIN_RANGE);
995+
video_probe_and_commit_control_t *param = (video_probe_and_commit_control_t*)self->ep_buf;
996+
TU_VERIFY(_update_streaming_parameters(self, param), VIDEO_ERROR_INVALID_VALUE_WITHIN_RANGE);
997+
/* Set the negotiated value */
998+
self->max_payload_transfer_size = param->dwMaxPayloadTransferSize;
999+
int ret = VIDEO_ERROR_NONE;
9861000
if (tud_video_commit_cb) {
987-
return tud_video_commit_cb(self->index_vc, self->index_vs, (video_probe_and_commit_control_t*)self->ep_buf);
1001+
ret = tud_video_commit_cb(self->index_vc, self->index_vs, param);
1002+
}
1003+
if (VIDEO_ERROR_NONE == ret) {
1004+
self->state = VS_STATE_COMMITTED;
1005+
self->buffer = NULL;
1006+
self->bufsize = 0;
1007+
self->offset = 0;
1008+
/* initialize payload header */
1009+
tusb_video_payload_header_t *hdr = (tusb_video_payload_header_t*)self->ep_buf;
1010+
hdr->bHeaderLength = sizeof(*hdr);
1011+
hdr->bmHeaderInfo = 0;
9881012
}
9891013
}
9901014
return VIDEO_ERROR_NONE;
@@ -1069,6 +1093,7 @@ bool tud_video_n_streaming(uint_fast8_t ctl_idx, uint_fast8_t stm_idx)
10691093
TU_ASSERT(stm_idx < CFG_TUD_VIDEO_STREAMING);
10701094
videod_streaming_interface_t *stm = _get_instance_streaming(ctl_idx, stm_idx);
10711095
if (!stm || !stm->desc.ep[0]) return false;
1096+
if (stm->state == VS_STATE_PROBING) return false;
10721097
return true;
10731098
}
10741099

@@ -1079,6 +1104,7 @@ bool tud_video_n_frame_xfer(uint_fast8_t ctl_idx, uint_fast8_t stm_idx, void *bu
10791104
if (!buffer || !bufsize) return false;
10801105
videod_streaming_interface_t *stm = _get_instance_streaming(ctl_idx, stm_idx);
10811106
if (!stm || !stm->desc.ep[0] || stm->buffer) return false;
1107+
if (stm->state == VS_STATE_PROBING) return false;
10821108

10831109
/* Find EP address */
10841110
uint8_t const *desc = _videod_itf[stm->index_vc].beg;
@@ -1174,6 +1200,16 @@ uint16_t videod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uin
11741200
stm->desc.beg = (uint16_t) ((uintptr_t)cur - (uintptr_t)itf_desc);
11751201
cur = _next_desc_itf(cur, end);
11761202
stm->desc.end = (uint16_t) ((uintptr_t)cur - (uintptr_t)itf_desc);
1203+
stm->state = VS_STATE_PROBING;
1204+
if (0 == stm_idx && 1 == bInCollection) {
1205+
/* If there is only one streaming interface and no alternate settings,
1206+
* host may not issue set_interface so open the streaming interface here. */
1207+
uint8_t const *sbeg = (uint8_t const*)itf_desc + stm->desc.beg;
1208+
uint8_t const *send = (uint8_t const*)itf_desc + stm->desc.end;
1209+
if (end == _find_desc_itf(sbeg, send, _desc_itfnum(sbeg), 1)) {
1210+
TU_VERIFY(_open_vs_itf(rhport, stm, 0), 0);
1211+
}
1212+
}
11771213
}
11781214
self->len = (uint16_t) ((uintptr_t)cur - (uintptr_t)itf_desc);
11791215
return (uint16_t) ((uintptr_t)cur - (uintptr_t)itf_desc);
@@ -1187,7 +1223,6 @@ bool videod_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_
11871223
int err;
11881224
TU_VERIFY(request->bmRequestType_bit.recipient == TUSB_REQ_RCPT_INTERFACE);
11891225
uint_fast8_t itfnum = tu_u16_low(request->wIndex);
1190-
11911226
/* Identify which control interface to use */
11921227
uint_fast8_t itf;
11931228
for (itf = 0; itf < CFG_TUD_VIDEO; ++itf) {

0 commit comments

Comments
 (0)