summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/stm32/uart.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ports/stm32/uart.c b/ports/stm32/uart.c
index a2b69967b..9f7441617 100644
--- a/ports/stm32/uart.c
+++ b/ports/stm32/uart.c
@@ -474,10 +474,11 @@ bool uart_init(pyb_uart_obj_t *uart_obj,
}
uint32_t mode = MP_HAL_PIN_MODE_ALT;
- uint32_t pull = MP_HAL_PIN_PULL_UP;
for (uint i = 0; i < 4; i++) {
if (pins[i] != NULL) {
+ // Configure pull-up on RX and CTS (the input pins).
+ uint32_t pull = (i & 1) ? MP_HAL_PIN_PULL_UP : MP_HAL_PIN_PULL_NONE;
bool ret = mp_hal_pin_config_alt(pins[i], mode, pull, uart_fn, uart_unit);
if (!ret) {
return false;