You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When transmitting data over CDC from UART interrupt, the tud_cdc_n_write function can cause a flush, which is highly unwanted in an IRQ. I want to write 64/512 bytes to the buffer, and the rest shouldn't be written (return 0 for example). Flush will be called in main loop (or done automatically by tud_task().
This could be achieved by writing at most BULK_PACKET_SIZE - 1 bytes, but there is no function exposing current fifo level. While possible to calculate the number of bytes currently in the fifo by using tud_cdc_n_write_available, it will be rather cumbersome.
I'm aware that I can just write my own fifo (that's what the library runs right now), but why? There is a perfectly good fifo in TinyUSB code. Or is it really a good idea to use my own fifo?
How to reproduce ?
.
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
.
Screenshots
No response
I have checked existing issues, dicussion and documentation
I confirm I have checked existing issues, dicussion and documentation.
The text was updated successfully, but these errors were encountered:
Operating System
Linux
Board
RP2040
Firmware
Specifically this version, this fragment: https://github.com/MrJake222/pico-ice-sdk/blob/473e38978f7f8caab7e20c6b49f9f48623158dcf/src/ice_usb.c#L169-L175
What happened ?
When transmitting data over CDC from UART interrupt, the
tud_cdc_n_write
function can cause a flush, which is highly unwanted in an IRQ. I want to write 64/512 bytes to the buffer, and the rest shouldn't be written (return 0 for example). Flush will be called in main loop (or done automatically bytud_task()
.This could be achieved by writing at most
BULK_PACKET_SIZE - 1
bytes, but there is no function exposing current fifo level. While possible to calculate the number of bytes currently in the fifo by usingtud_cdc_n_write_available
, it will be rather cumbersome.I'm aware that I can just write my own fifo (that's what the library runs right now), but why? There is a perfectly good fifo in TinyUSB code. Or is it really a good idea to use my own fifo?
How to reproduce ?
.
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
.
Screenshots
No response
I have checked existing issues, dicussion and documentation
The text was updated successfully, but these errors were encountered: