summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-07-08 11:05:16 +0700
committerhathach <[email protected]>2025-07-08 11:05:16 +0700
commit2908995c4c0a1221247c9d5aed7a5c9817dcb52e (patch)
treecf5e960a5bc3f2a22372e37c5797b544c3070466 /src/device
parenta56f55c10bea2ce0d38de6a04edae41e6c814b9f (diff)
minor reformat code
Diffstat (limited to 'src/device')
-rw-r--r--src/device/usbd.c5
-rw-r--r--src/device/usbd_pvt.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index b8c9d1b9e..a803301e3 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -1260,14 +1260,13 @@ TU_ATTR_FAST_FUNC void dcd_event_handler(dcd_event_t const* event, bool in_isr)
send = true;
break;
- case DCD_EVENT_XFER_COMPLETE:
- {
- send = true;
+ case DCD_EVENT_XFER_COMPLETE: {
// Invoke the class callback associated with the endpoint address
uint8_t const ep_addr = event->xfer_complete.ep_addr;
uint8_t const epnum = tu_edpt_number(ep_addr);
uint8_t const ep_dir = tu_edpt_dir(ep_addr);
+ send = true;
if(epnum > 0) {
usbd_class_driver_t const* driver = get_driver(_usbd_dev.ep2drv[epnum][ep_dir]);
diff --git a/src/device/usbd_pvt.h b/src/device/usbd_pvt.h
index 40622be66..f1797bf0d 100644
--- a/src/device/usbd_pvt.h
+++ b/src/device/usbd_pvt.h
@@ -57,7 +57,7 @@ typedef struct {
uint16_t (* open ) (uint8_t rhport, tusb_desc_interface_t const * desc_intf, uint16_t max_len);
bool (* control_xfer_cb ) (uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);
bool (* xfer_cb ) (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes);
- bool (* xfer_isr ) (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes); // optional
+ bool (* xfer_isr ) (uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint32_t xferred_bytes); // optional, return false to defer to xfer_cb()
void (* sof ) (uint8_t rhport, uint32_t frame_count); // optional
} usbd_class_driver_t;