From 79e68ffaaee514db2f90b223967cb1d021501968 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/hal/esp32s2/adc_hal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/hal/esp32s2/adc_hal.c b/components/hal/esp32s2/adc_hal.c index 5f3e3d2a48..0265370db4 100644 --- a/components/hal/esp32s2/adc_hal.c +++ b/components/hal/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" #include "hal/adc_hal_conf.h" @@ -178,6 +179,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];