summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakimisu <[email protected]>2023-02-07 22:55:25 +0800
committersakimisu <[email protected]>2023-02-07 22:55:31 +0800
commit4070603e572c5407e94527d702d006dc62bee250 (patch)
treeb843944e48169325b09c9e3aa2766a87d3d0ebc8
parent3fa3f3e3565134d7a54a1177419bd9a08e454bcc (diff)
submit urb when nbytes>0
-rw-r--r--demo/usb_host.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/demo/usb_host.c b/demo/usb_host.c
index 0abc4c22..f62670b9 100644
--- a/demo/usb_host.c
+++ b/demo/usb_host.c
@@ -26,9 +26,8 @@ void usbh_cdc_acm_callback(void *arg, int nbytes)
for (size_t i = 0; i < nbytes; i++) {
USB_LOG_RAW("0x%02x ", cdc_buffer[i]);
}
+ USB_LOG_RAW("nbytes:%d\r\n", nbytes);
}
-
- USB_LOG_RAW("nbytes:%d\r\n", nbytes);
}
static void usbh_cdc_acm_thread(void *argument)
@@ -102,10 +101,9 @@ void usbh_hid_callback(void *arg, int nbytes)
for (size_t i = 0; i < nbytes; i++) {
USB_LOG_RAW("0x%02x ", hid_buffer[i]);
}
+ USB_LOG_RAW("nbytes:%d\r\n", nbytes);
+ usbh_submit_urb(&hid_intin_urb);
}
-
- USB_LOG_RAW("nbytes:%d\r\n", nbytes);
- usbh_submit_urb(&hid_intin_urb);
}
static void usbh_hid_thread(void *argument)