Merge branch 'bugfix/crash_on_enabling_verbose_logs_v4.2' into 'release/v4.2'

Fixes issue of crashing when verbose logs are enabled.(v4.2)

See merge request espressif/esp-idf!12845
This commit is contained in:
Jiang Jiang Jian 2021-03-23 08:41:41 +00:00
commit 1d227bbb2e

View File

@ -121,22 +121,16 @@ static esp_pm_lock_handle_t s_adc2_arbiter_lock;
void adc_power_acquire(void)
{
bool powered_on = false;
ADC_ENTER_CRITICAL();
s_adc_power_on_cnt++;
if (s_adc_power_on_cnt == 1) {
adc_power_on_internal();
powered_on = true;
}
ADC_EXIT_CRITICAL();
if (powered_on) {
ESP_LOGV(ADC_TAG, "%s: ADC powered on", __func__);
}
}
void adc_power_release(void)
{
bool powered_off = false;
ADC_ENTER_CRITICAL();
s_adc_power_on_cnt--;
/* Sanity check */
@ -146,12 +140,8 @@ void adc_power_release(void)
abort();
} else if (s_adc_power_on_cnt == 0) {
adc_power_off_internal();
powered_off = true;
}
ADC_EXIT_CRITICAL();
if (powered_off) {
ESP_LOGV(ADC_TAG, "%s: ADC powered off", __func__);
}
}
static void adc_power_on_internal(void)
@ -612,4 +602,4 @@ esp_err_t adc_vref_to_gpio(adc_unit_t adc_unit, gpio_num_t gpio)
//Configure RTC gpio, Only ADC2's channels IO are supported to output reference voltage.
adc_gpio_init(ADC_UNIT_2, ch);
return ESP_OK;
}
}