Skip to content

Commit

Permalink
modbus-rtu: esp-idf port, make sure line endings are ignored on UART
Browse files Browse the repository at this point in the history
By default some line ending conversion may be done, so make sure to
disable this on the UART used with libmodbus.
  • Loading branch information
fedepell committed Nov 19, 2024
1 parent a4eb887 commit 4c22fff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modbus-rtu.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@ static int _modbus_rtu_connect(modbus_t *ctx)
}

uart_vfs_dev_use_driver(uart_num);
uart_vfs_dev_port_set_rx_line_endings(uart_num, ESP_LINE_ENDINGS_LF);
uart_vfs_dev_port_set_tx_line_endings(uart_num, ESP_LINE_ENDINGS_LF);

return 0;
}
Expand Down

0 comments on commit 4c22fff

Please sign in to comment.