mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +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;
|
||||
|
||||
Reference in New Issue
Block a user