From f0365d6fe25c81437a9674b5c8e0c2908a9b822e Mon Sep 17 00:00:00 2001 From: Evy Bongers Date: Sat, 2 Dec 2023 16:10:06 +0100 Subject: [PATCH] Need to reserve space in EEPROM Signed-off-by: Evy Bongers --- .../src/kaleidoscope/plugin/Colormap-Overlay.cpp | 5 +++++ .../src/kaleidoscope/plugin/Colormap-Overlay.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.cpp b/plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.cpp index 2f1d77a33a..590ae6423f 100644 --- a/plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.cpp +++ b/plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.cpp @@ -28,6 +28,11 @@ namespace kaleidoscope { namespace plugin { +uint16_t ColormapOverlay::map_base_; + +void ColormapOverlay::setup() { + map_base_ = ::LEDPaletteTheme.reserveThemes(1); +} bool ColormapOverlay::hasOverlay(KeyAddr k) { uint8_t layer_index = Layer.lookupActiveLayer(k); diff --git a/plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.h b/plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.h index 2e9b1413fe..894481112a 100644 --- a/plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.h +++ b/plugins/Kaleidoscope-Colormap-Overlay/src/kaleidoscope/plugin/Colormap-Overlay.h @@ -42,6 +42,7 @@ struct Overlay { class ColormapOverlay : public kaleidoscope::Plugin { public: + static void setup(); // Function for defining the array of overlays. It's a template function that // takes as its sole argument an array reference of size `_overlay_count`, so // there's no need to use `sizeof` to calculate the correct size, and pass it @@ -59,6 +60,7 @@ class ColormapOverlay : public kaleidoscope::Plugin { EventHandlerResult afterEachCycle(); private: + static uint16_t map_base_; Overlay const *overlays_; uint8_t overlay_count_; cRGB selectedColor;