From eaf21a34afa2bad1232bd16356c3613afb7fb48b Mon Sep 17 00:00:00 2001 From: Armando Date: Tue, 27 Jun 2023 12:17:33 +0800 Subject: [PATCH] fix(adc): fixed esp32, esp32s2,esp32s3 adc oneshot mode clk div issue --- components/hal/esp32/include/hal/adc_ll.h | 2 +- components/hal/esp32c2/include/hal/adc_ll.h | 1 - components/hal/esp32c3/include/hal/adc_ll.h | 1 - components/hal/esp32c6/include/hal/adc_ll.h | 1 - components/hal/esp32h2/include/hal/adc_ll.h | 1 - components/hal/esp32s2/include/hal/adc_ll.h | 2 +- components/hal/esp32s3/include/hal/adc_ll.h | 2 +- 7 files changed, 3 insertions(+), 7 deletions(-) diff --git a/components/hal/esp32/include/hal/adc_ll.h b/components/hal/esp32/include/hal/adc_ll.h index 8de9553e92..6e5ef9bbcc 100644 --- a/components/hal/esp32/include/hal/adc_ll.h +++ b/components/hal/esp32/include/hal/adc_ll.h @@ -29,7 +29,7 @@ extern "C" { Oneshot ---------------------------------------------------------------*/ #define ADC_LL_DATA_INVERT_DEFAULT(PERIPH_NUM) (1) -#define ADC_LL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (2) +#define ADC_LL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (1) /*--------------------------------------------------------------- DMA diff --git a/components/hal/esp32c2/include/hal/adc_ll.h b/components/hal/esp32c2/include/hal/adc_ll.h index f35e391dc4..b2b50267c0 100644 --- a/components/hal/esp32c2/include/hal/adc_ll.h +++ b/components/hal/esp32c2/include/hal/adc_ll.h @@ -33,7 +33,6 @@ extern "C" { Oneshot ---------------------------------------------------------------*/ #define ADC_LL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_LL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) ((PERIPH_NUM==0)? 2 : 1) /*--------------------------------------------------------------- DMA diff --git a/components/hal/esp32c3/include/hal/adc_ll.h b/components/hal/esp32c3/include/hal/adc_ll.h index 438a3acec4..f208e2920c 100644 --- a/components/hal/esp32c3/include/hal/adc_ll.h +++ b/components/hal/esp32c3/include/hal/adc_ll.h @@ -41,7 +41,6 @@ extern "C" { Oneshot ---------------------------------------------------------------*/ #define ADC_LL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_LL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) ((PERIPH_NUM==0)? 2 : 1) /*--------------------------------------------------------------- DMA diff --git a/components/hal/esp32c6/include/hal/adc_ll.h b/components/hal/esp32c6/include/hal/adc_ll.h index e0478f8f87..c8c52aadfd 100644 --- a/components/hal/esp32c6/include/hal/adc_ll.h +++ b/components/hal/esp32c6/include/hal/adc_ll.h @@ -42,7 +42,6 @@ extern "C" { Oneshot ---------------------------------------------------------------*/ #define ADC_LL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_LL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (2) /*--------------------------------------------------------------- DMA diff --git a/components/hal/esp32h2/include/hal/adc_ll.h b/components/hal/esp32h2/include/hal/adc_ll.h index 8a2dc2e798..269194b690 100644 --- a/components/hal/esp32h2/include/hal/adc_ll.h +++ b/components/hal/esp32h2/include/hal/adc_ll.h @@ -42,7 +42,6 @@ extern "C" { Oneshot ---------------------------------------------------------------*/ #define ADC_LL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_LL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (2) /*--------------------------------------------------------------- DMA diff --git a/components/hal/esp32s2/include/hal/adc_ll.h b/components/hal/esp32s2/include/hal/adc_ll.h index 044271ae49..2985503a52 100644 --- a/components/hal/esp32s2/include/hal/adc_ll.h +++ b/components/hal/esp32s2/include/hal/adc_ll.h @@ -38,7 +38,7 @@ extern "C" { Oneshot ---------------------------------------------------------------*/ #define ADC_LL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_LL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) ((PERIPH_NUM==0)? 2 : 1) +#define ADC_LL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (1) /*--------------------------------------------------------------- DMA diff --git a/components/hal/esp32s3/include/hal/adc_ll.h b/components/hal/esp32s3/include/hal/adc_ll.h index 8a756e69d3..f647f4c677 100644 --- a/components/hal/esp32s3/include/hal/adc_ll.h +++ b/components/hal/esp32s3/include/hal/adc_ll.h @@ -41,7 +41,7 @@ extern "C" { Oneshot ---------------------------------------------------------------*/ #define ADC_LL_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) -#define ADC_LL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) ((PERIPH_NUM==0)? 2 : 1) +#define ADC_LL_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (1) /*--------------------------------------------------------------- DMA