From 074f5029eb0432487ed8de7a2f91d76e6c25f3b4 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 21 Dec 2022 14:03:00 +1300 Subject: [PATCH] Fix gpio pin mode for ISR pins (#4216) --- esphome/components/esp32/gpio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/esp32/gpio.cpp b/esphome/components/esp32/gpio.cpp index 758a707531..aafdf80726 100644 --- a/esphome/components/esp32/gpio.cpp +++ b/esphome/components/esp32/gpio.cpp @@ -128,7 +128,7 @@ void IRAM_ATTR ISRInternalGPIOPin::pin_mode(gpio::Flags flags) { auto *arg = reinterpret_cast(arg_); gpio_set_direction(arg->pin, flags_to_mode(flags)); gpio_pull_mode_t pull_mode = GPIO_FLOATING; - if (flags & (gpio::FLAG_PULLUP | gpio::FLAG_PULLDOWN)) { + if ((flags & gpio::FLAG_PULLUP) && (flags & gpio::FLAG_PULLDOWN)) { pull_mode = GPIO_PULLUP_PULLDOWN; } else if (flags & gpio::FLAG_PULLUP) { pull_mode = GPIO_PULLUP_ONLY;