Browse Source

move everything to class fields

Peter Cai 11 months ago
parent
commit
47a72d5608
Signed by: Peter Cai <[email protected]> GPG Key ID: 71F5FB4E4F3FD54F
6 changed files with 15 additions and 15 deletions
  1. 0
    2
      aura.cpp
  2. 2
    0
      aura.h
  3. 0
    7
      breathing.cpp
  4. 7
    0
      breathing.h
  5. 0
    6
      ripple.cpp
  6. 6
    0
      ripple.h

+ 0
- 2
aura.cpp View File

@@ -2,8 +2,6 @@
2 2
 #include "color.h"
3 3
 
4 4
 // ==== The Aura Rainbow Effect ====
5
-int auraCounter = 0;
6
-int auraWidth;
7 5
 
8 6
 void AuraEffect::reset() {
9 7
   auraCounter = 0;

+ 2
- 0
aura.h View File

@@ -4,6 +4,8 @@
4 4
 #include "effect.h"
5 5
 
6 6
 class AuraEffect : public Effect {
7
+ int auraCounter = 0;
8
+ int auraWidth;
7 9
  unsigned char paletteCounter;
8 10
  CRGB curColor, nextColor;
9 11
  private:

+ 0
- 7
breathing.cpp View File

@@ -11,13 +11,6 @@
11 11
   } else if (x > 255) {  \
12 12
     x = 255;             \
13 13
   }
14
-CRGB startColor;
15
-CRGB breathingColor;
16
-CRGB breathingIncrement;
17
-int sign;
18
-int breathingCounter;
19
-unsigned char paletteIndex;
20
-bool fullPalette;
21 14
 
22 15
 void BreathingEffect::reset() {
23 16
   sign = -1;

+ 7
- 0
breathing.h View File

@@ -4,6 +4,13 @@
4 4
 #include "effect.h"
5 5
 
6 6
 class BreathingEffect : public Effect {
7
+ CRGB startColor;
8
+ CRGB breathingColor;
9
+ CRGB breathingIncrement;
10
+ int sign;
11
+ int breathingCounter;
12
+ unsigned char paletteIndex;
13
+ bool fullPalette;
7 14
  private:
8 15
   void stepColor(unsigned int step);
9 16
   void updateIncrement();

+ 0
- 6
ripple.cpp View File

@@ -2,12 +2,6 @@
2 2
 #include "color.h"
3 3
 
4 4
 // ==== The Ripple Effect ====
5
-// TODO: Implement arbitrary color selection
6
-int rippleCounter;
7
-#define RIPPLE_CENTERS 2
8
-int rippleCenter[RIPPLE_CENTERS] = {NUM_LEDS / 4, NUM_LEDS / 4 * 3}; // TODO: Make this configurable
9
-int rippleWidth;
10
-int rippleDecrement;
11 5
 
12 6
 void RippleEffect::reset() {
13 7
   paletteCounter = 0;

+ 6
- 0
ripple.h View File

@@ -3,7 +3,13 @@
3 3
 #include "main.h"
4 4
 #include "effect.h"
5 5
 
6
+#define RIPPLE_CENTERS 2 // TODO: Make this (at least somewhat) configurable
7
+
6 8
 class RippleEffect : public Effect {
9
+ int rippleCounter;
10
+ int rippleCenter[RIPPLE_CENTERS] = {NUM_LEDS / 4, NUM_LEDS / 4 * 3}; // TODO: Make this configurable
11
+ int rippleWidth;
12
+ int rippleDecrement;
7 13
  unsigned char paletteCounter;
8 14
  CRGB curColor, nextColor;
9 15
  private:

Loading…
Cancel
Save