Skip to content

Commit

Permalink
Fix Serial.write(0) overloading (#5878)
Browse files Browse the repository at this point in the history
Add missing "using Print::write" to the HWSerial class to get the proper
overrides to make Serial.write(0) and Serial1.write(0) work as expected.
  • Loading branch information
earlephilhower authored Mar 14, 2019
1 parent e46ccae commit 9365f6d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cores/esp8266/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,7 @@ class HardwareSerial: public Stream
{
return uart_write(_uart, (const char*)buffer, size);
}
size_t write(const char *buffer)
{
return buffer? uart_write(_uart, buffer, strlen(buffer)): 0;
}
using Print::write; // Import other write() methods to support things like write(0) properly
operator bool() const
{
return _uart != 0;
Expand Down

0 comments on commit 9365f6d

Please sign in to comment.