ADC fix: GPIO0 not usable as output if ADC_VCC is used (#1557)

This commit is contained in:
Christian Ferbar 2021-02-28 18:02:02 +01:00 committed by GitHub
parent bdf004867d
commit 34d37961c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,9 @@ void ADCSensor::set_attenuation(adc_attenuation_t attenuation) { this->attenuati
void ADCSensor::setup() { void ADCSensor::setup() {
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str()); ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
#ifndef USE_ADC_SENSOR_VCC
GPIOPin(this->pin_, INPUT).setup(); GPIOPin(this->pin_, INPUT).setup();
#endif
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
analogSetPinAttenuation(this->pin_, this->attenuation_); analogSetPinAttenuation(this->pin_, this->attenuation_);