Merge pull request #3 from keyboardio/f/led-api-update

Updated to use the new LEDMode/LEDControl API
pull/365/head
Gergely Nagy 7 years ago committed by GitHub
commit b9e2d3a27d

@ -1,12 +1,17 @@
#include "Kaleidoscope-LEDEffect-SolidColor.h"
namespace kaleidoscope {
LEDSolidColor::LEDSolidColor(uint8_t r, uint8_t g, uint8_t b) {
this->r = r;
this->g = g;
this->b = b;
}
void
LEDSolidColor::init(void) {
LEDControl.set_all_leds_to(r, g, b);
void LEDSolidColor::onActivate(void) {
::LEDControl.set_all_leds_to(r, g, b);
}
void LEDSolidColor::refreshAt(byte row, byte col) {
::LEDControl.setCrgbAt(row, col, CRGB(r, g, b));
}
}

@ -2,12 +2,16 @@
#include "Kaleidoscope-LEDControl.h"
namespace kaleidoscope {
class LEDSolidColor : public LEDMode {
public:
LEDSolidColor(uint8_t r, uint8_t g, uint8_t b);
void init(void) final;
protected:
void onActivate(void) final;
void refreshAt(byte row, byte col) final;
private:
uint8_t r, g, b;
};
}

Loading…
Cancel
Save