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 <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent 7b8ae3c9c0
commit 34c5297875

@ -33,7 +33,8 @@ void
LEDPaletteTheme::begin (void) { LEDPaletteTheme::begin (void) {
USE_PLUGINS (&::EEPROMSettings); USE_PLUGINS (&::EEPROMSettings);
paletteBase = ::EEPROMSettings.requestSlice (16 * sizeof (cRGB)); if (!paletteBase)
paletteBase = ::EEPROMSettings.requestSlice (16 * sizeof (cRGB));
} }
uint16_t uint16_t

Loading…
Cancel
Save