Commit e14ba12a authored by zenox's avatar zenox

use static timer for blink rockets

parent 715aac63
Pipeline #4545 failed with stages
in 2 minutes and 26 seconds
......@@ -129,6 +129,7 @@ int epic_leds_get_rocket(int led)
return ret;
}
static StaticTimer_t blink_timer_data[3];
static TimerHandle_t blink_timer[] = { NULL, NULL, NULL };
static void rocket_timer_callback(TimerHandle_t blink_timer)
......@@ -142,12 +143,13 @@ void epic_leds_blink_rocket(int led, uint8_t value, int millis)
int ticks = millis * (configTICK_RATE_HZ / 1000);
int32_t id = led;
if (blink_timer[id] == NULL) {
blink_timer[id] = xTimerCreate(
blink_timer[id] = xTimerCreateStatic(
"blinktimer",
ticks,
pdFALSE,
(void *)id,
rocket_timer_callback
rocket_timer_callback,
&blink_timer_data[id]
);
epic_leds_set_rocket(led, value);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment