Skip to content

Commit 4c22fff

Browse files
committed
modbus-rtu: esp-idf port, make sure line endings are ignored on UART
By default some line ending conversion may be done, so make sure to disable this on the UART used with libmodbus.
1 parent a4eb887 commit 4c22fff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/modbus-rtu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,8 @@ static int _modbus_rtu_connect(modbus_t *ctx)
588588
}
589589

590590
uart_vfs_dev_use_driver(uart_num);
591+
uart_vfs_dev_port_set_rx_line_endings(uart_num, ESP_LINE_ENDINGS_LF);
592+
uart_vfs_dev_port_set_tx_line_endings(uart_num, ESP_LINE_ENDINGS_LF);
591593

592594
return 0;
593595
}

0 commit comments

Comments
 (0)