diff --git a/src/animations/UpdateStatus.cpp b/src/animations/UpdateStatus.cpp index 389b777..6da47db 100644 --- a/src/animations/UpdateStatus.cpp +++ b/src/animations/UpdateStatus.cpp @@ -8,7 +8,7 @@ UpdateStatus::handleEvent(const InputEvent& evt) if (evt.intent == InputEvent::FirmwareUpdate) { static int updateCount = 0; updateCount++; - //Log.info("Update count %d", updateCount); + Log.info("Update count %d", updateCount); m_updateReady = true; } } @@ -22,11 +22,12 @@ UpdateStatus::loop() void UpdateStatus::render(Display* dpy) const { + int pos = m_pos % dpy->pixelCount(); if (m_updateReady) { for(int i = 0; i < 12; i+=3) { - dpy->pixelAt(m_pos + i) = CRGB(255, 0, 0); - dpy->pixelAt(m_pos + i + 1) = CRGB(0, 255, 0); - dpy->pixelAt(m_pos + i + 2) = CRGB(0, 0, 255); + dpy->pixelAt(pos + i) = CRGB(255, 0, 0); + dpy->pixelAt(pos + i + 1) = CRGB(0, 255, 0); + dpy->pixelAt(pos + i + 2) = CRGB(0, 0, 255); } } } diff --git a/src/animations/UpdateStatus.h b/src/animations/UpdateStatus.h index d52e0e2..4397135 100644 --- a/src/animations/UpdateStatus.h +++ b/src/animations/UpdateStatus.h @@ -10,5 +10,5 @@ public: private: bool m_updateReady = false; - uint8_t m_pos = 0; + int m_pos = 0; };