mirror of
https://github.com/esphome/esphome.git
synced 2025-08-10 20:29:24 +00:00
tweak
This commit is contained in:
@@ -16,7 +16,8 @@ class GPIOBinarySensorStore {
|
||||
static void gpio_intr(GPIOBinarySensorStore *arg);
|
||||
|
||||
bool get_state() const {
|
||||
InterruptLock lock;
|
||||
// No lock needed: state_ is atomically updated by ISR
|
||||
// Volatile ensures we read the latest value
|
||||
return this->state_;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user