Update TasmotaSerial.cpp

This commit is contained in:
Theo Arends 2020-06-01 15:45:22 +02:00 committed by GitHub
parent f1a2fb2b8d
commit 02375d6b28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -174,7 +174,9 @@ bool TasmotaSerial::begin(long speed, int stop_bits) {
m_uart = tasmota_serial_index;
tasmota_serial_index--;
TSerial = new HardwareSerial(m_uart);
if (TM_SERIAL_BUFFER_SIZE != serial_buffer_size) TSerial->setRxBufferSize(serial_buffer_size);
if (serial_buffer_size > 256) {
TSerial->setRxBufferSize(serial_buffer_size);
}
if (2 == m_stop_bits) {
TSerial->begin(speed, SERIAL_8N2, m_rx_pin, m_tx_pin);
} else {