Skip to content

Implement Print::availableForWrite #353

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

Merged
merged 1 commit into from
May 30, 2017

Conversation

eric-wieser
Copy link
Contributor

This was added in arduino/Arduino#5789

Not implemented yet for USB serial, as that is harder.

That shouldn't stop this patch being merged though - without this change, some Arduino code won't even compile.

This was added in arduino/Arduino#5789

Not implemented yet for USB serial, as that is harder
// default to zero, meaning "a single write may block"
// should be overriden by subclasses with buffering
virtual int availableForWrite() { return 0; }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is taken straight from arduino/Arduino

@EmbeddedMan
Copy link
Member

This seems just fine to me. @majenkotech any issues with this PR?

@majenkotech
Copy link
Member

Looks good to me. Simple test of the TX buffer full bit, and a virtual default function.

Not sure how we would go about implementing this for the USB though - have to dig into the TX implementation.

@EmbeddedMan
Copy link
Member

Agreed. That's going to be a bit more work.

@EmbeddedMan EmbeddedMan merged commit 840270e into chipKIT32:master May 30, 2017
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.

3 participants