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 */