diff --git a/src/Kaleidoscope-LEDEffect-Rainbow.cpp b/src/Kaleidoscope-LEDEffect-Rainbow.cpp index c0d1bac0..2de7618e 100644 --- a/src/Kaleidoscope-LEDEffect-Rainbow.cpp +++ b/src/Kaleidoscope-LEDEffect-Rainbow.cpp @@ -1,9 +1,8 @@ #include "Kaleidoscope-LEDEffect-Rainbow.h" -LEDRainbowEffect_::LEDRainbowEffect_(void) { -} +namespace kaleidoscope { -void LEDRainbowEffect_::update(void) { +void LEDRainbowEffect::update(void) { if (rainbow_current_ticks++ < rainbow_ticks) { return; } else { @@ -16,21 +15,17 @@ void LEDRainbowEffect_::update(void) { if (rainbow_hue >= 255) { rainbow_hue -= 255; } - LEDControl.set_all_leds_to(rainbow); + ::LEDControl.set_all_leds_to(rainbow); } -void LEDRainbowEffect_::brightness(byte brightness) { +void LEDRainbowEffect::brightness(byte brightness) { rainbow_value = brightness; } -LEDRainbowEffect_ LEDRainbowEffect; // --------- -LEDRainbowWaveEffect_::LEDRainbowWaveEffect_(void) { -} - -void LEDRainbowWaveEffect_::update(void) { +void LEDRainbowWaveEffect::update(void) { if (rainbow_current_ticks++ < rainbow_wave_ticks) { return; } else { @@ -43,7 +38,7 @@ void LEDRainbowWaveEffect_::update(void) { key_hue -= 255; } cRGB rainbow = hsvToRgb(key_hue, rainbow_saturation, rainbow_value); - LEDControl.setCrgbAt(i, rainbow); + ::LEDControl.setCrgbAt(i, rainbow); } rainbow_hue += rainbow_wave_steps; if (rainbow_hue >= 255) { @@ -51,8 +46,10 @@ void LEDRainbowWaveEffect_::update(void) { } } -void LEDRainbowWaveEffect_::brightness(byte brightness) { +void LEDRainbowWaveEffect::brightness(byte brightness) { rainbow_value = brightness; } +} -LEDRainbowWaveEffect_ LEDRainbowWaveEffect; +kaleidoscope::LEDRainbowEffect LEDRainbowEffect; +kaleidoscope::LEDRainbowWaveEffect LEDRainbowWaveEffect; diff --git a/src/Kaleidoscope-LEDEffect-Rainbow.h b/src/Kaleidoscope-LEDEffect-Rainbow.h index 6745bdbe..98307109 100644 --- a/src/Kaleidoscope-LEDEffect-Rainbow.h +++ b/src/Kaleidoscope-LEDEffect-Rainbow.h @@ -3,9 +3,10 @@ #include "Kaleidoscope-LEDControl.h" #include "LEDUtils.h" -class LEDRainbowEffect_ : public LEDMode { +namespace kaleidoscope { +class LEDRainbowEffect : public LEDMode { public: - LEDRainbowEffect_(void); + LEDRainbowEffect(void) {} void brightness(byte); void update(void) final; @@ -21,11 +22,10 @@ class LEDRainbowEffect_ : public LEDMode { byte rainbow_value = 50; }; -extern LEDRainbowEffect_ LEDRainbowEffect; -class LEDRainbowWaveEffect_ : public LEDMode { +class LEDRainbowWaveEffect : public LEDMode { public: - LEDRainbowWaveEffect_(void); + LEDRainbowWaveEffect(void) {} void brightness(byte); void update(void) final; @@ -40,5 +40,7 @@ class LEDRainbowWaveEffect_ : public LEDMode { byte rainbow_saturation = 255; byte rainbow_value = 50; }; +} -extern LEDRainbowWaveEffect_ LEDRainbowWaveEffect; +extern kaleidoscope::LEDRainbowEffect LEDRainbowEffect; +extern kaleidoscope::LEDRainbowWaveEffect LEDRainbowWaveEffect;