From 210a9a41621c3e391531d31d8c8822a4e9d79ec7 Mon Sep 17 00:00:00 2001 From: Christian Taedcke Date: Thu, 23 Sep 2021 18:24:29 +0200 Subject: [PATCH] Fix esp-idf pinmask bit-shift overflow (#2380) --- esphome/components/esp32/gpio_idf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/esp32/gpio_idf.h b/esphome/components/esp32/gpio_idf.h index 6a383afcae..a83c6bbc97 100644 --- a/esphome/components/esp32/gpio_idf.h +++ b/esphome/components/esp32/gpio_idf.h @@ -20,7 +20,7 @@ class IDFInternalGPIOPin : public InternalGPIOPin { } void pin_mode(gpio::Flags flags) override { gpio_config_t conf{}; - conf.pin_bit_mask = 1 << static_cast(pin_); + conf.pin_bit_mask = 1ULL << static_cast(pin_); conf.mode = flags_to_mode_(flags); conf.pull_up_en = flags & gpio::FLAG_PULLUP ? GPIO_PULLUP_ENABLE : GPIO_PULLUP_DISABLE; conf.pull_down_en = flags & gpio::FLAG_PULLDOWN ? GPIO_PULLDOWN_ENABLE : GPIO_PULLDOWN_DISABLE;