diff --git a/src/Kaleidoscope-LEDControl.cpp b/src/Kaleidoscope-LEDControl.cpp index a5f41d90..80266a77 100644 --- a/src/Kaleidoscope-LEDControl.cpp +++ b/src/Kaleidoscope-LEDControl.cpp @@ -151,7 +151,11 @@ kaleidoscope::EventHandlerResult LEDControl::beforeReportingState(void) { if (paused) return kaleidoscope::EventHandlerResult::OK; + // unsigned subtraction means that as syncTimer rolls over + // the same interval is kept uint16_t elapsed = Kaleidoscope.millisAtCycleStart() - syncTimer; + // on some platforms, the subtraction in the comparison results in a signed + // operation, resulting in syncLeds() no longer getting called. if (elapsed > syncDelay) { syncLeds(); syncTimer += syncDelay;