diff options
| author | Ha Thach <[email protected]> | 2024-04-16 10:58:15 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-16 10:58:15 +0700 |
| commit | f3781a45d807fe431f567a8e1028ed062c51ec58 (patch) | |
| tree | 6483dab66f96436d38d107ea7f2c0454650179e2 | |
| parent | fcb2df8eb916fb14d53778361cdde173175d0a2d (diff) | |
| parent | 189080b684b298e0b3e7df6528f24a43c646ab8c (diff) | |
Merge pull request #1662 from Erlkoenig90/check-usbd-queue-overflow
Check for event queue overflow in usbd / dcd_event_handler
| -rw-r--r-- | src/device/usbd.c | 4 | ||||
| -rw-r--r-- | src/host/usbh.c | 4 | ||||
| -rw-r--r-- | src/osal/osal_none.h | 1 | ||||
| -rw-r--r-- | src/osal/osal_pico.h | 1 |
4 files changed, 4 insertions, 6 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index 109c3462d..e51aa0fc4 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -296,9 +296,9 @@ tu_static osal_queue_t _usbd_q; #endif TU_ATTR_ALWAYS_INLINE static inline bool queue_event(dcd_event_t const * event, bool in_isr) { - bool ret = osal_queue_send(_usbd_q, event, in_isr); + TU_ASSERT(osal_queue_send(_usbd_q, event, in_isr)); tud_event_hook_cb(event->rhport, event->event_id, in_isr); - return ret; + return true; } //--------------------------------------------------------------------+ diff --git a/src/host/usbh.c b/src/host/usbh.c index 6a5491998..f8fddf394 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -288,9 +288,9 @@ TU_ATTR_WEAK void osal_task_delay(uint32_t msec) { #endif TU_ATTR_ALWAYS_INLINE static inline bool queue_event(hcd_event_t const * event, bool in_isr) { - bool ret = osal_queue_send(_usbh_q, event, in_isr); + TU_ASSERT(osal_queue_send(_usbh_q, event, in_isr)); tuh_event_hook_cb(event->rhport, event->event_id, in_isr); - return ret; + return true; } //--------------------------------------------------------------------+ diff --git a/src/osal/osal_none.h b/src/osal/osal_none.h index c954fcfe8..c93f7a86c 100644 --- a/src/osal/osal_none.h +++ b/src/osal/osal_none.h @@ -180,7 +180,6 @@ TU_ATTR_ALWAYS_INLINE static inline bool osal_queue_send(osal_queue_t qhdl, void _osal_q_unlock(qhdl); } - TU_ASSERT(success); return success; } diff --git a/src/osal/osal_pico.h b/src/osal/osal_pico.h index 00c589ef9..315de0950 100644 --- a/src/osal/osal_pico.h +++ b/src/osal/osal_pico.h @@ -145,7 +145,6 @@ TU_ATTR_ALWAYS_INLINE static inline bool osal_queue_send(osal_queue_t qhdl, void bool success = tu_fifo_write(&qhdl->ff, data); critical_section_exit(&qhdl->critsec); - TU_ASSERT(success); return success; } |
