mirror of
https://github.com/esphome/esphome.git
synced 2024-11-24 12:06:26 +01:00
minor fixes
This commit is contained in:
parent
537af5fa3b
commit
2fa3f97144
@ -52,6 +52,7 @@ void PulseMeterSensor::loop() {
|
||||
} else if (this->filter_mode_ == FILTER_PULSE && current != this->last_pin_val_) {
|
||||
PulseMeterSensor::pulse_intr(this);
|
||||
}
|
||||
this->last_pin_val_ = current;
|
||||
|
||||
// Swap out set and get to get the latest state from the ISR
|
||||
std::swap(this->set_, this->get_);
|
||||
|
@ -49,7 +49,7 @@ class PulseMeterSensor : public sensor::Sensor, public Component {
|
||||
|
||||
// This struct (and the two pointers) are used to pass data between the ISR and loop.
|
||||
// These two pointers are exchanged each loop.
|
||||
// Use these to send data from the ISR to the loop not the other way around (except for resetting the values).
|
||||
// Use these to send data from the ISR to the loop not the other way around (except for resetting the values).
|
||||
struct State {
|
||||
uint32_t last_detected_edge_us_ = 0;
|
||||
uint32_t last_rising_edge_us_ = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user