Add baudRate function (#651)

usefull for ESP8266 compatibility
This commit is contained in:
Luc 2017-09-21 17:00:12 +08:00 committed by Me No Dev
parent 17add63139
commit 4092fc409e
2 changed files with 5 additions and 0 deletions

View File

@ -89,7 +89,11 @@ size_t HardwareSerial::write(const uint8_t *buffer, size_t size)
uartWriteBuf(_uart, buffer, size); uartWriteBuf(_uart, buffer, size);
return size; return size;
} }
uint32_t HardwareSerial::baudRate()
{
return uartGetBaudRate(_uart);
}
HardwareSerial::operator bool() const HardwareSerial::operator bool() const
{ {
return true; return true;

View File

@ -66,6 +66,7 @@ public:
{ {
return write((uint8_t) n); return write((uint8_t) n);
} }
uint32_t baudRate();
operator bool() const; operator bool() const;
void setDebugOutput(bool); void setDebugOutput(bool);