update_lights();
}
+static void lights_button_timeout(struct main_timer *t)
+{
+ int ch = (uintptr_t) t->data;
+ DBG("Lights[%d]: Full throttle!", ch);
+ timer_del(t);
+ lights_on[ch] = 1;
+ lights_brightness[ch] = 1;
+ update_lights();
+}
+
static void update_lights_from_button(int ch, int on)
{
+ static struct main_timer lights_button_timer[2] = {{
+ .handler = lights_button_timeout,
+ .data = (void *)(uintptr_t) 0,
+ },{
+ .handler = lights_button_timeout,
+ .data = (void *)(uintptr_t) 1,
+ }};
+
if (on)
{
lights_on[ch] = !lights_on[ch];
update_lights();
+ timer_add_rel(&lights_button_timer[ch], 1000);
}
+ else
+ timer_del(&lights_button_timer[ch]);
}
/*** Main update routines ***/