summaryrefslogtreecommitdiff
path: root/src/device/usbd_control.c
AgeCommit message (Collapse)Author
2026-05-04refactor `usbd.c`: centralize control transfer state management into ↵hathach
`_usbd_dev` structure and remove `usbd_control_reset`
2026-04-29deprecated `usbd_control.c` and merge its functionality into `usbd.c`hathach
2026-04-29clean uphathach
2026-04-28Merge branch 'master' into fork/kira-live/masterhathach
# Conflicts: # src/device/usbd_control.c
2026-04-26usbd_control: consolidate status stage ep selectionhathach
Extract the "which endpoint is the Status stage on" rule into a single TU_ATTR_ALWAYS_INLINE helper, and use it from both status_stage_xact() and the completion callback. Replaces the two-operand wLength/direction check with a direct endpoint-match comparison, matching the first operand's pattern. Per USB 2.0 §9.3.1, when wLength == 0 the bmRequestType Direction bit is ignored and the Status stage is always IN; otherwise the Status stage is opposite to the Data stage direction. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-04-25clean uphathach
2026-04-24fix zero wLength request in control requestakari
2026-03-11refactor(usbd): replace `_usbd_ctrl_epbuf` with `usbd_get_ctrl_buf()` for ↵hathach
cleaner abstraction and consistency across modules
2025-12-14reduce code sizeHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2025-12-14usbd: add ep0 buffer direct accessHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2025-11-19Merge remote-tracking branch 'tinyusb/master' into ↵HiFiPhile
copilot/fix-dcd-edpt-xfer-issue Signed-off-by: HiFiPhile <[email protected]>
2025-11-19rename CFG_TUD_ENDPOINT0_BUFSIZE to make it more consistenthathach
use uint8_t for dfu state and status to reduce size
2025-11-19Merge branch 'refs/heads/master' into dwc2_ep0hathach
# Conflicts: # examples/device/dfu/src/usb_descriptors.c # examples/device/dfu_runtime/src/usb_descriptors.c # src/device/usbd_control.c # src/portable/synopsys/dwc2/dcd_dwc2.c
2025-11-11Merge remote-tracking branch 'tinyusb/master' into ↵HiFiPhile
copilot/fix-dcd-edpt-xfer-issue Signed-off-by: HiFiPhile <[email protected]>
2025-11-05added .clang-formathathach
fix more alerts disable IAR CStat since pvs-studio check is better integrated with clion
2025-10-22Add is_isr parameter to usbd_edpt_xfer and usbd_edpt_xfer_fifocopilot-swe-agent[bot]
- Added bool is_isr parameter to usbd_edpt_xfer() and usbd_edpt_xfer_fifo() wrapper functions - These are called by class drivers to queue USB transfers - Updated all callers to pass false by default (non-ISR context) - Updated audiod_rx_xfer_isr() and audiod_tx_xfer_isr() to pass true (ISR context) - All 21 unit tests pass Co-authored-by: HiFiPhile <[email protected]>
2025-10-10usbd: support set EP0 buffer sizeHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2024-12-13change OPT_MCU_RAXXX, fix missing prototype warnings.hathach
2024-11-28refactor(usbd_control): Updated the buffer name for deeper debugRoman Leonov
2024-11-21use TUD_EPBUF_DEF to declare buffer memory for midihathach
2024-11-21make sure usb buffer occupies whole cache line when DCACHE is enabled for ↵hathach
msc,cdc,hid HIL enable device DMA for p4
2024-09-03make function prototypes match ( found by cppcheck)dp111
2024-01-12style changeshathach
2024-01-12- change tuh_event_hook_cb, tud_event_hook_cb to weak default implementationhathach
- change code style
2023-08-29Fix the weak dcd_edpt0_status_complete for Keil CompilerAlexander Mueller
The Keil compiler seems to have different semantics and the defined function was never called. The same is probably true for the other weak functions. I can change those too.
2023-07-24rename CFG_TUSB_MEM_SECTION to CFG_TUD_MEM_SECTION in device stackhathach
CFG_TUD_MEM_SECTION is default to CFG_TUSB_MEM_SECTION
2023-07-20improve logging, allow easier to turn off usbd, driver logginghathach
can be useful when focusing on let's say usbh
2023-05-16correct EHCI reporting failed xfer (instead of stalled) when device is unpluggedhathach
2023-02-27Merge pull request #1852 from silvergasp/mem_sHa Thach
fix: Replace device calls to memcpy with tu_memcpy_s
2023-02-27minor clean uphathach
2023-02-22use tu_static instead of static _fuzz_threadhathach
2023-02-22rename maros from FUZZ to _FUZZ, change TU_STATIC to static _fuzz_threadhathach
2023-01-20fix: Change all static variables to thread when fuzzingNathaniel Brough
2023-01-13fix: Replace device calls to memcpy with tu_memcpy_sNathaniel Brough
Introduces a new function tu_memcpy_s, which is effectively a backport of memcpy_s. The change also refactors calls to memcpy over to the more secure tu_memcpy_s.
2022-06-24fix redundant-decls warnings by usbd/usbhhathach
2022-06-24add more warning option, also fix -Wconversion with rp2040hathach
-Wuninitialized, -Wunused, -Wredundant-decls
2022-02-25rename TUSB_OPT_DEVICE_ENABLED to CFG_TUD_ENABLEDhathach
TUSB_OPT_DEVICE_ENABLED still usable for backward compatible
2021-07-01better support for hid device set/get protocolhathach
add caplock detection for hid_composite
2021-03-26Add DFU Class per Version 1.1 SpecJeremiah McCarthy
2021-02-11remove the requirement of std SET/CLEAR_FEATURE must not return zlp statushathach
2020-12-20Fix error if "Required Prototype" is selected.HiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2020-11-19migrate cdc_device to new control_xfer_cbhathach
2020-11-19merge class driver control_request & control_complete to control_xfer_cb()hathach
migrated msc_device
2020-05-07device: fix build warning when CFG_TUSB_DEBUG >= 2Sean Cross
The function is defined inside of a function body which generates a warning. Circuit Python treats these warnings as errors, and so refuses to build with debugging enabled: ../../lib/tinyusb/src/device/usbd_control.c: In function 'usbd_control_xfer_cb': ../../lib/tinyusb/src/device/usbd_control.c:195:19: error: nested extern declaration of 'usbd_driver_print_control_complete_name' [-Werror=nested-externs] 195 | extern void usbd_driver_print_control_complete_name(bool (*control_complete) (uint8_t, tusb_control_request_t const *)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make: *** [../../py/mkrules.mk:55: build-simmel/lib/tinyusb/src/device/usbd_control.o] Error 1 Move the declaration to the top of the function to silence this warning. Signed-off-by: Sean Cross <[email protected]>
2020-04-28fix typohathach
2020-04-26clean up log messagehathach
2020-04-26add usbd edpt openhathach
- RTT mode is blocking to prevent log lost - Improve logging message
2020-03-27USBD: Use tud_control_xfer only for dataNathan Conrad
2020-03-22Merge branch 'master' into cr1901-msp430f5529hathach
2020-03-14Use CRLF on UART.Nathan Conrad