From 66cdb761dc26d3c76fd54705aefc1ef7212e38d7 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Sat, 24 Jul 2021 11:55:25 +0200 Subject: [PATCH] Fix minor build issues with Arduino ESP32 2.0.0-rc1 (#2057) --- esphome/components/uart/uart.h | 1 + esphome/components/uart/uart_esp32.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/esphome/components/uart/uart.h b/esphome/components/uart/uart.h index cd54290c73..1dc1e18412 100644 --- a/esphome/components/uart/uart.h +++ b/esphome/components/uart/uart.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include "esphome/core/esphal.h" #include "esphome/core/component.h" diff --git a/esphome/components/uart/uart_esp32.cpp b/esphome/components/uart/uart_esp32.cpp index 89de4c0cc1..16d683e4a6 100644 --- a/esphome/components/uart/uart_esp32.cpp +++ b/esphome/components/uart/uart_esp32.cpp @@ -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: