mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
fix(adc): fix adc oneshot apb cnts incosistency
closes https://github.com/espressif/esp-idf/issues/14502
This commit is contained in:
parent
84df38aab9
commit
0a88b0720b
@ -126,6 +126,7 @@ esp_err_t adc_oneshot_new_unit(const adc_oneshot_unit_init_cfg_t *init_config, a
|
||||
};
|
||||
adc_oneshot_hal_init(&(unit->hal), &config);
|
||||
|
||||
#if SOC_ADC_DIG_CTRL_SUPPORTED && !SOC_ADC_RTC_CTRL_SUPPORTED
|
||||
//To enable the APB_SARADC periph if needed
|
||||
_lock_acquire(&s_ctx.mutex);
|
||||
s_ctx.apb_periph_ref_cnts++;
|
||||
@ -133,6 +134,7 @@ esp_err_t adc_oneshot_new_unit(const adc_oneshot_unit_init_cfg_t *init_config, a
|
||||
adc_apb_periph_claim();
|
||||
}
|
||||
_lock_release(&s_ctx.mutex);
|
||||
#endif
|
||||
|
||||
if (init_config->ulp_mode == ADC_ULP_MODE_DISABLE) {
|
||||
sar_periph_ctrl_adc_oneshot_power_acquire();
|
||||
|
Loading…
x
Reference in New Issue
Block a user