diff options
| author | Ha Thach <[email protected]> | 2026-03-10 10:06:45 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-03-10 10:06:45 +0700 |
| commit | 7ddf63151d840d804ea16f6f27ad18619df3ec66 (patch) | |
| tree | b1465c97091555720d2350bd4ef9f56573a4d40f | |
| parent | e98d32a304a92418572f5fd65908beeab2183556 (diff) | |
| parent | 7ca457cc3d244aac813c274a6e9ed80f9a70e68a (diff) | |
Merge pull request #3543 from YixingShen/master
_end_of_control_descriptor return when std.bNumEndpoints > 0
| -rw-r--r-- | src/class/video/video_device.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/class/video/video_device.c b/src/class/video/video_device.c index d1c699940..bbcfe45d5 100644 --- a/src/class/video/video_device.c +++ b/src/class/video/video_device.c @@ -399,13 +399,7 @@ static void const* _find_desc_ep(void const *beg, void const *end) static inline void const* _end_of_control_descriptor(void const *desc) { tusb_desc_vc_itf_t const *vc = (tusb_desc_vc_itf_t const *)desc; - uint8_t const *end = (uint8_t const*)desc + vc->std.bLength - + tu_le16toh(vc->ctl.wTotalLength); - if (vc->std.bNumEndpoints) { - end += sizeof(tusb_desc_endpoint_t); // standard EP descriptor - end += 5; // class-specific EP descriptor (fixed 5 bytes per UVC spec) - } - return end; + return ((uint8_t const*) desc) + vc->std.bLength + tu_le16toh(vc->ctl.wTotalLength); } /** Find the first entity descriptor with the entity ID |
