Skip to content

Commit

Permalink
Merge pull request #92 from canokeys/fix-led-state
Browse files Browse the repository at this point in the history
Fix initial LED state (bug introduced in 4fb369f)
  • Loading branch information
dangfan authored Jul 8, 2024
2 parents 4c5d529 + dc7d92d commit 6f650fd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ static void toggle_led(void) {

void device_update_led(void) {
uint32_t now = device_get_tick();
if (!device_is_blinking()) return;
if (now > blink_timeout) stop_blinking();
else if (now >= last_blink && now - last_blink >= blink_interval) {
if (device_is_blinking() && now >= last_blink && now - last_blink >= blink_interval) {
last_blink = now;
toggle_led();
}
Expand Down

0 comments on commit 6f650fd

Please sign in to comment.