IDF 5 fixes for various components from test1.yaml (#5451)

This commit is contained in:
Keith Burzinski
2023-10-18 01:33:36 -05:00
committed by GitHub
parent 8ef743f25e
commit cdc4f7f59b
82 changed files with 173 additions and 97 deletions

View File

@@ -61,12 +61,13 @@ void PulseMeterSensor::loop() {
const uint32_t time_since_valid_edge_us = now - this->last_processed_edge_us_;
switch (this->meter_state_) {
// Running and initial states can timeout
// Running and initial states can timeout
case MeterState::INITIAL:
case MeterState::RUNNING: {
if (time_since_valid_edge_us > this->timeout_us_) {
this->meter_state_ = MeterState::TIMED_OUT;
ESP_LOGD(TAG, "No pulse detected for %us, assuming 0 pulses/min", time_since_valid_edge_us / 1000000);
ESP_LOGD(TAG, "No pulse detected for %" PRIu32 "s, assuming 0 pulses/min",
time_since_valid_edge_us / 1000000);
this->publish_state(0.0f);
}
} break;
@@ -82,11 +83,12 @@ void PulseMeterSensor::dump_config() {
LOG_SENSOR("", "Pulse Meter", this);
LOG_PIN(" Pin: ", this->pin_);
if (this->filter_mode_ == FILTER_EDGE) {
ESP_LOGCONFIG(TAG, " Filtering rising edges less than %u µs apart", this->filter_us_);
ESP_LOGCONFIG(TAG, " Filtering rising edges less than %" PRIu32 " µs apart", this->filter_us_);
} else {
ESP_LOGCONFIG(TAG, " Filtering pulses shorter than %u µs", this->filter_us_);
ESP_LOGCONFIG(TAG, " Filtering pulses shorter than %" PRIu32 " µs", this->filter_us_);
}
ESP_LOGCONFIG(TAG, " Assuming 0 pulses/min after not receiving a pulse for %us", this->timeout_us_ / 1000000);
ESP_LOGCONFIG(TAG, " Assuming 0 pulses/min after not receiving a pulse for %" PRIu32 "s",
this->timeout_us_ / 1000000);
}
void IRAM_ATTR PulseMeterSensor::edge_intr(PulseMeterSensor *sensor) {