-
Notifications
You must be signed in to change notification settings - Fork 1.2k
cdc: Fix autoflush for FIFO < MPS #1487
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
Conversation
|
7cf5f75
to
bf22f89
Compare
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.
LGTM
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.
sorry for late response, I was too busy with other works. The reason for change request: although it has more code, the additional condition CFG_TUD_CDC_TX_BUFSIZE < BULK_PACKET_SIZE
is constant expression and will help the compiler to optimize it out.
Therefore we don't have to run tu_fifo_full() when bufsize is larger than the packet size (and const expression also not executed at all in other case)
bf22f89
to
603effb
Compare
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.
thank for the update
Describe the PR
If CDC TX buffer size is configured to be less than bulk packet size, the autoflushing condition is never reached.
Changes:
Additional context
Found out during espressif/esp-idf#9040