diff --git a/components/freemodbus/Kconfig b/components/freemodbus/Kconfig index fd4314b..b6d3d29 100644 --- a/components/freemodbus/Kconfig +++ b/components/freemodbus/Kconfig @@ -1,29 +1,5 @@ menu "Modbus configuration" -config MB_UART_RXD - int "UART RXD pin number" - range 0 34 - default 22 - help - GPIO number for UART RX pin. See UART documentation for more information - about available pin numbers for UART. - -config MB_UART_TXD - int "UART TXD pin number" - range 0 34 - default 23 - help - GPIO number for UART TX pin. See UART documentation for more information - about available pin numbers for UART. - -config MB_UART_RTS - int "UART RTS pin number" - range 0 34 - default 18 - help - GPIO number for UART RTS pin. This pin is connected to - ~RE/DE pin of RS485 transceiver to switch direction. - config MB_QUEUE_LENGTH int "Modbus serial task queue length" range 0 200 diff --git a/components/freemodbus/port/portserial.c b/components/freemodbus/port/portserial.c index e9103d0..3543135 100644 --- a/components/freemodbus/port/portserial.c +++ b/components/freemodbus/port/portserial.c @@ -231,19 +231,11 @@ BOOL xMBPortSerialInit(UCHAR ucPORT, ULONG ulBaudRate, xErr = uart_param_config(ucUartNumber, &xUartConfig); MB_PORT_CHECK((xErr == ESP_OK), FALSE, "mb config failure, uart_param_config() returned (0x%x).", (uint32_t)xErr); - // Set UART pin numbers - xErr = uart_set_pin(ucUartNumber, MB_UART_TXD, MB_UART_RXD, MB_UART_RTS, UART_PIN_NO_CHANGE); - MB_PORT_CHECK((xErr == ESP_OK), FALSE, - "mb set pin failure, uart_set_pin() returned (0x%x).", (uint32_t)xErr); // Install UART driver, and get the queue. xErr = uart_driver_install(ucUartNumber, MB_SERIAL_BUF_SIZE, MB_SERIAL_BUF_SIZE, MB_QUEUE_LENGTH, &xMbUartQueue, ESP_INTR_FLAG_LOWMED); MB_PORT_CHECK((xErr == ESP_OK), FALSE, "mb serial driver failure, uart_driver_install() returned (0x%x).", (uint32_t)xErr); - // Set driver mode to Half Duplex - xErr = uart_set_mode(ucUartNumber, UART_MODE_RS485_HALF_DUPLEX); - MB_PORT_CHECK((xErr == ESP_OK), FALSE, - "mb serial set mode failure, uart_set_mode() returned (0x%x).", (uint32_t)xErr); #ifndef MB_TIMER_PORT_ENABLED // Set timeout for TOUT interrupt (T3.5 modbus time) xErr = uart_set_rx_timeout(ucUartNumber, MB_SERIAL_TOUT);