1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

[esp32] Remove IDF 4 support and clean up code (#9145)

This commit is contained in:
Jonathan Swoboda
2025-07-01 12:22:41 -04:00
committed by GitHub
parent 35de36d690
commit 3470305d9d
23 changed files with 34 additions and 267 deletions

View File

@@ -9,14 +9,7 @@ from esphome.components.esp32.const import (
VARIANT_ESP32S3,
)
import esphome.config_validation as cv
from esphome.const import (
CONF_BITS_PER_SAMPLE,
CONF_CHANNEL,
CONF_ID,
CONF_SAMPLE_RATE,
KEY_CORE,
KEY_FRAMEWORK_VERSION,
)
from esphome.const import CONF_BITS_PER_SAMPLE, CONF_CHANNEL, CONF_ID, CONF_SAMPLE_RATE
from esphome.core import CORE
from esphome.cpp_generator import MockObjClass
import esphome.final_validate as fv
@@ -250,8 +243,7 @@ def _final_validate(_):
def use_legacy():
framework_version = CORE.data[KEY_CORE][KEY_FRAMEWORK_VERSION]
if CORE.using_esp_idf and framework_version >= cv.Version(5, 0, 0):
if CORE.using_esp_idf:
if not _use_legacy_driver:
return False
return True

View File

@@ -9,15 +9,11 @@ namespace i2s_audio {
static const char *const TAG = "i2s_audio";
#if ESP_IDF_VERSION_MAJOR >= 5
static const uint8_t I2S_NUM_MAX = SOC_I2S_NUM; // because IDF 5+ took this away :(
#endif
void I2SAudioComponent::setup() {
ESP_LOGCONFIG(TAG, "Running setup");
static i2s_port_t next_port_num = I2S_NUM_0;
if (next_port_num >= I2S_NUM_MAX) {
if (next_port_num >= SOC_I2S_NUM) {
ESP_LOGE(TAG, "Too many components");
this->mark_failed();
return;