1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00

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

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_);