diff --git a/src/Kaleidoscope/FingerPainter.cpp b/src/Kaleidoscope/FingerPainter.cpp index a6613184..593fc3b8 100644 --- a/src/Kaleidoscope/FingerPainter.cpp +++ b/src/Kaleidoscope/FingerPainter.cpp @@ -104,6 +104,7 @@ namespace KaleidoscopePlugins { enum { PALETTE, TOGGLE, + CLEAR, } subCommand; if (strncmp_P (command, PSTR ("fingerpainter."), 14) != 0) @@ -113,6 +114,8 @@ namespace KaleidoscopePlugins { subCommand = PALETTE; else if (strcmp_P (command + 14, PSTR ("toggle")) == 0) subCommand = TOGGLE; + else if (strcmp_P (command + 14, PSTR ("clear")) == 0) + subCommand = CLEAR; else return false; @@ -122,6 +125,13 @@ namespace KaleidoscopePlugins { return true; } + if (subCommand == CLEAR) { + for (uint16_t i = 0; i < ROWS * COLS; i++) { + EEPROM.update (colorBase + i, 0); + } + return true; + } + if (Serial.peek () == '\n') { for (uint8_t i = 0; i < 16; i++) { cRGB color; diff --git a/src/Kaleidoscope/FingerPainter.h b/src/Kaleidoscope/FingerPainter.h index 07ad2967..206cf5aa 100644 --- a/src/Kaleidoscope/FingerPainter.h +++ b/src/Kaleidoscope/FingerPainter.h @@ -49,7 +49,8 @@ extern KaleidoscopePlugins::FingerPainter FingerPainter; #define FOCUS_HOOK_FINGERPAINTER FOCUS_HOOK(FingerPainter.focusHook, \ "fingerpainter.palette\n" \ - "fingerpainter.toggle") + "fingerpainter.toggle\n" \ + "fingerpainter.clear") #define FINGERPAINTER_PALETTE_EGA (const cRGB[]) { \ CRGB (0x00, 0x00, 0x00), \