Pages: [1]   Go Down
Author Topic: Suggested enhancement for HardwareSerial  (Read 336 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.

-Mike
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 206
Posts: 12897
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I like the idea.
Logged

Pages: [1]   Go Up
Jump to: