mirror of
https://github.com/esphome/esphome.git
synced 2025-09-14 01:02:19 +01:00
tweak
This commit is contained in:
@@ -16,7 +16,8 @@ class GPIOBinarySensorStore {
|
|||||||
static void gpio_intr(GPIOBinarySensorStore *arg);
|
static void gpio_intr(GPIOBinarySensorStore *arg);
|
||||||
|
|
||||||
bool get_state() const {
|
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_;
|
return this->state_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user