From 78e6ce0d35f111fded8e84c4ca6bac00d3382f3a Mon Sep 17 00:00:00 2001 From: Armando Date: Mon, 17 Feb 2025 11:23:34 +0800 Subject: [PATCH] fix(adc): fixed adc function register not reset issue --- components/hal/esp32c5/include/hal/adc_ll.h | 2 ++ components/hal/esp32c6/include/hal/adc_ll.h | 2 ++ components/hal/esp32c61/include/hal/adc_ll.h | 2 ++ components/hal/esp32h2/include/hal/adc_ll.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/components/hal/esp32c5/include/hal/adc_ll.h b/components/hal/esp32c5/include/hal/adc_ll.h index e451607122..e8c4155e17 100644 --- a/components/hal/esp32c5/include/hal/adc_ll.h +++ b/components/hal/esp32c5/include/hal/adc_ll.h @@ -580,6 +580,8 @@ static inline void adc_ll_enable_func_clock(bool enable) */ static inline void adc_ll_reset_register(void) { + PCR.saradc_conf.saradc_rst_en = 1; + PCR.saradc_conf.saradc_rst_en = 0; PCR.saradc_conf.saradc_reg_rst_en = 1; PCR.saradc_conf.saradc_reg_rst_en = 0; } diff --git a/components/hal/esp32c6/include/hal/adc_ll.h b/components/hal/esp32c6/include/hal/adc_ll.h index 0b09c3cd86..9e395a3717 100644 --- a/components/hal/esp32c6/include/hal/adc_ll.h +++ b/components/hal/esp32c6/include/hal/adc_ll.h @@ -579,6 +579,8 @@ static inline void adc_ll_enable_func_clock(bool enable) */ static inline void adc_ll_reset_register(void) { + PCR.saradc_conf.saradc_rst_en = 1; + PCR.saradc_conf.saradc_rst_en = 0; PCR.saradc_conf.saradc_reg_rst_en = 1; PCR.saradc_conf.saradc_reg_rst_en = 0; } diff --git a/components/hal/esp32c61/include/hal/adc_ll.h b/components/hal/esp32c61/include/hal/adc_ll.h index 5a57f347ad..f1b266d4a1 100644 --- a/components/hal/esp32c61/include/hal/adc_ll.h +++ b/components/hal/esp32c61/include/hal/adc_ll.h @@ -582,6 +582,8 @@ static inline void adc_ll_enable_func_clock(bool enable) */ static inline void adc_ll_reset_register(void) { + PCR.saradc_conf.saradc_rst_en = 1; + PCR.saradc_conf.saradc_rst_en = 0; PCR.saradc_conf.saradc_reg_rst_en = 1; PCR.saradc_conf.saradc_reg_rst_en = 0; } diff --git a/components/hal/esp32h2/include/hal/adc_ll.h b/components/hal/esp32h2/include/hal/adc_ll.h index 159696a3f6..3ebbf04909 100644 --- a/components/hal/esp32h2/include/hal/adc_ll.h +++ b/components/hal/esp32h2/include/hal/adc_ll.h @@ -589,6 +589,8 @@ static inline void adc_ll_enable_func_clock(bool enable) */ static inline void adc_ll_reset_register(void) { + PCR.saradc_conf.saradc_rst_en = 1; + PCR.saradc_conf.saradc_rst_en = 0; PCR.saradc_conf.saradc_reg_rst_en = 1; PCR.saradc_conf.saradc_reg_rst_en = 0; }