Skip to content

Commit 4092fc4

Browse files
Lucme-no-dev
Luc
authored andcommitted
Add baudRate function (espressif#651)
usefull for ESP8266 compatibility
1 parent 17add63 commit 4092fc4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

cores/esp32/HardwareSerial.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ size_t HardwareSerial::write(const uint8_t *buffer, size_t size)
8989
uartWriteBuf(_uart, buffer, size);
9090
return size;
9191
}
92+
uint32_t HardwareSerial::baudRate()
9293

94+
{
95+
return uartGetBaudRate(_uart);
96+
}
9397
HardwareSerial::operator bool() const
9498
{
9599
return true;

cores/esp32/HardwareSerial.h

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class HardwareSerial: public Stream
6666
{
6767
return write((uint8_t) n);
6868
}
69+
uint32_t baudRate();
6970
operator bool() const;
7071

7172
void setDebugOutput(bool);

0 commit comments

Comments
 (0)