From 1e8e440721f8475960f45cf43b5c89cd44c8d95d Mon Sep 17 00:00:00 2001 From: sakumisu <1203593632@qq.com> Date: Wed, 16 Jul 2025 22:54:21 +0800 Subject: [PATCH] fix(demo): ignore zero bytes for bl ip Signed-off-by: sakumisu <1203593632@qq.com> --- demo/video_audiov1_hid_template.c | 4 ++++ demo/video_static_h264_template.c | 4 ++++ demo/video_static_mjpeg_template.c | 4 ++++ demo/video_static_yuyv_template.c | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/demo/video_audiov1_hid_template.c b/demo/video_audiov1_hid_template.c index 1d1948c9..99df89b9 100644 --- a/demo/video_audiov1_hid_template.c +++ b/demo/video_audiov1_hid_template.c @@ -448,6 +448,10 @@ void usbd_video_close(uint8_t busid, uint8_t intf) void usbd_video_iso_callback(uint8_t busid, uint8_t ep, uint32_t nbytes) { + if (nbytes == 0) { + return; + } + if (usbd_video_stream_split_transfer(busid, ep)) { /* one frame has done */ video_iso_tx_busy = false; diff --git a/demo/video_static_h264_template.c b/demo/video_static_h264_template.c index a472244b..7337f5f7 100644 --- a/demo/video_static_h264_template.c +++ b/demo/video_static_h264_template.c @@ -252,6 +252,10 @@ void usbd_video_close(uint8_t busid, uint8_t intf) void usbd_video_iso_callback(uint8_t busid, uint8_t ep, uint32_t nbytes) { + if (nbytes == 0) { + return; + } + if (usbd_video_stream_split_transfer(busid, ep)) { /* one frame has done */ iso_tx_busy = false; diff --git a/demo/video_static_mjpeg_template.c b/demo/video_static_mjpeg_template.c index 667a2fbb..3fc923f8 100644 --- a/demo/video_static_mjpeg_template.c +++ b/demo/video_static_mjpeg_template.c @@ -252,6 +252,10 @@ void usbd_video_close(uint8_t busid, uint8_t intf) void usbd_video_iso_callback(uint8_t busid, uint8_t ep, uint32_t nbytes) { + if (nbytes == 0) { + return; + } + if (usbd_video_stream_split_transfer(busid, ep)) { /* one frame has done */ iso_tx_busy = false; diff --git a/demo/video_static_yuyv_template.c b/demo/video_static_yuyv_template.c index 6b5da39d..7c7d1789 100644 --- a/demo/video_static_yuyv_template.c +++ b/demo/video_static_yuyv_template.c @@ -256,6 +256,10 @@ void usbd_video_close(uint8_t busid, uint8_t intf) void usbd_video_iso_callback(uint8_t busid, uint8_t ep, uint32_t nbytes) { + if (nbytes == 0) { + return; + } + if (usbd_video_stream_split_transfer(busid, ep)) { /* one frame has done */ iso_tx_busy = false;