Skip to content

Commit 27b3295

Browse files
committed
Use ADC_ATTEN_DB_12 for ESP-IDF v5.1.3+ instead of v5.1.1+
The code currently retains the use of ADC_ATTEN_DB_11 until ESP-IDF v5.1.0, but the first version using ADC_ATTEN_DB_12 is actually ESP-IDF v5.1.3. Source: espressif/esp-idf@6de9757 Signed-off-by: tovam <tovam@users.noreply.github.com>
1 parent b257211 commit 27b3295

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/platforms/esp32/components/avm_builtins/adc_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static const AtomStringIntPair attenuation_table[] = {
106106
{ ATOM_STR("\x4", "db_0"), ADC_ATTEN_DB_0 },
107107
{ ATOM_STR("\x6", "db_2_5"), ADC_ATTEN_DB_2_5 },
108108
{ ATOM_STR("\x4", "db_6"), ADC_ATTEN_DB_6 },
109-
#if (ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 1, 0))
109+
#if (ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 1, 2))
110110
{ ATOM_STR("\x5", "db_11"), ADC_ATTEN_DB_11 },
111111
#else
112112
{ ATOM_STR("\x5", "db_12"), ADC_ATTEN_DB_12 },
@@ -175,7 +175,7 @@ static int approximate_millivolts(int adc_reading, adc_atten_t attenuation, adc_
175175
case ADC_ATTEN_DB_6:
176176
millivolt_max = 1750;
177177
break;
178-
#if (ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 1, 0))
178+
#if (ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 1, 2))
179179
case ADC_ATTEN_DB_11:
180180
millivolt_max = 2450;
181181
break;

0 commit comments

Comments
 (0)