Skip to content

Minor changes to support ESP32-S6 and esphome 2025.2.2 #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/i2s/i2s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void I2SComponent::dump_config() {
LOG_PIN(" BCK Pin: ", this->bck_pin_);
LOG_PIN(" DIN Pin: ", this->din_pin_);
LOG_PIN(" DOUT Pin: ", this->dout_pin_);
ESP_LOGCONFIG(TAG, " Sample Rate: %u", this->sample_rate_);
ESP_LOGCONFIG(TAG, " Sample Rate: %lu", this->sample_rate_);
ESP_LOGCONFIG(TAG, " Bits Per Sample: %u", this->bits_per_sample_);
ESP_LOGCONFIG(TAG, " DMA Buf Count: %u", this->dma_buf_count_);
ESP_LOGCONFIG(TAG, " DMA Buf Len: %u", this->dma_buf_len_);
Expand Down Expand Up @@ -143,7 +143,7 @@ void I2SComponent::setup() {
.use_apll = this->use_apll_,
.tx_desc_auto_clear = false,
.fixed_mclk = 0,
.mclk_multiple = I2S_MCLK_MULTIPLE_DEFAULT,
.mclk_multiple = I2S_MCLK_MULTIPLE_256,
.bits_per_chan = i2s_bits_per_chan_t(0)};

i2s_pin_config_t i2s_pin_config = {
Expand Down
9 changes: 5 additions & 4 deletions components/sound_level_meter/sound_level_meter.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "sound_level_meter.h"
#include "esp_timer.h"

namespace esphome {
namespace sound_level_meter {
Expand Down Expand Up @@ -37,8 +38,8 @@ optional<float> SoundLevelMeter::get_offset() { return this->offset_; }
void SoundLevelMeter::dump_config() {
ESP_LOGCONFIG(TAG, "Sound Level Meter:");
ESP_LOGCONFIG(TAG, " Buffer Size: %u (samples)", this->buffer_size_);
ESP_LOGCONFIG(TAG, " Warmup Interval: %u ms", this->warmup_interval_);
ESP_LOGCONFIG(TAG, " Task Stack Size: %u", this->task_stack_size_);
ESP_LOGCONFIG(TAG, " Warmup Interval: %lu ms", this->warmup_interval_);
ESP_LOGCONFIG(TAG, " Task Stack Size: %lu", this->task_stack_size_);
ESP_LOGCONFIG(TAG, " Task Priority: %u", this->task_priority_);
ESP_LOGCONFIG(TAG, " Task Core: %u", this->task_core_);
LOG_UPDATE_INTERVAL(this);
Expand Down Expand Up @@ -117,7 +118,7 @@ void SoundLevelMeter::task(void *param) {
auto sr = this_->get_sample_rate();
if (process_count >= sr * (this_->update_interval_ / 1000.f)) {
auto t = uint32_t(float(process_time) / process_count * (sr / 1000.f));
ESP_LOGD(TAG, "Processing time per 1s of audio data (%u samples): %u ms", sr, t);
ESP_LOGD(TAG, "Processing time per 1s of audio data (%lu samples): %lu ms", sr, t);
process_time = process_count = 0;
}
}
Expand Down Expand Up @@ -362,4 +363,4 @@ void SOS_Filter::reset() {
s = {0.f, 0.f};
}
} // namespace sound_level_meter
} // namespace esphome
} // namespace esphome