Update LED heartbeat to use blocking delay
This commit is contained in:
+7
-3
@@ -141,10 +141,14 @@ void vLEDHeartbeat(void *argument)
|
|||||||
|
|
||||||
for (;;)
|
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);
|
if (notification & 0x01)
|
||||||
else HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
{
|
||||||
|
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 */
|
/* END vLEDHeartbeat */
|
||||||
|
|||||||
Reference in New Issue
Block a user