-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add notification support for device class USBTMC #2494
Conversation
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.
src/class/usbtmc/usbtmc_device.c
Outdated
#endif | ||
if (usbd_edpt_busy(usbtmc_state.rhport, usbtmc_state.ep_int_in)) return false; | ||
|
||
TU_VERIFY(usbd_edpt_xfer(usbtmc_state.rhport, usbtmc_state.ep_int_in, (void *)(uintptr_t) data, len)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the failing constness check by casting to uintptr_t, as done in other places.
Not a TMC expert, just to mention there is no buffering inside tinyusb/src/class/usbtmc/usbtmc_device.c Line 129 in 9e674fa
|
Yes, I documented that the buffer must remain valid until the Re. TMC, I had to ditch it for two reasons:
In the end, it seemed TMC as a spec was more in the way than useful. |
I just realized the lacking of buffer copying in bulk IN transfer is problematic, as some MCU require buffer to be placed into a special RAM region and has alignment requirement. To ensure compatibility I had to add it. For this reason I've added a buffer for INT transfer with size configured by |
The
ep_int_in
is already used for responding to USB488READ_STATUS_BYTE
requests, but that EP is defined for the entire USBTMC class. This extends the functionality to let callers send notifications and receive ACKs.Tested on an RP2040.