[OpenWrt-Devel] [PATCH v5 1/2] serial: ar933x_uart: add rs485 support
Petr Štetiar
ynezz at true.cz
Wed Feb 12 11:33:59 EST 2020
Daniel Golle <daniel at makrotopia.org> [2020-02-12 16:37:36]:
...
> ++static inline int ar933x_uart_is_half_duplex(struct ar933x_uart_port *up)
> ++{
That function name is quite confusing as it's checking for 485/HD.
> ++ return (up->port.rs485.flags & SER_RS485_ENABLED) &&
> ++ !(up->port.rs485.flags & SER_RS485_RX_DURING_TX);
> ++}
...
> +- if (!uart_circ_empty(xmit))
> ++ if (!uart_circ_empty(xmit)) {
> + ar933x_uart_start_tx_interrupt(up);
> ++ } else if (ar933x_uart_is_half_duplex(up)) {
> ++ ar933x_uart_wait_tx_complete(up);
> ++ ar933x_uart_rx_flush(up);
> ++ ar933x_uart_start_rx_interrupt(up);
> ++ }
This change looks strange, how are these two related? Where do you re-enable
the TX interrupts in that 485/HD case?
-- ynezz
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list