Implement LED heartbeat with RTOS timers
- Less memory overhead (no stack allocation) - Less context switch - Better timing accuracy (less jitter)
This commit is contained in:
+2
-8
@@ -121,17 +121,11 @@ void vLED_Heartbeat(void *argument)
|
||||
{
|
||||
/* CODE BEGIN */
|
||||
LED_Config *led = (LED_Config*)argument;
|
||||
HAL_GPIO_WritePin(led->port, led->pin, GPIO_RESET);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
//HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
||||
// if semaphore for canrx, do the rest
|
||||
|
||||
|
||||
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_SET);
|
||||
osDelay(100);
|
||||
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
||||
osDelay(100);
|
||||
HAL_GPIO_TogglePin(led->port, led->pin);
|
||||
}
|
||||
/* CODE END */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user