From d067c8f80b8905a61744f36424ac563c122c3ad0 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 23 Nov 2022 20:39:19 +1300 Subject: [PATCH] Dont set esp32 pin drive strength unless pin is set for output (#4075) --- esphome/components/esp32/gpio.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphome/components/esp32/gpio.cpp b/esphome/components/esp32/gpio.cpp index c7146c8872..d0805e4dd2 100644 --- a/esphome/components/esp32/gpio.cpp +++ b/esphome/components/esp32/gpio.cpp @@ -86,7 +86,9 @@ void ESP32InternalGPIOPin::setup() { conf.pull_down_en = flags_ & gpio::FLAG_PULLDOWN ? GPIO_PULLDOWN_ENABLE : GPIO_PULLDOWN_DISABLE; conf.intr_type = GPIO_INTR_DISABLE; gpio_config(&conf); - gpio_set_drive_capability(pin_, drive_strength_); + if (flags_ & gpio::FLAG_OUTPUT) { + gpio_set_drive_capability(pin_, drive_strength_); + } } void ESP32InternalGPIOPin::pin_mode(gpio::Flags flags) {