From d21e332281b3f2fb67913c1245e4387b698bb2a9 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 8de9553e923..6e5ef9bbcc6 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 a880e499802..bf783bf660b 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 4428d19c4bb..717cfa45635 100644 --- a/components/hal/esp32c3/include/hal/adc_ll.h +++ b/components/hal/esp32c3/include/hal/adc_ll.h @@ -38,7 +38,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 6f9a675540e..2d95138380c 100644 --- a/components/hal/esp32c6/include/hal/adc_ll.h +++ b/components/hal/esp32c6/include/hal/adc_ll.h @@ -39,7 +39,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 4e67ad81de4..0a5e0b544b5 100644 --- a/components/hal/esp32h2/include/hal/adc_ll.h +++ b/components/hal/esp32h2/include/hal/adc_ll.h @@ -39,7 +39,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 8eb918030c0..0a29bee9001 100644 --- a/components/hal/esp32s2/include/hal/adc_ll.h +++ b/components/hal/esp32s2/include/hal/adc_ll.h @@ -34,7 +34,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 b138b723ca3..05df0a5fd1a 100644 --- a/components/hal/esp32s3/include/hal/adc_ll.h +++ b/components/hal/esp32s3/include/hal/adc_ll.h @@ -34,7 +34,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