From 8b8c97316b282a2d35c21557e202aabcabc68542 Mon Sep 17 00:00:00 2001 From: Erick Ahmed Date: Wed, 29 Jul 2026 23:50:52 +0200 Subject: [PATCH] Update LED heartbeat to use blocking delay --- Core/Src/canlog.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Core/Src/canlog.c b/Core/Src/canlog.c index d0efe4c..76b555e 100644 --- a/Core/Src/canlog.c +++ b/Core/Src/canlog.c @@ -141,10 +141,14 @@ void vLEDHeartbeat(void *argument) for (;;) { - uint32_t notification = osThreadFlagsWait(0x01, osFlagsWaitAny, LED_BLINK_MS); + uint32_t notification = osThreadFlagsWait(0x01, osFlagsWaitAny, osWaitForever); - if (notification & 0x01) HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_SET); - else HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET); + if (notification & 0x01) + { + HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_SET); + osDelay(LED_BLINK_MS); + HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET); + } } } /* END vLEDHeartbeat */