From 35bfc9f069fdabcc7d5575aed87ba960586f1b7c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 17 Jun 2025 13:41:57 +0200 Subject: [PATCH] tweak --- esphome/components/gpio/binary_sensor/gpio_binary_sensor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/gpio/binary_sensor/gpio_binary_sensor.h b/esphome/components/gpio/binary_sensor/gpio_binary_sensor.h index 304ba465e9..17f7b4eb19 100644 --- a/esphome/components/gpio/binary_sensor/gpio_binary_sensor.h +++ b/esphome/components/gpio/binary_sensor/gpio_binary_sensor.h @@ -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_; }