Skip to content

Commit bba0c6d

Browse files
Fix Serial.write(0) overloading
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.
1 parent e46ccae commit bba0c6d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cores/esp8266/HardwareSerial.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ class HardwareSerial: public Stream
156156
{
157157
return uart_write(_uart, (const char*)buffer, size);
158158
}
159-
size_t write(const char *buffer)
160-
{
161-
return buffer? uart_write(_uart, buffer, strlen(buffer)): 0;
162-
}
159+
using Print::write; // Import other write() methods to support things like write(0) properly
163160
operator bool() const
164161
{
165162
return _uart != 0;

0 commit comments

Comments
 (0)