Sync the LEDs at the end of the loop

Instead of syncing right after updating, sync at the end of the loop. This
allows hooks (both loop and event handler hooks) to override LED colors, without
cooperation from the active LED effect, and without flickering.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/81/head
Gergely Nagy 8 years ago
parent fd5b78b92b
commit 5b99952c67

@ -39,6 +39,8 @@ Keyboardio_::loop(void) {
custom_loop_t hook = loopHooks[i];
(*hook)(true);
}
led_sync ();
}
void

@ -51,8 +51,6 @@ LEDControl_::update (void) {
if (modes[mode])
(modes[mode]->update) ();
led_sync ();
previousMode = mode;
}

Loading…
Cancel
Save