From 6a830f01af5e76beb55558a33efc75c4f75f472d Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Tue, 7 May 2019 11:02:33 -0500 Subject: [PATCH] Use standard timeout checker for LED-BootAnimation Alos, don't bother to set `start_time_` in `onSetup()`; it's unnecessary. Signed-off-by: Michael Richters --- src/kaleidoscope/plugin/LEDEffect-BootAnimation.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/kaleidoscope/plugin/LEDEffect-BootAnimation.cpp b/src/kaleidoscope/plugin/LEDEffect-BootAnimation.cpp index 8128f05e..a44f4d9c 100644 --- a/src/kaleidoscope/plugin/LEDEffect-BootAnimation.cpp +++ b/src/kaleidoscope/plugin/LEDEffect-BootAnimation.cpp @@ -40,7 +40,6 @@ const uint8_t BootAnimationEffect::greeting_[11] PROGMEM = { }; EventHandlerResult BootAnimationEffect::onSetup() { - start_time_ = Kaleidoscope.millisAtCycleStart(); return EventHandlerResult::OK; } @@ -70,12 +69,12 @@ EventHandlerResult BootAnimationEffect::afterEachCycle() { } } - if ((Kaleidoscope.millisAtCycleStart() - start_time_) > timeout) { + if (Kaleidoscope.hasTimeExpired(start_time_, timeout)) { current_index_++; if (current_index_ == sizeof(greeting_)) done_ = true; - start_time_ = Kaleidoscope.millisAtCycleStart(); + start_time_ += timeout; if (row != 255 && col != 255) ::LEDControl.refreshAt(row, col); return EventHandlerResult::OK;