Skip to content
Snippets Groups Projects
Commit 76ca382f authored by Sandeep Mistry's avatar Sandeep Mistry
Browse files

Add Uart::availableForWrite()

parent 2df644e6
No related branches found
No related tags found
No related merge requests found
...@@ -77,6 +77,11 @@ int Uart::available() ...@@ -77,6 +77,11 @@ int Uart::available()
return rxBuffer.available(); return rxBuffer.available();
} }
int Uart::availableForWrite()
{
return (sercom->isDataRegisterEmptyUART() ? 1 : 0);
}
int Uart::peek() int Uart::peek()
{ {
return rxBuffer.peek(); return rxBuffer.peek();
......
...@@ -32,6 +32,7 @@ class Uart : public HardwareSerial ...@@ -32,6 +32,7 @@ class Uart : public HardwareSerial
void begin(unsigned long baudrate, uint16_t config); void begin(unsigned long baudrate, uint16_t config);
void end(); void end();
int available(); int available();
int availableForWrite();
int peek(); int peek();
int read(); int read();
void flush(); void flush();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment