diff --git a/src/Kaleidoscope-LEDEffect-Chase.cpp b/src/Kaleidoscope-LEDEffect-Chase.cpp index 99c6c95d..c021b5a8 100644 --- a/src/Kaleidoscope-LEDEffect-Chase.cpp +++ b/src/Kaleidoscope-LEDEffect-Chase.cpp @@ -1,22 +1,21 @@ #include "Kaleidoscope-LEDEffect-Chase.h" -LEDChaseEffect_::LEDChaseEffect_(void) { -} - -void LEDChaseEffect_::update(void) { +namespace kaleidoscope { +void LEDChaseEffect::update(void) { if (current_chase_counter++ < chase_threshold) { return; } current_chase_counter = 0; - LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {0, 0, 0}); - LEDControl.setCrgbAt(pos, {0, 0, 0}); + ::LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {0, 0, 0}); + ::LEDControl.setCrgbAt(pos, {0, 0, 0}); pos += chase_sign; if (pos >= LED_COUNT || pos <= 0) { chase_sign = -chase_sign; } - LEDControl.setCrgbAt(pos, {0, 0, 255}); - LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {255, 0, 0}); + ::LEDControl.setCrgbAt(pos, {0, 0, 255}); + ::LEDControl.setCrgbAt(pos - (chase_sign * chase_pixels), {255, 0, 0}); +} } -LEDChaseEffect_ LEDChaseEffect; +kaleidoscope::LEDChaseEffect LEDChaseEffect; diff --git a/src/Kaleidoscope-LEDEffect-Chase.h b/src/Kaleidoscope-LEDEffect-Chase.h index cfea5fab..1002b8ac 100644 --- a/src/Kaleidoscope-LEDEffect-Chase.h +++ b/src/Kaleidoscope-LEDEffect-Chase.h @@ -3,10 +3,12 @@ #include "Kaleidoscope-LEDControl.h" #include "LEDUtils.h" -class LEDChaseEffect_ : public LEDMode { +namespace kaleidoscope { +class LEDChaseEffect : public LEDMode { public: - LEDChaseEffect_(void); + LEDChaseEffect(void) {} + protected: void update(void) final; private: @@ -16,5 +18,6 @@ class LEDChaseEffect_ : public LEDMode { uint8_t current_chase_counter = 0; static const uint8_t chase_threshold = 20; }; +} -extern LEDChaseEffect_ LEDChaseEffect; +extern kaleidoscope::LEDChaseEffect LEDChaseEffect;