diff options
author | Damien George <damien.p.george@gmail.com> | 2017-12-23 19:01:23 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-12-23 19:03:16 +1100 |
commit | d32417c0969a9cea5edec0858e147102a5720ed2 (patch) | |
tree | 9fd699dd285964518a2ddb30076bf54c93685e1c | |
parent | 9bcdb0acd1ea059533ba01d8c8ccfd12adeb0eee (diff) |
stm32/uart: Support board configs with CTS/RTS on UART6.
-rw-r--r-- | ports/stm32/uart.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ports/stm32/uart.c b/ports/stm32/uart.c index b2962984f..659aa9943 100644 --- a/ports/stm32/uart.c +++ b/ports/stm32/uart.c @@ -241,6 +241,16 @@ STATIC bool uart_init2(pyb_uart_obj_t *uart_obj) { irqn = USART6_IRQn; pins[0] = &MICROPY_HW_UART6_TX; pins[1] = &MICROPY_HW_UART6_RX; + #if defined(MICROPY_HW_UART6_RTS) + if (uart_obj->uart.Init.HwFlowCtl & UART_HWCONTROL_RTS) { + pins[2] = &MICROPY_HW_UART6_RTS; + } + #endif + #if defined(MICROPY_HW_UART6_CTS) + if (uart_obj->uart.Init.HwFlowCtl & UART_HWCONTROL_CTS) { + pins[3] = &MICROPY_HW_UART6_CTS; + } + #endif __USART6_CLK_ENABLE(); break; #endif |