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:
Claude Heintz 2017-06-22 12:40:31 -05:00 committed by Me No Dev
parent 839318c0eb
commit 23acb4d17b

View File

@ -195,6 +195,13 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx
uartSetBaudRate(uart, baudrate);
UART_MUTEX_LOCK();
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();
if(rxPin != -1) {