Skip to content

Commit 89ddfc5

Browse files
committed
Add set_baud() method to UARTSerial().
1 parent d121a43 commit 89ddfc5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

drivers/UARTSerial.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ void UARTSerial::dcd_irq()
4343
wake();
4444
}
4545

46+
void UARTSerial::set_baud(int baud)
47+
{
48+
SerialBase::baud(baud);
49+
}
50+
4651
void UARTSerial::set_data_carrier_detect(PinName dcd_pin, bool active_high)
4752
{
4853
delete _dcd_irq;

drivers/UARTSerial.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ class UARTSerial : private SerialBase, public FileHandle {
157157
*/
158158
void set_data_carrier_detect(PinName dcd_pin, bool active_high = false);
159159

160+
/** Set the baud rate
161+
*
162+
* @param baud The baud rate
163+
*/
164+
void set_baud(int baud);
165+
160166
private:
161167

162168
/** Software serial buffers

0 commit comments

Comments
 (0)