From 6c6a841dafa5ef6d8dd55cd7cd904d11c3bc5449 Mon Sep 17 00:00:00 2001 From: Jonas Arnold Date: Thu, 3 Nov 2022 13:12:02 +0100 Subject: [PATCH] update McuLog from McuLib (ESP32 change) --- McuLib/src/McuLog.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/McuLib/src/McuLog.c b/McuLib/src/McuLog.c index 797d14b..aaea394 100644 --- a/McuLib/src/McuLog.c +++ b/McuLib/src/McuLog.c @@ -332,14 +332,22 @@ static void LockUnlockCallback(void *data, bool lock) { BaseType_t xHigherPriorityTaskWoken = pdFALSE; if (lock) { +#if McuLib_CONFIG_CPU_IS_ESP32 + if (xPortInIsrContext()) { +#else if (xPortIsInsideInterrupt()) { +#endif xSemaphoreTakeFromISR(McuLog_ConfigData.McuLog_Mutex, &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } else { (void)xSemaphoreTakeRecursive(McuLog_ConfigData.McuLog_Mutex, portMAX_DELAY); } } else { +#if McuLib_CONFIG_CPU_IS_ESP32 + if (xPortInIsrContext()) { +#else if (xPortIsInsideInterrupt()) { +#endif xSemaphoreGiveFromISR(McuLog_ConfigData.McuLog_Mutex, &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } else { @@ -480,4 +488,3 @@ void McuLog_Deinit(void) { } #endif /* McuLog_CONFIG_IS_ENABLED */ -