1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-31 23:21:54 +00:00

Merge remote-tracking branch 'swoboda1337/bump_libretiny' into integration

This commit is contained in:
J. Nick Koston
2025-06-17 04:33:57 +02:00
3 changed files with 13 additions and 6 deletions

View File

@@ -136,6 +136,7 @@ bool I2SAudioMicrophone::start_driver_() {
if (!this->parent_->try_lock()) { if (!this->parent_->try_lock()) {
return false; // Waiting for another i2s to return lock return false; // Waiting for another i2s to return lock
} }
this->locked_driver_ = true;
esp_err_t err; esp_err_t err;
#ifdef USE_I2S_LEGACY #ifdef USE_I2S_LEGACY
@@ -340,7 +341,10 @@ void I2SAudioMicrophone::stop_driver_() {
this->rx_handle_ = nullptr; this->rx_handle_ = nullptr;
} }
#endif #endif
if (this->locked_driver_) {
this->parent_->unlock(); this->parent_->unlock();
this->locked_driver_ = false;
}
} }
void I2SAudioMicrophone::mic_task(void *params) { void I2SAudioMicrophone::mic_task(void *params) {
@@ -482,7 +486,8 @@ void I2SAudioMicrophone::loop() {
} }
if (!this->start_driver_()) { if (!this->start_driver_()) {
this->status_momentary_error("Driver failed to start; retrying in 1 second", 1000); ESP_LOGE(TAG, "Driver failed to start; retrying in 1 second");
this->status_momentary_error("driver_fail", 1000);
this->stop_driver_(); // Stop/frees whatever possibly started this->stop_driver_(); // Stop/frees whatever possibly started
break; break;
} }
@@ -492,7 +497,8 @@ void I2SAudioMicrophone::loop() {
&this->task_handle_); &this->task_handle_);
if (this->task_handle_ == nullptr) { if (this->task_handle_ == nullptr) {
this->status_momentary_error("Task failed to start, retrying in 1 second", 1000); ESP_LOGE(TAG, "Task failed to start, retrying in 1 second");
this->status_momentary_error("task_fail", 1000);
this->stop_driver_(); // Stops the driver to return the lock; will be reloaded in next attempt this->stop_driver_(); // Stops the driver to return the lock; will be reloaded in next attempt
} }
} }

View File

@@ -81,6 +81,7 @@ class I2SAudioMicrophone : public I2SAudioIn, public microphone::Microphone, pub
bool pdm_{false}; bool pdm_{false};
bool correct_dc_offset_; bool correct_dc_offset_;
bool locked_driver_{false};
int32_t dc_offset_{0}; int32_t dc_offset_{0};
}; };

View File

@@ -173,9 +173,9 @@ def _notify_old_style(config):
# The dev and latest branches will be at *least* this version, which is what matters. # The dev and latest branches will be at *least* this version, which is what matters.
ARDUINO_VERSIONS = { ARDUINO_VERSIONS = {
"dev": (cv.Version(1, 7, 0), "https://github.com/libretiny-eu/libretiny.git"), "dev": (cv.Version(1, 9, 1), "https://github.com/libretiny-eu/libretiny.git"),
"latest": (cv.Version(1, 7, 0), "libretiny"), "latest": (cv.Version(1, 9, 1), "libretiny"),
"recommended": (cv.Version(1, 7, 0), None), "recommended": (cv.Version(1, 9, 1), None),
} }