summaryrefslogtreecommitdiff
path: root/src/class/usbtmc/usbtmc_device.h
AgeCommit message (Collapse)Author
2026-08-14usbtmc: re-arm (or stall) the bulk-OUT endpoint after a USB488 TRIGGERice458
A single USB488 TRIGGER message left the bulk-OUT endpoint un-armed, so the host's next bulk-OUT transfer timed out. The trigger itself succeeded silently, so the failure surfaced on a later, unrelated command; only a USBTMC device clear recovered it. The bundled examples/device/usbtmc reproduced this as shipped. Every other branch of the STATE_IDLE dispatch in usbtmcd_xfer_cb() leaves the endpoint in a defined state: it either transitions out of STATE_IDLE so a later tud_usbtmc_start_bus_read() can re-arm it, or it stalls and lets the CLEAR_FEATURE(ENDPOINT_HALT) handler recover it. USBTMC_MSGID_USB488_TRIGGER did neither, and because the state stayed STATE_IDLE, even an application following the contract documented in usbtmc_device.h got a silent no-op from tud_usbtmc_start_bus_read(). Transition to STATE_NAK so the re-arm can take effect, and stall the endpoint when trigger is unsupported or the application callback rejects it, matching the existing handling for messages the driver cannot process. The callback result is deliberately not wrapped in TU_VERIFY(), which would return before the stall/re-arm and reintroduce the same hang. Since the driver now re-arms after a trigger, drop tud_usbtmc_msg_trigger_cb from the list of callbacks after which the application must do so. Fixes #3821 Co-Authored-By: Claude Opus 5 <[email protected]>
2026-07-02license: use SPDX identifiers for src/ headers (#3749)Ha Thach
* license: use SPDX identifiers for src/ headers Replace the full ~20-line MIT license boilerplate on every src/ file with a two-line SPDX tag (SPDX-FileCopyrightText + SPDX-License-Identifier), following the REUSE convention used by CircuitPython and the Linux kernel. Removes ~3500 lines of duplicated boilerplate.
2025-09-18Potential fix for code scanning alert no. 914: Commented-out codeZixun LI
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-09-17Update weak callbacks to new syntaxHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2024-04-28Merge pull request #2494 from tommie/usbtmcnotifHiFiPhile
Add notification support for device class USBTMC
2024-04-27Buffer int msg to ensure alignment and placement correctness.HiFiPhile
2024-04-08add class driver deinithathach
2024-02-26add notification support for device class USBTMC.Tommie Gannert
The ep_int_in is already used for responding to USB488 READ_STATUS_BYTE requests, but that EP is defined for all of USBTMC. This extends the functionality to let callers send notifications and receive ACKs.
2022-12-04Fix typosBastien Nocera
2022-06-21Update USBTMC driver to support dynamic packet sizes (based on descriptor).NConrad
2022-06-17correct bulk size for highspeed endpoint in dynamic_configuration and usbtmc ↵hathach
exmaples
2021-10-15fix -Wcast-qualhathach
2020-11-20migrate usbtmc device to new control xfer cbhathach
2020-05-28update usbtmc open()hathach
2020-04-02Typo of usbtmc.Nathan Conrad
2019-09-25Remove _app from callback function names.Nathan Conrad
2019-09-25Change getting the capabilities structure to a callback instead of an extern ↵Nathan Conrad
struct.
2019-09-25Rename USBTMC functions.Nathan Conrad
2019-09-24I never understood why I need to write void as empty function arguments.Nathan Conrad
2019-09-24Remove rhport from app code. If anything, it should be the interface_id. ↵Nathan Conrad
Assume a single interface, for now.
2019-09-24Let application control interface latency...Nathan Conrad
2019-09-21Lots of updates (especially error handling)Nathan Conrad
2019-09-19Rename functions to include tud_ and _cbNathan Conrad
2019-09-19Rename USBTMC_CFG_ENABLE_488, and fix build with it off.Nathan Conrad
2019-09-19Move descriptors to usbd.hNathan Conrad
2019-09-18usbtmc updates....Nathan Conrad
2019-09-17changes 2Nathan Conrad
2019-09-17More proper handling of clear.Nathan Conrad
2019-09-17ClearNathan Conrad
2019-09-14Simulate query delay; getting to a point where implementing clear/aborts makesNathan Conrad
sense. Probably adding too many concurance issues; need to figure out semaphores.
2019-09-14Change requset type parameter back to uint8_t (fix type cast), support USB ↵Nathan Conrad
indicator pulse
2019-09-14Combined status response enum (std with 488), support trigger.Nathan Conrad
2019-09-14Add usbtmc class driver.Nathan Conrad