From 965a12cab4fddd34b06f720463312da566dbc2b8 Mon Sep 17 00:00:00 2001 From: gaoxu Date: Fri, 14 Aug 2026 17:37:19 +0800 Subject: [PATCH] fix(soc): correct ESP32 ADC sample frequency thresholds Use literal frequency thresholds so the SoC capability Kconfig generator preserves the 20 kHz to 2 MHz range. (Closes https://github.com/espressif/esp-idf/issues/16151) --- components/soc/esp32/include/soc/Kconfig.soc_caps.in | 4 ++-- components/soc/esp32/include/soc/soc_caps.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/soc/esp32/include/soc/Kconfig.soc_caps.in b/components/soc/esp32/include/soc/Kconfig.soc_caps.in index ccdcb54481f..19dafb86cbd 100644 --- a/components/soc/esp32/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32/include/soc/Kconfig.soc_caps.in @@ -249,11 +249,11 @@ config SOC_ADC_DIGI_MONITOR_NUM config SOC_ADC_SAMPLE_FREQ_THRES_HIGH int - default 2 + default 2000000 config SOC_ADC_SAMPLE_FREQ_THRES_LOW int - default 20 + default 20000 config SOC_ADC_RTC_MIN_BITWIDTH int diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index 4ba76fcf45c..e27a0f6985a 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -135,8 +135,8 @@ #define SOC_ADC_DIGI_RESULT_BYTES (2) #define SOC_ADC_DIGI_DATA_BYTES_PER_CONV (4) #define SOC_ADC_DIGI_MONITOR_NUM (0U) // to reference `IDF_TARGET_SOC_ADC_DIGI_MONITOR_NUM` in document -#define SOC_ADC_SAMPLE_FREQ_THRES_HIGH (2*1000*1000) -#define SOC_ADC_SAMPLE_FREQ_THRES_LOW (20*1000) +#define SOC_ADC_SAMPLE_FREQ_THRES_HIGH (2000000) +#define SOC_ADC_SAMPLE_FREQ_THRES_LOW (20000) /*!< RTC */ #define SOC_ADC_RTC_MIN_BITWIDTH (9)