mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
esp_wifi: Fixes issue of crashing when verbose logs are enabled.
This commit is contained in:
@ -121,22 +121,16 @@ static esp_pm_lock_handle_t s_adc2_arbiter_lock;
|
|||||||
|
|
||||||
void adc_power_acquire(void)
|
void adc_power_acquire(void)
|
||||||
{
|
{
|
||||||
bool powered_on = false;
|
|
||||||
ADC_ENTER_CRITICAL();
|
ADC_ENTER_CRITICAL();
|
||||||
s_adc_power_on_cnt++;
|
s_adc_power_on_cnt++;
|
||||||
if (s_adc_power_on_cnt == 1) {
|
if (s_adc_power_on_cnt == 1) {
|
||||||
adc_power_on_internal();
|
adc_power_on_internal();
|
||||||
powered_on = true;
|
|
||||||
}
|
}
|
||||||
ADC_EXIT_CRITICAL();
|
ADC_EXIT_CRITICAL();
|
||||||
if (powered_on) {
|
|
||||||
ESP_LOGV(ADC_TAG, "%s: ADC powered on", __func__);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void adc_power_release(void)
|
void adc_power_release(void)
|
||||||
{
|
{
|
||||||
bool powered_off = false;
|
|
||||||
ADC_ENTER_CRITICAL();
|
ADC_ENTER_CRITICAL();
|
||||||
s_adc_power_on_cnt--;
|
s_adc_power_on_cnt--;
|
||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
@ -146,12 +140,8 @@ void adc_power_release(void)
|
|||||||
abort();
|
abort();
|
||||||
} else if (s_adc_power_on_cnt == 0) {
|
} else if (s_adc_power_on_cnt == 0) {
|
||||||
adc_power_off_internal();
|
adc_power_off_internal();
|
||||||
powered_off = true;
|
|
||||||
}
|
}
|
||||||
ADC_EXIT_CRITICAL();
|
ADC_EXIT_CRITICAL();
|
||||||
if (powered_off) {
|
|
||||||
ESP_LOGV(ADC_TAG, "%s: ADC powered off", __func__);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void adc_power_on_internal(void)
|
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.
|
//Configure RTC gpio, Only ADC2's channels IO are supported to output reference voltage.
|
||||||
adc_gpio_init(ADC_UNIT_2, ch);
|
adc_gpio_init(ADC_UNIT_2, ch);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user