Merge pull request #6246 from DavePutz/issue_6148
Don't reset GPIO4 on the MagTag (used for voltage monitoring)
This commit is contained in:
commit
dbb6f5f16c
|
@ -188,6 +188,10 @@ bool espressif_board_reset_pin_number(gpio_num_t pin_number) {
|
|||
gpio_config(&cfg);
|
||||
return true;
|
||||
}
|
||||
// Pin 4 is used for voltage monitoring, so don't reset
|
||||
if (pin_number == 4) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue