diff options
| author | hathach <[email protected]> | 2026-02-13 01:10:55 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-02-13 01:10:55 +0700 |
| commit | 35a90f213d75a4630adf576f50d2b5bc8f03456c (patch) | |
| tree | 42ab3bc2b3816d14bc93d5abb2c84e9286b70f08 /src/device | |
| parent | be24a38a65d8e22fed461b4058e3deb97d5a2907 (diff) | |
| parent | d13284d02da552c843e3ccbda4472083f25b0b16 (diff) | |
Merge branch 'refs/heads/master' into dwc2_vbus
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/usbd.c | 10 | ||||
| -rw-r--r-- | src/device/usbd.h | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index 1e21c667a..cca4169d7 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -666,8 +666,14 @@ void tud_task_ext(uint32_t timeout_ms, bool in_isr) { return; } - // Loop until there is no more events in the queue - while (1) { + // Loop until there are no more events in the queue or CFG_TUD_TASK_EVENTS_PER_RUN is reached + for (unsigned epr = 0;; epr++) { +#if CFG_TUD_TASK_EVENTS_PER_RUN > 0 + if (epr >= CFG_TUD_TASK_EVENTS_PER_RUN) { + TU_LOG_USBD("USBD event limit (" TU_XSTRING(CFG_TUD_TASK_EVENTS_PER_RUN) ") reached\r\n"); + break; + } +#endif dcd_event_t event; if (!osal_queue_receive(_usbd_q, &event, timeout_ms)) { return; diff --git a/src/device/usbd.h b/src/device/usbd.h index f923b1c56..7d7604c81 100644 --- a/src/device/usbd.h +++ b/src/device/usbd.h @@ -820,7 +820,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ /* Interface */ \ 9, TUSB_DESC_INTERFACE, _itfnum, 0, 0, TUD_DFU_APP_CLASS, TUD_DFU_APP_SUBCLASS, DFU_PROTOCOL_RT, _stridx, \ /* Function */ \ - 9, DFU_DESC_FUNCTIONAL, _attr, U16_TO_U8S_LE(_timeout), U16_TO_U8S_LE(_xfer_size), U16_TO_U8S_LE(0x0101) + 9, DFU_DESC_FUNCTIONAL, _attr, U16_TO_U8S_LE(_timeout), U16_TO_U8S_LE(_xfer_size), U16_TO_U8S_LE(0x0110) //--------------------------------------------------------------------+ // DFU Descriptor Templates @@ -834,7 +834,7 @@ bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_requ #define TUD_DFU_DESCRIPTOR(_itfnum, _alt_count, _stridx, _attr, _timeout, _xfer_size) \ TU_XSTRCAT(TUD_DFU_ALT_,_alt_count)(_itfnum, 0, _stridx), \ /* Function */ \ - 9, DFU_DESC_FUNCTIONAL, _attr, U16_TO_U8S_LE(_timeout), U16_TO_U8S_LE(_xfer_size), U16_TO_U8S_LE(0x0101) + 9, DFU_DESC_FUNCTIONAL, _attr, U16_TO_U8S_LE(_timeout), U16_TO_U8S_LE(_xfer_size), U16_TO_U8S_LE(0x0110) #define TUD_DFU_ALT(_itfnum, _alt, _stridx) \ /* Interface */ \ |
