Skip to content
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

vendor: Write improvements #1289

Merged
merged 2 commits into from
Mar 6, 2022
Merged

Conversation

kasjer
Copy link
Collaborator

@kasjer kasjer commented Jan 19, 2022

Describe the PR
Other drivers already have notification about data sent.
It allows batter control in application on vendor protocol level.

So far tud_vendor_n_write() always flushed data.
It requires to have whole vendor packed constructed before in one buffer.

With this change data do get flushed when endpoint size
is filled on write, when there is no enough data to
fill endpoint data is not sent and subsequent calls to
write functions can add more bytes.

Vendor code needs to call tud_vendor_n_flush() when packet is
ready to be sent.

Additional context

Other drivers already have notification about data sent.
It allows batter control in application on vendor
protocol level.
So far tud_vendor_n_write() always flushed data.
It requires to have whole vendor packed constructed
before in one buffer.

With this change data do get flushed when endpoint size
is filled on write, when there is no enough data to
fill endpoint data is not sent and subsequent calls to
write functions can add more bytes.

Vendor code needs to call tud_vendor_n_flush() when packet is
ready to be sent.
@kasjer kasjer requested a review from hathach January 19, 2022 14:11
@kasjer kasjer changed the title vendor: Add tx callback vendor: Write improvements Jan 19, 2022
Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR. Look great

@hathach hathach merged commit 4c6bb16 into hathach:master Mar 6, 2022
@kasjer kasjer deleted the kasjer/vendor-update branch March 6, 2022 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants