Fix parity bit calculation for ESP8266SoftwareSerial (#1873)

This commit is contained in:
Eric Severance 2021-08-01 01:56:05 -07:00 committed by GitHub
parent 593a3d48fb
commit 81ae6709e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,9 +242,9 @@ void ICACHE_RAM_ATTR HOT ESP8266SoftwareSerial::write_byte(uint8_t data) {
bool parity_bit = false; bool parity_bit = false;
bool need_parity_bit = true; bool need_parity_bit = true;
if (this->parity_ == UART_CONFIG_PARITY_EVEN) if (this->parity_ == UART_CONFIG_PARITY_EVEN)
parity_bit = true;
else if (this->parity_ == UART_CONFIG_PARITY_ODD)
parity_bit = false; parity_bit = false;
else if (this->parity_ == UART_CONFIG_PARITY_ODD)
parity_bit = true;
else else
need_parity_bit = false; need_parity_bit = false;