mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
fix(esp_phy): use early log macros in ISR context to avoid log lock deadlock
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2016-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2016-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_attr.h"
|
||||
|
||||
@@ -36,7 +37,11 @@ static int lib_printf(const char* tag, const char* format, va_list arg)
|
||||
temp[i] = 0;
|
||||
}
|
||||
if (i > 0) {
|
||||
ESP_LOGI(tag, "%s", temp);
|
||||
if (xPortInIsrContext()) {
|
||||
ESP_EARLY_LOGI(tag, "%s", temp);
|
||||
} else {
|
||||
ESP_LOGI(tag, "%s", temp);
|
||||
}
|
||||
}
|
||||
va_end(arg);
|
||||
return len;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "esp_private/phy.h"
|
||||
#include "esp_phy.h"
|
||||
#include "esp_attr.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
|
||||
#if SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP
|
||||
#include "hal/temperature_sensor_ll.h"
|
||||
@@ -388,6 +389,10 @@ void phy_wakeup_from_modem_state_extra_init(void)
|
||||
|
||||
__attribute__((weak)) void phy_wait_freq_hw_hop_done(void)
|
||||
{
|
||||
ESP_LOGD(TAG, "phy_wait_freq_hw_hop_done is not implemented");
|
||||
if (xPortInIsrContext()) {
|
||||
ESP_EARLY_LOGD(TAG, "phy_wait_freq_hw_hop_done is not implemented");
|
||||
} else {
|
||||
ESP_LOGD(TAG, "phy_wait_freq_hw_hop_done is not implemented");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user