diff --git a/cores/esp32/esp32-hal-adc.c b/cores/esp32/esp32-hal-adc.c index 21eb443c..1af3ce3a 100644 --- a/cores/esp32/esp32-hal-adc.c +++ b/cores/esp32/esp32-hal-adc.c @@ -48,6 +48,7 @@ static uint8_t __analogVRefPin = 0; static uint8_t __analogAttenuation = 3;//11db static uint8_t __analogWidth = 3;//12 bits static uint8_t __analogClockDiv = 1; +static adc_attenuation_t __pin_attenuation[SOC_GPIO_PIN_COUNT]; void __analogSetClockDiv(uint8_t clockDiv){ if(!clockDiv){ @@ -86,6 +87,9 @@ void __analogInit(){ #if CONFIG_IDF_TARGET_ESP32 __analogSetWidth(__analogWidth + 9);//in bits #endif + for(int i=0; i