Update to use the new LEDMode/LEDControl API

Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
pull/389/head
Gergely Nagy 7 years ago
parent f14e31fdd6
commit d4ddd5fd73

@ -29,12 +29,7 @@ namespace kaleidoscope {
uint16_t ColormapEffect::map_base_;
uint8_t ColormapEffect::max_layers_;
ColormapEffect::ColormapEffect(void) {
}
void ColormapEffect::begin(void) {
LEDMode::begin();
void ColormapEffect::setup(void) {
Kaleidoscope.use(&::EEPROMSettings, &::LEDPaletteTheme);
}
@ -55,6 +50,15 @@ void ColormapEffect::update(void) {
}
}
void ColormapEffect::refreshAt(byte row, byte col) {
for (uint8_t l = 0; l < max_layers_; l++) {
if (!Layer.isOn(l))
continue;
::LEDPaletteTheme.refreshAt(map_base_, l, row, col);
}
}
bool ColormapEffect::focusHook(const char *command) {
return ::LEDPaletteTheme.themeFocusHandler(command, PSTR("colormap.map"),
map_base_, max_layers_);

@ -24,15 +24,17 @@
namespace kaleidoscope {
class ColormapEffect : public LEDMode {
public:
ColormapEffect(void);
void begin(void) final;
void update(void) final;
ColormapEffect(void) {}
void max_layers(uint8_t max_);
static bool focusHook(const char *command);
protected:
void setup(void) final;
void update(void) final;
void refreshAt(byte row, byte col) final;
private:
static uint8_t max_layers_;
static uint16_t map_base_;

Loading…
Cancel
Save