fix(esp_phy): use early log macros in ISR context to avoid log lock deadlock

This commit is contained in:
Xu Si Yu
2026-07-27 19:24:54 +08:00
committed by BOT
parent 8550997ada
commit 095b9a255a
2 changed files with 13 additions and 3 deletions
+7 -2
View File
@@ -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;