Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for event queue overflow in usbd / dcd_event_handler #1662

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/device/usbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

//--------------------------------------------------------------------+
Expand Down
4 changes: 2 additions & 2 deletions src/host/usbh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

//--------------------------------------------------------------------+
Expand Down
1 change: 0 additions & 1 deletion src/osal/osal_none.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 0 additions & 1 deletion src/osal/osal_pico.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Loading