From abd0fca51a21aa9e2bcadee0a8a77eed48fdda70 Mon Sep 17 00:00:00 2001 From: Armando Date: Wed, 12 Jul 2023 17:19:00 +0800 Subject: [PATCH] fix(adc): fixed esp32, esp32s2,esp32s3 adc oneshot mode clk div issue --- components/hal/esp32/include/hal/adc_hal_conf.h | 2 +- components/hal/esp32c2/include/hal/adc_hal_conf.h | 1 - components/hal/esp32c3/include/hal/adc_hal_conf.h | 1 - components/hal/esp32h2/include/hal/adc_hal_conf.h | 1 - components/hal/esp32s2/include/hal/adc_hal_conf.h | 2 +- components/hal/esp32s3/include/hal/adc_hal_conf.h | 2 +- 6 files changed, 3 insertions(+), 6 deletions(-) diff --git a/components/hal/esp32/include/hal/adc_hal_conf.h b/components/hal/esp32/include/hal/adc_hal_conf.h index c005184526..c41fd9d582 100644 --- a/components/hal/esp32/include/hal/adc_hal_conf.h +++ b/components/hal/esp32/include/hal/adc_hal_conf.h @@ -10,7 +10,7 @@ Single Read ---------------------------------------------------------------*/ #define ADC_HAL_DATA_INVERT_DEFAULT(PERIPH_NUM) (1) -#define ADC_HAL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (2) +#define ADC_HAL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (1) /*--------------------------------------------------------------- DMA Read diff --git a/components/hal/esp32c2/include/hal/adc_hal_conf.h b/components/hal/esp32c2/include/hal/adc_hal_conf.h index 55e742d388..d3de7e6393 100644 --- a/components/hal/esp32c2/include/hal/adc_hal_conf.h +++ b/components/hal/esp32c2/include/hal/adc_hal_conf.h @@ -10,7 +10,6 @@ Single Read ---------------------------------------------------------------*/ #define ADC_HAL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_HAL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) ((PERIPH_NUM==0)? 2 : 1) /*--------------------------------------------------------------- DMA Read diff --git a/components/hal/esp32c3/include/hal/adc_hal_conf.h b/components/hal/esp32c3/include/hal/adc_hal_conf.h index 55e742d388..d3de7e6393 100644 --- a/components/hal/esp32c3/include/hal/adc_hal_conf.h +++ b/components/hal/esp32c3/include/hal/adc_hal_conf.h @@ -10,7 +10,6 @@ Single Read ---------------------------------------------------------------*/ #define ADC_HAL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_HAL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) ((PERIPH_NUM==0)? 2 : 1) /*--------------------------------------------------------------- DMA Read diff --git a/components/hal/esp32h2/include/hal/adc_hal_conf.h b/components/hal/esp32h2/include/hal/adc_hal_conf.h index 55e742d388..d3de7e6393 100644 --- a/components/hal/esp32h2/include/hal/adc_hal_conf.h +++ b/components/hal/esp32h2/include/hal/adc_hal_conf.h @@ -10,7 +10,6 @@ Single Read ---------------------------------------------------------------*/ #define ADC_HAL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_HAL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) ((PERIPH_NUM==0)? 2 : 1) /*--------------------------------------------------------------- DMA Read diff --git a/components/hal/esp32s2/include/hal/adc_hal_conf.h b/components/hal/esp32s2/include/hal/adc_hal_conf.h index b61b08c038..0243c7bfc4 100644 --- a/components/hal/esp32s2/include/hal/adc_hal_conf.h +++ b/components/hal/esp32s2/include/hal/adc_hal_conf.h @@ -10,7 +10,7 @@ Single Read ---------------------------------------------------------------*/ #define ADC_HAL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_HAL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) ((PERIPH_NUM==0)? 2 : 1) +#define ADC_HAL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (1) /*--------------------------------------------------------------- DMA Read diff --git a/components/hal/esp32s3/include/hal/adc_hal_conf.h b/components/hal/esp32s3/include/hal/adc_hal_conf.h index 55e742d388..f105e417cf 100644 --- a/components/hal/esp32s3/include/hal/adc_hal_conf.h +++ b/components/hal/esp32s3/include/hal/adc_hal_conf.h @@ -10,7 +10,7 @@ Single Read ---------------------------------------------------------------*/ #define ADC_HAL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_HAL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) ((PERIPH_NUM==0)? 2 : 1) +#define ADC_HAL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (1) /*--------------------------------------------------------------- DMA Read