27 lines
989 B
Diff
27 lines
989 B
Diff
From 2c3482e2d00146be3b50fb2506ed7d029c8f298f Mon Sep 17 00:00:00 2001
|
|
From: Martino Facchin <m.facchin@arduino.cc>
|
|
Date: Wed, 24 Mar 2021 11:55:51 +0100
|
|
Subject: [PATCH 051/204] RP2040: UART: baud can't be changed at runtime
|
|
|
|
---
|
|
targets/TARGET_RASPBERRYPI/TARGET_RP2040/serial_api.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/serial_api.c b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/serial_api.c
|
|
index 6a90e64323..8d95f6c2a3 100644
|
|
--- a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/serial_api.c
|
|
+++ b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/serial_api.c
|
|
@@ -76,7 +76,8 @@ void serial_free(serial_t *obj)
|
|
void serial_baud(serial_t *obj, int baudrate)
|
|
{
|
|
obj->baud = (uint32_t)baudrate;
|
|
- uart_set_baudrate(obj->dev, obj->baud);
|
|
+ uart_init(obj->dev, obj->baud);
|
|
+ uart_set_fifo_enabled(obj->dev, false);
|
|
}
|
|
|
|
void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits)
|
|
--
|
|
2.39.1
|
|
|