1
0
mirror of https://github.com/esphome/esphome.git synced 2025-01-18 12:05:41 +00:00

[uart] Use `SOC_UART_NUM as number of uarts instead of UART_NUM_MAX` (#7967)

This commit is contained in:
Jesse Hills 2024-12-16 18:52:34 +13:00 committed by GitHub
parent e04743e381
commit 1a89aa8fbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -1,9 +1,9 @@
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
#include "uart_component_esp32_arduino.h"
#include "esphome/core/application.h"
#include "esphome/core/defines.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#include "uart_component_esp32_arduino.h"
#ifdef USE_LOGGER
#include "esphome/components/logger/logger.h"
@ -118,7 +118,7 @@ void ESP32ArduinoUARTComponent::setup() {
}
#endif // USE_LOGGER
if (next_uart_num >= UART_NUM_MAX) {
if (next_uart_num >= SOC_UART_NUM) {
ESP_LOGW(TAG, "Maximum number of UART components created already.");
this->mark_failed();
return;

View File

@ -1,11 +1,11 @@
#ifdef USE_ESP_IDF
#include "uart_component_esp_idf.h"
#include <cinttypes>
#include "esphome/core/application.h"
#include "esphome/core/defines.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#include <cinttypes>
#ifdef USE_LOGGER
#include "esphome/components/logger/logger.h"
@ -84,7 +84,7 @@ void IDFUARTComponent::setup() {
}
#endif // USE_LOGGER
if (next_uart_num >= UART_NUM_MAX) {
if (next_uart_num >= SOC_UART_NUM) {
ESP_LOGW(TAG, "Maximum number of UART components created already.");
this->mark_failed();
return;