diff --git a/components/esp_adc/adc_oneshot.c b/components/esp_adc/adc_oneshot.c index c06901367f..9ff61a4b5c 100644 --- a/components/esp_adc/adc_oneshot.c +++ b/components/esp_adc/adc_oneshot.c @@ -18,6 +18,7 @@ #include "esp_private/adc_private.h" #include "esp_private/adc_share_hw_ctrl.h" #include "esp_private/sar_periph_ctrl.h" +#include "esp_private/esp_sleep_internal.h" #include "hal/adc_types.h" #include "hal/adc_oneshot_hal.h" #include "hal/adc_ll.h" @@ -115,6 +116,8 @@ esp_err_t adc_oneshot_new_unit(const adc_oneshot_unit_init_cfg_t *init_config, a if (init_config->ulp_mode == ADC_ULP_MODE_DISABLE) { sar_periph_ctrl_adc_oneshot_power_acquire(); + } else { + esp_sleep_enable_adc_tsens_monitor(true); } ESP_LOGD(TAG, "new adc unit%"PRId32" is created", unit->unit_id); @@ -215,6 +218,8 @@ esp_err_t adc_oneshot_del_unit(adc_oneshot_unit_handle_t handle) if (ulp_mode == ADC_ULP_MODE_DISABLE) { sar_periph_ctrl_adc_oneshot_power_release(); + } else { + esp_sleep_enable_adc_tsens_monitor(false); } #if SOC_ADC_DIG_CTRL_SUPPORTED && !SOC_ADC_RTC_CTRL_SUPPORTED