From 89fe838b33ca134cdf0dbc0d2cb77ab7ba109c1e Mon Sep 17 00:00:00 2001 From: Stas Sl Date: Sun, 14 Apr 2024 02:45:32 +0300 Subject: [PATCH] WDT debug --- components/i2s/i2s.cpp | 4 ++++ components/sound_level_meter/sound_level_meter.cpp | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/i2s/i2s.cpp b/components/i2s/i2s.cpp index 3491344..5adaa3e 100644 --- a/components/i2s/i2s.cpp +++ b/components/i2s/i2s.cpp @@ -43,7 +43,11 @@ void I2SComponent::dump_config() { } bool I2SComponent::read(uint8_t *data, size_t len, size_t *bytes_read, TickType_t ticks_to_wait) { + uint32_t start = esp_timer_get_time(); + ESP_LOGD(TAG, "before i2s_read"); esp_err_t err = i2s_read(i2s_port_t(this->port_num_), data, len, bytes_read, ticks_to_wait); + uint32_t duration = esp_timer_get_time() - start; + ESP_LOGD(TAG, "after i2s_read; duration: %u; CPU Core: %u", duration, xPortGetCoreID()); if (err != ESP_OK) { ESP_LOGW(TAG, "i2s_read failed: %s", esp_err_to_name(err)); diff --git a/components/sound_level_meter/sound_level_meter.cpp b/components/sound_level_meter/sound_level_meter.cpp index 80c9eae..7600312 100644 --- a/components/sound_level_meter/sound_level_meter.cpp +++ b/components/sound_level_meter/sound_level_meter.cpp @@ -94,10 +94,6 @@ void SoundLevelMeter::task(void *param) { SoundLevelMeter *this_ = reinterpret_cast(param); std::vector buffer(this_->buffer_size_); - auto warmup_start = millis(); - while (millis() - warmup_start < this_->warmup_interval_) - this_->i2s_->read_samples(buffer); - uint32_t process_time = 0, process_count = 0; uint64_t process_start; while (1) {