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:
2026-06-10 13:56:52 +02:00
parent 0c3c93040b
commit 7e2ffd3971
2 changed files with 14 additions and 12 deletions
+2 -8
View File
@@ -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 */
}