1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-25 20:02:37 +03:00

Fix Serial.write(0) overloading (#5878)

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.
This commit is contained in:
Earle F. Philhower, III 2019-03-13 18:06:15 -07:00 committed by GitHub
parent e46ccae9d5
commit 9365f6d116
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,10 +156,7 @@ public:
{
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;