diff --git a/src/Kaleidoscope/LED-Stalker.cpp b/src/Kaleidoscope/LED-Stalker.cpp index 02cf86a0..7c0fa655 100644 --- a/src/Kaleidoscope/LED-Stalker.cpp +++ b/src/Kaleidoscope/LED-Stalker.cpp @@ -23,7 +23,7 @@ namespace KaleidoscopePlugins { uint8_t StalkerEffect::map[ROWS][COLS]; StalkerEffect::ColorComputer *StalkerEffect::colorComputer; uint16_t StalkerEffect::stepLength = 50; - uint32_t StalkerEffect::stepStartTime; + uint32_t StalkerEffect::stepEndTime; StalkerEffect::StalkerEffect (void) { } @@ -37,7 +37,6 @@ namespace KaleidoscopePlugins { StalkerEffect::begin (void) { event_handler_hook_use (eventHandlerHook); loop_hook_use (loopHook); - stepStartTime = millis (); } Key @@ -60,7 +59,7 @@ namespace KaleidoscopePlugins { if (!colorComputer) return; - bool timeOut = (millis () - stepStartTime) >= stepLength; + bool timeOut = millis () >= stepEndTime; for (byte r = 0; r < ROWS; r++) { for (byte c = 0; c < COLS; c++) { @@ -86,7 +85,7 @@ namespace KaleidoscopePlugins { } if (timeOut) - stepStartTime = millis (); + stepEndTime = millis () + stepLength; } namespace Stalker { diff --git a/src/Kaleidoscope/LED-Stalker.h b/src/Kaleidoscope/LED-Stalker.h index af108a8a..7b670aaf 100644 --- a/src/Kaleidoscope/LED-Stalker.h +++ b/src/Kaleidoscope/LED-Stalker.h @@ -37,7 +37,7 @@ namespace KaleidoscopePlugins { static uint16_t stepLength; private: - static uint32_t stepStartTime; + static uint32_t stepEndTime; static ColorComputer *colorComputer; static uint8_t map[ROWS][COLS];