freemodbus: fix modbus rs485 rts enable fail v42

This commit is contained in:
aleks 2020-12-10 17:30:08 +01:00 committed by Alex Lisitsyn
parent 9f0c9ff2f0
commit 4c5099d194
2 changed files with 3 additions and 3 deletions

View File

@ -119,7 +119,7 @@ BOOL xMBPortSerialTxPoll(void)
}
ESP_LOGD(TAG, "MB_TX_buffer send: (%d) bytes\n", (uint16_t)usCount);
// Waits while UART sending the packet
esp_err_t xTxStatus = uart_wait_tx_done(ucUartNumber, MB_SERIAL_TX_TOUT_TICKS);
esp_err_t xTxStatus = uart_wait_tx_idle_polling(ucUartNumber);
vMBPortSerialEnable(TRUE, FALSE);
MB_PORT_CHECK((xTxStatus == ESP_OK), FALSE, "mb serial sent buffer failure.");
return TRUE;

View File

@ -113,8 +113,8 @@ BOOL xMBMasterPortSerialTxPoll(void)
}
ESP_LOGD(TAG, "MB_TX_buffer sent: (%d) bytes.", (uint16_t)(usCount - 1));
// Waits while UART sending the packet
esp_err_t xTxStatus = uart_wait_tx_done(ucUartNumber, MB_SERIAL_TX_TOUT_TICKS);
vMBMasterPortSerialEnable( TRUE, FALSE );
esp_err_t xTxStatus = uart_wait_tx_idle_polling(ucUartNumber);
vMBMasterPortSerialEnable(TRUE, FALSE);
MB_PORT_CHECK((xTxStatus == ESP_OK), FALSE, "mb serial sent buffer failure.");
return TRUE;
}