Fix minor build issues with Arduino ESP32 2.0.0-rc1 (#2057)

This commit is contained in:
Stefan Agner 2021-07-24 11:55:25 +02:00 committed by GitHub
parent f0d9ad6a4e
commit 66cdb761dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -1,5 +1,6 @@
#pragma once
#include <vector>
#include <HardwareSerial.h>
#include "esphome/core/esphal.h"
#include "esphome/core/component.h"

View file

@ -12,7 +12,7 @@ uint8_t next_uart_num = 1;
static const uint32_t UART_PARITY_EVEN = 0 << 0;
static const uint32_t UART_PARITY_ODD = 1 << 0;
static const uint32_t UART_PARITY_EN = 1 << 1;
static const uint32_t UART_PARITY_ENABLE = 1 << 1;
static const uint32_t UART_NB_BIT_5 = 0 << 2;
static const uint32_t UART_NB_BIT_6 = 1 << 2;
static const uint32_t UART_NB_BIT_7 = 2 << 2;
@ -39,9 +39,9 @@ uint32_t UARTComponent::get_config() {
*/
if (this->parity_ == UART_CONFIG_PARITY_EVEN)
config |= UART_PARITY_EVEN | UART_PARITY_EN;
config |= UART_PARITY_EVEN | UART_PARITY_ENABLE;
else if (this->parity_ == UART_CONFIG_PARITY_ODD)
config |= UART_PARITY_ODD | UART_PARITY_EN;
config |= UART_PARITY_ODD | UART_PARITY_ENABLE;
switch (this->data_bits_) {
case 5: