Skip to content

Commit 8c60a62

Browse files
committed
Fix analogRead of adc2 channels
See also espressif#5658 and espressif#5671
1 parent 317be68 commit 8c60a62

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: cores/esp32/esp32-hal-adc.c

+4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ static uint8_t __analogVRefPin = 0;
4646
#endif
4747

4848
static uint8_t __analogAttenuation = 3;//11db
49+
#if CONFIG_IDF_TARGET_ESP32S2
50+
static uint8_t __analogWidth = 4;//13 bits
51+
#else
4952
static uint8_t __analogWidth = 3;//12 bits
53+
#endif
5054
static uint8_t __analogClockDiv = 1;
5155
static adc_attenuation_t __pin_attenuation[SOC_GPIO_PIN_COUNT];
5256

0 commit comments

Comments
 (0)