LED will not be triggered again after timer set #15

Closed
opened 2026-06-15 10:54:32 +02:00 by eeeck · 2 comments
Owner

LED timer is configured as osTimerOnce. If the semaphore is not acquired (i.e., no CAN messages were received), the else block turns the LED off but fails to restart the timer. Consequently, the timer will never fire again, and the LED

void vLEDHeartbeat(void *argument) {
    // ...
    if (osSemaphoreAcquire(context->semaphore, 0U) == osOK) {
        // Turn LED ON and restart timer
        osTimerStart(context->timer, 25U);
    } else {
        // Turn LED OFF
        // BUG: Timer is NOT restarted here!
    }
}
LED timer is configured as osTimerOnce. If the semaphore is not acquired (i.e., no CAN messages were received), the else block turns the LED off but fails to restart the timer. Consequently, the timer will never fire again, and the LED ```c void vLEDHeartbeat(void *argument) { // ... if (osSemaphoreAcquire(context->semaphore, 0U) == osOK) { // Turn LED ON and restart timer osTimerStart(context->timer, 25U); } else { // Turn LED OFF // BUG: Timer is NOT restarted here! } } ```
eeeck added this to the v0.1.0 milestone 2026-06-15 10:54:32 +02:00
eeeck added the bug label 2026-06-15 10:54:32 +02:00
eeeck self-assigned this 2026-06-15 10:54:32 +02:00
eeeck added this to the Thesis SCRUM project 2026-06-15 10:54:32 +02:00
Author
Owner

Maybe it's best to use the semaphore logic for serial send and an event flag for LED

Maybe it's best to use the semaphore logic for serial send and an event flag for LED
Author
Owner

Resolved in #18. Closing.

Resolved in #18. Closing.
eeeck closed this issue 2026-06-15 15:31:18 +02:00
eeeck moved this to Done in Thesis SCRUM on 2026-06-15 15:31:31 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eeeck/CANdigger#15