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 dc1bea63ad
commit fe53c4fabe

@ -28,14 +28,9 @@ namespace kaleidoscope {
uint16_t FingerPainter::color_base_;
bool FingerPainter::edit_mode_;
FingerPainter::FingerPainter(void) {
}
void FingerPainter::begin(void) {
USE_PLUGINS(&::LEDPaletteTheme);
LEDMode::begin();
event_handler_hook_use(eventHandlerHook);
void FingerPainter::setup(void) {
Kaleidoscope.use(&::LEDPaletteTheme);
Kaleidoscope.useEventHandlerHook(eventHandlerHook);
color_base_ = ::LEDPaletteTheme.reserveThemes(1);
}
@ -44,6 +39,10 @@ void FingerPainter::update(void) {
::LEDPaletteTheme.updateHandler(color_base_, 0);
}
void FingerPainter::refreshAt(byte row, byte col) {
::LEDPaletteTheme.refreshAt(color_base_, 0, row, col);
}
void FingerPainter::toggle(void) {
edit_mode_ = !edit_mode_;
}

@ -23,14 +23,16 @@
namespace kaleidoscope {
class FingerPainter : public LEDMode {
public:
FingerPainter(void);
void begin(void) final;
void update(void) final;
FingerPainter(void) {}
static void toggle(void);
static bool focusHook(const char *command);
protected:
void setup(void) final;
void update(void) final;
void refreshAt(byte row, byte col) final;
private:
static uint16_t color_base_;
static bool edit_mode_;

Loading…
Cancel
Save