ESPHome  2024.4.1
i2s_audio.cpp
Go to the documentation of this file.
1 #include "i2s_audio.h"
2 
3 #ifdef USE_ESP32
4 
5 #include "esphome/core/log.h"
6 
7 namespace esphome {
8 namespace i2s_audio {
9 
10 static const char *const TAG = "i2s_audio";
11 
13  static i2s_port_t next_port_num = I2S_NUM_0;
14 
15  if (next_port_num >= I2S_NUM_MAX) {
16  ESP_LOGE(TAG, "Too many I2S Audio components!");
17  this->mark_failed();
18  return;
19  }
20 
21  this->port_ = next_port_num;
22  next_port_num = (i2s_port_t) (next_port_num + 1);
23 
24  ESP_LOGCONFIG(TAG, "Setting up I2S Audio...");
25 }
26 
27 } // namespace i2s_audio
28 } // namespace esphome
29 
30 #endif // USE_ESP32
virtual void mark_failed()
Mark this component as failed.
Definition: component.cpp:118
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7