Espressif: disable pull-up on AnalogIn creation

This commit is contained in:
Dan Halbert 2022-04-06 11:33:56 -04:00
parent b993313ac1
commit 99dc4029dc

View File

@ -55,6 +55,10 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self,
}
common_hal_mcu_pin_claim(pin);
self->pin = pin;
// Pull-ups are enabled by default for power-saving reasons on quiescent pins.
// Turn off the pull-up as soon as we know the pin will be used for analog reads,
// since it may take a while for the voltage to stabilize if the input is high-impedance.
gpio_pullup_dis(pin->number);
}
bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) {