Skip to content

Commit 025e40f

Browse files
committed
fix ADC 13 bit width for esp32s2
1 parent 40fe144 commit 025e40f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ static uint8_t __analogVRefPin = 0;
4343
#endif
4444

4545
static uint8_t __analogAttenuation = 3;//11db
46+
47+
#if CONFIG_IDF_TARGET_ESP32
4648
static uint8_t __analogWidth = 3;//12 bits
49+
#elif CONFIG_IDF_TARGET_ESP32S2
50+
static uint8_t __analogWidth = 4;//13 bits
51+
#endif
52+
4753
static uint8_t __analogClockDiv = 1;
4854

4955
void __analogSetClockDiv(uint8_t clockDiv){

0 commit comments

Comments
 (0)