mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
adc: fixed the issue that ADC power is left on after the calibration is done
Also refactor the locks in the adc_common.c file.
This commit is contained in:
@@ -464,10 +464,12 @@ uint32_t adc_get_calibration_offset(adc_ll_num_t adc_n, adc_channel_t channel, a
|
||||
int tag = esp_efuse_rtc_table_get_tag(version, adc_n + 1, atten, RTCCALIB_V2_PARAM_VINIT);
|
||||
dout = esp_efuse_rtc_table_get_parsed_efuse_value(tag, false);
|
||||
} else {
|
||||
const bool internal_gnd = true;
|
||||
adc_power_acquire();
|
||||
ADC_ENTER_CRITICAL();
|
||||
const bool internal_gnd = true;
|
||||
dout = adc_hal_self_calibration(adc_n, channel, atten, internal_gnd);
|
||||
ADC_EXIT_CRITICAL();
|
||||
adc_power_release();
|
||||
}
|
||||
ESP_LOGD(ADC_TAG, "Calib(V%d) ADC%d atten=%d: %04X", version, adc_n, atten, dout);
|
||||
s_adc_cali_param[adc_n][atten] = (uint16_t)dout;
|
||||
|
Reference in New Issue
Block a user