Skip to content

Commit 6e3c780

Browse files
committed
Merge pull request #1523 from tovam/fix-adc-atten-db-12
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 These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 9239c74 + 27b3295 commit 6e3c780

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)