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

Implementation of HardwareSerial::availableForWrite() (MSP430) #1071

Open
brawner opened this issue Sep 16, 2021 · 0 comments
Open

Implementation of HardwareSerial::availableForWrite() (MSP430) #1071

brawner opened this issue Sep 16, 2021 · 0 comments

Comments

@brawner
Copy link

brawner commented Sep 16, 2021

Greetings, this is a feature request to implement Arduino's HardwareSerial::availableForWrite(). Because of the limited ring buffer size, any call to HardwareSerial::write() that exceeds the available space in the ring buffer will cause that function call to block.
https://github.com/energia/Energia/blob/master/hardware/msp430/cores/msp430/HardwareSerial.cpp#L231

On other boards, I typically have large amounts of serial traffic to send periodically and will store it in a byte array. I use the availableToWrite() to check whether bytes can be written and only write until the ring buffer is full so write() itself won't block.

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

No branches or pull requests

1 participant