Skip to content

Commit 23acb4d

Browse files
claudeheintzme-no-dev
authored andcommitted
Two Stop Bit Workaround (espressif#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
1 parent 839318c commit 23acb4d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cores/esp32/esp32-hal-uart.c

+7
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx
195195
uartSetBaudRate(uart, baudrate);
196196
UART_MUTEX_LOCK();
197197
uart->dev->conf0.val = config;
198+
#define TWO_STOP_BITS_CONF 0x3
199+
#define ONE_STOP_BITS_CONF 0x1
200+
201+
if ( uart->dev->conf0.stop_bit_num == TWO_STOP_BITS_CONF) {
202+
uart->dev->conf0.stop_bit_num = ONE_STOP_BITS_CONF;
203+
uart->dev->rs485_conf.dl1_en = 1;
204+
}
198205
UART_MUTEX_UNLOCK();
199206

200207
if(rxPin != -1) {

0 commit comments

Comments
 (0)