Skip to content

CDC: tud_cdc_write returns 0. How to fix? #753

Answered by hathach
ned-pcs asked this question in Q&A
Discussion options

You must be logged in to vote
Thanks for your attention. I don't think it'll be necessary to do that.
It turns out that what was happening was that there was not quite enough space for a whole message.
I added a check of `tud_cdc_write_available()`, and if that said that there wasn't enough space for a whole message, I did a `tud_cdc_write_flush()`.
That fixed the issue!

Originally posted by @ned-pcs in #761 (comment)

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ned-pcs
Comment options

Comment options

You must be logged in to vote
1 reply
@ned-pcs
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by hathach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants