Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cores/arduino/HardwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,11 @@ int HardwareSerial::availableForWrite(void)
return tail - head - 1;
}

void HardwareSerial::flush()
{
flush(0);
}

void HardwareSerial::flush(uint32_t timeout)
{
// If we have never written a byte, no need to flush. This special
Expand Down
3 changes: 2 additions & 1 deletion cores/arduino/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ class HardwareSerial : public Stream {
virtual int peek(void);
virtual int read(void);
int availableForWrite(void);
virtual void flush(uint32_t timeout = 0);
virtual void flush();
void flush(uint32_t timeout);
virtual size_t write(uint8_t);
inline size_t write(unsigned long n)
{
Expand Down