From b336cb954c875171363a89f99555bc37e89503d9 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 17 Sep 2020 15:40:29 +1000 Subject: [PATCH] esp32s2: Disable ADC calibration routine if running on FPGA --- components/soc/src/esp32s2/adc_hal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/soc/src/esp32s2/adc_hal.c b/components/soc/src/esp32s2/adc_hal.c index bd4029860c..9af481282a 100644 --- a/components/soc/src/esp32s2/adc_hal.c +++ b/components/soc/src/esp32s2/adc_hal.c @@ -14,6 +14,7 @@ // The HAL layer for ADC (esp32s2 specific part) +#include "sdkconfig.h" #include "hal/adc_hal.h" #include "hal/adc_types.h" @@ -177,6 +178,10 @@ static uint32_t adc_hal_read_self_cal(adc_ll_num_t adc_n, int channel) uint32_t adc_hal_calibration(adc_ll_num_t adc_n, adc_channel_t channel, adc_atten_t atten, bool internal_gnd, bool force_cal) { +#ifdef CONFIG_IDF_ENV_FPGA + return 0; +#endif + if (!force_cal) { if (s_adc_cali_param[adc_n][atten]) { return (uint32_t)s_adc_cali_param[adc_n][atten];