提交 4092fc40 编写于 作者: L Luc 提交者: Me No Dev

Add baudRate function (#651)

usefull for ESP8266 compatibility
上级 17add631
...@@ -89,7 +89,11 @@ size_t HardwareSerial::write(const uint8_t *buffer, size_t size) ...@@ -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;
......
...@@ -66,6 +66,7 @@ public: ...@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册