Commit 5af139bb authored by Tomasz Ścisłowicz's avatar Tomasz Ścisłowicz Committed by Me No Dev

HardwareSerial - add changeBaudRate method (#2223)

* Add updateBaudRate to hardware serial

* remove flush

* Fix tab
parent 4f9a90fa
...@@ -73,6 +73,11 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in ...@@ -73,6 +73,11 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in
} }
} }
void HardwareSerial::updateBaudRate(unsigned long baud)
{
uartSetBaudRate(_uart, baud);
}
void HardwareSerial::end() void HardwareSerial::end()
{ {
if(uartGetDebug() == _uart_nr) { if(uartGetDebug() == _uart_nr) {
......
...@@ -57,6 +57,7 @@ public: ...@@ -57,6 +57,7 @@ public:
void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false, unsigned long timeout_ms = 20000UL); void begin(unsigned long baud, uint32_t config=SERIAL_8N1, int8_t rxPin=-1, int8_t txPin=-1, bool invert=false, unsigned long timeout_ms = 20000UL);
void end(); void end();
void updateBaudRate(unsigned long baud);
int available(void); int available(void);
int availableForWrite(void); int availableForWrite(void);
int peek(void); int peek(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment