Two Stop Bit Workaround (#461)
* Update esp32-hal-uart.c * Two Stop Bit Workaround see https://github.com/espressif/esp-idf/blob/master/components/driver/uart.c lines 118-127
This commit is contained in:
parent
839318c0eb
commit
23acb4d17b
@ -195,6 +195,13 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx
|
|||||||
uartSetBaudRate(uart, baudrate);
|
uartSetBaudRate(uart, baudrate);
|
||||||
UART_MUTEX_LOCK();
|
UART_MUTEX_LOCK();
|
||||||
uart->dev->conf0.val = config;
|
uart->dev->conf0.val = config;
|
||||||
|
#define TWO_STOP_BITS_CONF 0x3
|
||||||
|
#define ONE_STOP_BITS_CONF 0x1
|
||||||
|
|
||||||
|
if ( uart->dev->conf0.stop_bit_num == TWO_STOP_BITS_CONF) {
|
||||||
|
uart->dev->conf0.stop_bit_num = ONE_STOP_BITS_CONF;
|
||||||
|
uart->dev->rs485_conf.dl1_en = 1;
|
||||||
|
}
|
||||||
UART_MUTEX_UNLOCK();
|
UART_MUTEX_UNLOCK();
|
||||||
|
|
||||||
if(rxPin != -1) {
|
if(rxPin != -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user