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,8 +86,10 @@ 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);
if (flags_ & gpio::FLAG_OUTPUT) {
gpio_set_drive_capability(pin_, drive_strength_);
}
}
void ESP32InternalGPIOPin::pin_mode(gpio::Flags flags) {
// can't call gpio_config here because that logs in esp-idf which may cause issues