Skip to content

Commit 1e1ace5

Browse files
Merge pull request #458 from jeremiahrose/patch-1
Fix `Pin is not configured as analog channel` error
2 parents 5dffc7b + 8268acf commit 1e1ace5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/current_sense/hardware_specific/esp32/esp32_adc_driver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ bool IRAM_ATTR adcInit(uint8_t pin){
162162
analogReadResolution(SIMPLEFOC_ADC_RES);
163163
}
164164
pinMode(pin, ANALOG);
165-
analogSetPinAttenuation(pin, SIMPLEFOC_ADC_ATTEN);
166165
analogRead(pin);
166+
analogSetPinAttenuation(pin, SIMPLEFOC_ADC_ATTEN);
167167

168168
#if CONFIG_IDF_TARGET_ESP32 // if esp32 variant
169169
__configFastADCs();

0 commit comments

Comments
 (0)