1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-03 11:52:20 +01:00

Fix esp-idf pinmask bit-shift overflow (#2380)

This commit is contained in:
Christian Taedcke
2021-09-23 18:24:29 +02:00
committed by GitHub
parent a27a884191
commit 210a9a4162

View File

@@ -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<uint32_t>(pin_);
conf.pin_bit_mask = 1ULL << static_cast<uint32_t>(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;