Acquire semaphore and restart timer if new message incoming
This commit is contained in:
+11
-1
@@ -133,7 +133,17 @@ void vLEDHeartbeat(void *argument)
|
|||||||
{
|
{
|
||||||
/* CODE BEGIN */
|
/* CODE BEGIN */
|
||||||
LED_Config *led = (LED_Config*)argument;
|
LED_Config *led = (LED_Config*)argument;
|
||||||
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
|
||||||
|
if (osSemaphoreAcquire(xCanActivitySemaphore, 0U) == osOK)
|
||||||
|
{
|
||||||
|
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_SET);
|
||||||
|
osTimerStart(xHeartbeatTimerCAN1, 25U);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
||||||
|
}
|
||||||
|
|
||||||
/* CODE END */
|
/* CODE END */
|
||||||
}
|
}
|
||||||
/* END vLEDHeartbeat */
|
/* END vLEDHeartbeat */
|
||||||
|
|||||||
Reference in New Issue
Block a user