mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_wifi: Fixes issue of crashing when verbose logs are enabled.
This commit is contained in:
parent
5151fb52ec
commit
f8c691faaf
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user