Merge pull request #6246 from DavePutz/issue_6148

Don't reset GPIO4 on the MagTag (used for voltage monitoring)
This commit is contained in:
Dan Halbert 2022-04-06 13:22:01 -04:00 committed by GitHub
commit dbb6f5f16c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -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;
}

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) {