Skip to content

Commit

Permalink
WDT debug
Browse files Browse the repository at this point in the history
  • Loading branch information
stas-sl committed Apr 13, 2024
1 parent 3832eeb commit 89fe838
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions components/i2s/i2s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 0 additions & 4 deletions components/sound_level_meter/sound_level_meter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ void SoundLevelMeter::task(void *param) {
SoundLevelMeter *this_ = reinterpret_cast<SoundLevelMeter *>(param);
std::vector<float> 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) {
Expand Down

0 comments on commit 89fe838

Please sign in to comment.