Pages: [1]   Go Down
Author Topic: Suggested enhancement for HardwareSerial  (Read 349 times)
0 Members and 1 Guest are viewing this topic.
Huntsville, Alabama, USA
Offline Offline
Sr. Member
Karma: 2
Posts: 327
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It would be very simple to add a new method to the HardwareSerial class.    The new method could be called 'txready' or something similar.  It would return true if the transmit data register is empty.

This way, a sketch could check to see if the UART is ready for another character before calling Serial.write().  The way it works now, a call to Serial.write() could wait while the last character shifts out.  With Serial.txready(), your sketch could be doing other things while a character is being transmitted.


Global Moderator
Online Online
Shannon Member
Karma: 211
Posts: 13044
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I like the idea.

Pages: [1]   Go Up
Jump to: