Add timeout to LED heartbeat thread flags
This commit is contained in:
+2
-1
@@ -140,10 +140,11 @@ void vLEDHeartbeat(void *argument)
|
|||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
uint32_t notification = osThreadFlagsWait(0x01, osFlagsWaitAny, osWaitForever);
|
uint32_t notification = osThreadFlagsWait(0x01, osFlagsWaitAny, LED_BLINK_MS);
|
||||||
|
|
||||||
if (notification & 0x01) HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_SET);
|
if (notification & 0x01) HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_SET);
|
||||||
else HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
else HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* END vLEDHeartbeat */
|
/* END vLEDHeartbeat */
|
||||||
/* USER CODE END FunctionPrototypes */
|
/* USER CODE END FunctionPrototypes */
|
||||||
|
|||||||
Reference in New Issue
Block a user