Dont set esp32 pin drive strength unless pin is set for output (#4075)

This commit is contained in:
Jesse Hills 2022-11-23 20:39:19 +13:00 committed by GitHub
parent 8975b4b3f6
commit d067c8f80b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,9 @@ void ESP32InternalGPIOPin::setup() {
conf.pull_down_en = flags_ & gpio::FLAG_PULLDOWN ? GPIO_PULLDOWN_ENABLE : GPIO_PULLDOWN_DISABLE; conf.pull_down_en = flags_ & gpio::FLAG_PULLDOWN ? GPIO_PULLDOWN_ENABLE : GPIO_PULLDOWN_DISABLE;
conf.intr_type = GPIO_INTR_DISABLE; conf.intr_type = GPIO_INTR_DISABLE;
gpio_config(&conf); gpio_config(&conf);
if (flags_ & gpio::FLAG_OUTPUT) {
gpio_set_drive_capability(pin_, drive_strength_); gpio_set_drive_capability(pin_, drive_strength_);
}
} }
void ESP32InternalGPIOPin::pin_mode(gpio::Flags flags) { void ESP32InternalGPIOPin::pin_mode(gpio::Flags flags) {