mirror of
https://github.com/esphome/esphome.git
synced 2025-01-18 20:10:55 +00:00
[uart] Use `SOC_UART_NUM
as number of uarts instead of
UART_NUM_MAX
` (#7967)
This commit is contained in:
parent
e04743e381
commit
1a89aa8fbf
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user