[multiple] Fix reliability issues in 5 components (#14655)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
5 files changed
+37
-2
No files matched your search
@@ -271,10 +271,16 @@ void BME680BSECComponent::read_() {
|
||||
int64_t curr_time_ns = this->get_time_ns_();
|
||||
|
||||
if (this->bme680_settings_.trigger_measurement) {
|
||||
uint32_t start = millis();
|
||||
while (this->bme680_.power_mode != BME680_SLEEP_MODE) {
|
||||
if (millis() - start > 50) {
|
||||
ESP_LOGE(TAG, "Timeout waiting for BME680 to enter sleep mode");
|
||||
return;
|
||||
}
|
||||
this->bme680_status_ = bme680_get_sensor_mode(&this->bme680_);
|
||||
if (this->bme680_status_ != BME680_OK) {
|
||||
ESP_LOGW(TAG, "Failed to get sensor mode (BME680 Error Code %d)", this->bme680_status_);
|
||||
ESP_LOGE(TAG, "Failed to get sensor mode (BME680 Error Code %d)", this->bme680_status_);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user