remove unused breathe state structure

pull/85/head
Jesse Vincent 8 years ago
parent b230c1f27d
commit 8dbf70e278

@ -1,13 +1,11 @@
#include "LED-BreatheEffect.h"
LEDBreatheEffect_::LEDBreatheEffect_ (void) {
state.brightness = 0;
state.fadeAmount = 1;
}
void
LEDBreatheEffect_::update (void) {
cRGB color = breath_compute (&state);
cRGB color = breath_compute();
LEDControl.set_all_leds_to (color);
}

@ -10,7 +10,6 @@ class LEDBreatheEffect_ : LEDMode {
virtual void update (void) final;
private:
BreathState state;
};
extern LEDBreatheEffect_ LEDBreatheEffect;

@ -8,9 +8,6 @@ static uint8_t us;
LEDNumlock::LEDNumlock (uint8_t numpadIdx) {
numpadIndex = numpadIdx;
breathState.brightness = 0;
breathState.fadeAmount = 1;
}
void
@ -35,7 +32,7 @@ LEDNumlock::update (void) {
led_set_crgb_at(i, {255, 0, 0});
}
cRGB color = breath_compute (&breathState);
cRGB color = breath_compute ();
led_set_crgb_at (60, color);
}

@ -14,6 +14,4 @@ class LEDNumlock : LEDMode {
private:
static void loopHook (bool postClear);
BreathState breathState;
};

@ -1,7 +1,7 @@
#include "LEDUtils.h"
cRGB
breath_compute (BreathState *state) {
breath_compute () {
// This code is adapted from FastLED lib8tion.h as of dd5d96c6b289cb6b4b891748a4aeef3ddceaf0e6
// Eventually, we should consider just using FastLED
@ -16,9 +16,9 @@ breath_compute (BreathState *state) {
uint8_t ii = (i*i)>>8;
uint8_t iii = (ii*i)>>8;
state->brightness = (( (3 * (uint16_t)(ii)) - ( 2 * (uint16_t)(iii))) / 2) + 2;
i = (( (3 * (uint16_t)(ii)) - ( 2 * (uint16_t)(iii))) / 2) + 2;
return hsv_to_rgb(200, 255, state->brightness);
return hsv_to_rgb(200, 255, i);
}

@ -2,10 +2,5 @@
#include "KeyboardConfig.h"
typedef struct {
uint8_t brightness = 0; // how bright the LED is
int8_t fadeAmount = 1; // how many points to fade the LED by (can be negative)
} BreathState;
cRGB breath_compute (BreathState *state);
cRGB breath_compute (void);
cRGB hsv_to_rgb(uint16_t h, uint16_t s, uint16_t v);

Loading…
Cancel
Save