Skip to content

Commit d32417c

Browse files
committed
stm32/uart: Support board configs with CTS/RTS on UART6.
1 parent 9bcdb0a commit d32417c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ports/stm32/uart.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,16 @@ STATIC bool uart_init2(pyb_uart_obj_t *uart_obj) {
241241
irqn = USART6_IRQn;
242242
pins[0] = &MICROPY_HW_UART6_TX;
243243
pins[1] = &MICROPY_HW_UART6_RX;
244+
#if defined(MICROPY_HW_UART6_RTS)
245+
if (uart_obj->uart.Init.HwFlowCtl & UART_HWCONTROL_RTS) {
246+
pins[2] = &MICROPY_HW_UART6_RTS;
247+
}
248+
#endif
249+
#if defined(MICROPY_HW_UART6_CTS)
250+
if (uart_obj->uart.Init.HwFlowCtl & UART_HWCONTROL_CTS) {
251+
pins[3] = &MICROPY_HW_UART6_CTS;
252+
}
253+
#endif
244254
__USART6_CLK_ENABLE();
245255
break;
246256
#endif

0 commit comments

Comments
 (0)