From 2333e6eef51aeb0fcb813c9fc0dcb4b184f7d2d3 Mon Sep 17 00:00:00 2001 From: Guanzhong Chen Date: Thu, 16 Jul 2026 07:57:30 -0400 Subject: [PATCH] [zephyr] implement ISRInternalGPIOPin::digital_write (#17601) --- esphome/components/zephyr/gpio.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/esphome/components/zephyr/gpio.cpp b/esphome/components/zephyr/gpio.cpp index 1e4201d8f5..23da2cafac 100644 --- a/esphome/components/zephyr/gpio.cpp +++ b/esphome/components/zephyr/gpio.cpp @@ -173,6 +173,14 @@ bool IRAM_ATTR ISRInternalGPIOPin::digital_read() { return bool(gpio_pin_get(arg->gpio, arg->pin % arg->gpio_size) != arg->inverted); } +void IRAM_ATTR ISRInternalGPIOPin::digital_write(bool value) { + auto *arg = (zephyr::ISRPinArg *) this->arg_; + if (arg == nullptr || arg->gpio == nullptr) { + return; + } + gpio_pin_set(arg->gpio, arg->pin % arg->gpio_size, value != arg->inverted ? 1 : 0); +} + } // namespace esphome #endif