Skip to content

Commit 49b8eef

Browse files
authored
HardwareSerial's flush() method to override the method of the base class Print (#2254)
* add flush() method to HardwareSerial * remove default argument
1 parent 1863c25 commit 49b8eef

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: cores/arduino/HardwareSerial.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,11 @@ int HardwareSerial::availableForWrite(void)
487487
return tail - head - 1;
488488
}
489489

490+
void HardwareSerial::flush()
491+
{
492+
flush(0);
493+
}
494+
490495
void HardwareSerial::flush(uint32_t timeout)
491496
{
492497
// If we have never written a byte, no need to flush. This special

Diff for: cores/arduino/HardwareSerial.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ class HardwareSerial : public Stream {
125125
virtual int peek(void);
126126
virtual int read(void);
127127
int availableForWrite(void);
128-
virtual void flush(uint32_t timeout = 0);
128+
virtual void flush();
129+
void flush(uint32_t timeout);
129130
virtual size_t write(uint8_t);
130131
inline size_t write(unsigned long n)
131132
{

0 commit comments

Comments
 (0)