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

Add availableForWrite method to Serial. #311

Merged
merged 2 commits into from
Jul 31, 2019

Conversation

pyro9
Copy link
Contributor

@pyro9 pyro9 commented Jul 26, 2019

Add availableForWrite method to Serial
Compatible with the standard Arduino API. This will apply cleanly on top of the fix_serial patch.

Copy link
Member

@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 very much for your PR. I didn't know there is availableForWrite() method. There are only a couple of small things to change. Please change it and I am happy to merge this. Thanks again :)

@@ -190,6 +190,11 @@ bool tud_cdc_n_write_flush (uint8_t itf)
return true;
}

uint32_t tud_cdc_n_availableForWrite (uint8_t itf)
Copy link
Member

Choose a reason for hiding this comment

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

  • I think tu_fifo_remaining() is a better way to implement this. Would you mind changing it
  • Also please rename the function to tud_cdc_n_write_available(), the stack uses all lower cases convention.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have made the requested changes in a 2nd commit.

rename low level CDC functions to tud_cdc_n_write_available and tud_cdc_write_available
Copy link
Member

@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 very much for the PR, tinyusb stack repo will be updated to add this write_available() API as well :)

@hathach hathach merged commit 393c83e into adafruit:master Jul 31, 2019
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