From 23eb723dafb71eec7589aaeb70b59a4a88e83b06 Mon Sep 17 00:00:00 2001 From: Armando Date: Thu, 29 Jul 2021 14:10:36 +0800 Subject: [PATCH] adc: make adc single api only build pm lock on s2 Since ADC single read API only uses polling mode, we don't need to add pm lock in it. --- components/driver/adc_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/driver/adc_common.c b/components/driver/adc_common.c index 2272a21bc5..a231b8134a 100644 --- a/components/driver/adc_common.c +++ b/components/driver/adc_common.c @@ -530,7 +530,7 @@ esp_err_t adc2_config_channel_atten(adc2_channel_t channel, adc_atten_t atten) static inline void adc2_init(void) { -#if !CONFIG_IDF_TARGET_ESP32 +#if CONFIG_IDF_TARGET_ESP32S2 #ifdef CONFIG_PM_ENABLE /* Lock APB clock. */ if (s_adc2_arbiter_lock == NULL) { @@ -609,7 +609,7 @@ esp_err_t adc2_get_raw(adc2_channel_t channel, adc_bits_width_t width_bit, int * adc_hal_set_controller(ADC_NUM_2, ADC_CTRL_RTC); #endif -#if !CONFIG_IDF_TARGET_ESP32 +#if CONFIG_IDF_TARGET_ESP32S2 #ifdef CONFIG_PM_ENABLE if (s_adc2_arbiter_lock) { esp_pm_lock_acquire(s_adc2_arbiter_lock);