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 #pragma once
#include <vector>
#include <HardwareSerial.h> #include <HardwareSerial.h>
#include "esphome/core/esphal.h" #include "esphome/core/esphal.h"
#include "esphome/core/component.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_EVEN = 0 << 0;
static const uint32_t UART_PARITY_ODD = 1 << 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_5 = 0 << 2;
static const uint32_t UART_NB_BIT_6 = 1 << 2; static const uint32_t UART_NB_BIT_6 = 1 << 2;
static const uint32_t UART_NB_BIT_7 = 2 << 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) 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) 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_) { switch (this->data_bits_) {
case 5: case 5: