From 34c52978754d9b17d89f7a33c42883d09c89c155 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 1 Jun 2017 12:09:37 +0200 Subject: [PATCH] Only request a palette slice, if we haven't already This should - in theory - allow other plugins to just use `LEDPaletteTheme`, without having many copies of the palette. Signed-off-by: Gergely Nagy --- src/Kaleidoscope/LED-Palette-Theme.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Kaleidoscope/LED-Palette-Theme.cpp b/src/Kaleidoscope/LED-Palette-Theme.cpp index 9a5e24a2..e328c263 100644 --- a/src/Kaleidoscope/LED-Palette-Theme.cpp +++ b/src/Kaleidoscope/LED-Palette-Theme.cpp @@ -33,7 +33,8 @@ void LEDPaletteTheme::begin (void) { USE_PLUGINS (&::EEPROMSettings); - paletteBase = ::EEPROMSettings.requestSlice (16 * sizeof (cRGB)); + if (!paletteBase) + paletteBase = ::EEPROMSettings.requestSlice (16 * sizeof (cRGB)); } uint16_t