diff --git a/README.md b/README.md index b9feca8f..0a2309ab 100644 --- a/README.md +++ b/README.md @@ -27,17 +27,24 @@ register the `Focus` hooks, and it will do the rest. ```c++ #include +#include #include #include +#include -void setup(void) { - Kaleidoscope.use(&ColormapEffect, &Focus); +KALEIDOSCOPE_INIT_PLUGINS(EEPROMSettings, + LEDPaletteTheme, + ColormapEffect, + Focus); +void setup(void) { Kaleidoscope.setup(); ColormapEffect.max_layers(1); Focus.addHook(FOCUS_HOOK_LEDPALETTETHEME); Focus.addHook(FOCUS_HOOK_COLORMAP); + + EEPROMSettings.seal(); } ``` diff --git a/examples/Colormap/Colormap.ino b/examples/Colormap/Colormap.ino index 56699c79..854149e7 100644 --- a/examples/Colormap/Colormap.ino +++ b/examples/Colormap/Colormap.ino @@ -1,6 +1,6 @@ /* -*- mode: c++ -*- * Kaleidoscope-EEPROM-Colormap -- Per-layer colormap effect - * Copyright (C) 2017 Gergely Nagy + * Copyright (C) 2017, 2018 Gergely Nagy * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,12 @@ */ #include +#include #include +#include +#include + +// *INDENT-OFF* const Key keymaps[][ROWS][COLS] PROGMEM = { [0] = KEYMAP_STACKED @@ -31,19 +36,26 @@ const Key keymaps[][ROWS][COLS] PROGMEM = { Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip, Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals, - Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, + Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl, Key_NoKey), }; -void setup() { - Kaleidoscope.use(&ColormapEffect); +// *INDENT-ON* + +KALEIDOSCOPE_INIT_PLUGINS(EEPROMSettings, + LEDPaletteTheme, + ColormapEffect, + Focus); +void setup() { Kaleidoscope.setup(); ColormapEffect.max_layers(1); ColormapEffect.activate(); + + EEPROMSettings.seal(); } void loop() { diff --git a/src/Kaleidoscope/Colormap.cpp b/src/Kaleidoscope/Colormap.cpp index 9c4ab937..ba5c0c37 100644 --- a/src/Kaleidoscope/Colormap.cpp +++ b/src/Kaleidoscope/Colormap.cpp @@ -1,6 +1,6 @@ /* -*- mode: c++ -*- * Kaleidoscope-Colormap -- Per-layer colormap effect - * Copyright (C) 2016, 2017 Gergely Nagy + * Copyright (C) 2016, 2017, 2018 Gergely Nagy * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,10 +31,6 @@ uint8_t ColormapEffect::max_layers_; uint8_t ColormapEffect::last_highest_layer_; bool ColormapEffect::dirty_ = false; -void ColormapEffect::setup(void) { - Kaleidoscope.use(&::EEPROMSettings, &::LEDPaletteTheme); -} - void ColormapEffect::max_layers(uint8_t max_) { if (map_base_ != 0) return; diff --git a/src/Kaleidoscope/Colormap.h b/src/Kaleidoscope/Colormap.h index 36b98a2f..e4e92c3d 100644 --- a/src/Kaleidoscope/Colormap.h +++ b/src/Kaleidoscope/Colormap.h @@ -1,6 +1,6 @@ /* -*- mode: c++ -*- * Kaleidoscope-Colormap -- Per-layer colormap effect - * Copyright (C) 2016, 2017 Gergely Nagy + * Copyright (C) 2016, 2017, 2018 Gergely Nagy * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +32,6 @@ class ColormapEffect : public LEDMode { static bool focusHookLayerwise(const char *command); protected: - void setup(void) final; void onActivate(void) final; void update(void) final; void refreshAt(byte row, byte col) final;