From ddd7ce47f71dd9ae4b2a5db997cacafecaf3203c Mon Sep 17 00:00:00 2001 From: "kaleidoscope@gergo.csillger.hu" Date: Tue, 15 Aug 2017 23:06:50 +0200 Subject: [PATCH] Updated to use the new LEDMode/LEDControl API Signed-off-by: kaleidoscope@gergo.csillger.hu --- src/Kaleidoscope/LED-Wavepool.cpp | 7 +++---- src/Kaleidoscope/LED-Wavepool.h | 7 ++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Kaleidoscope/LED-Wavepool.cpp b/src/Kaleidoscope/LED-Wavepool.cpp index 152e0bc5..29dd84b0 100644 --- a/src/Kaleidoscope/LED-Wavepool.cpp +++ b/src/Kaleidoscope/LED-Wavepool.cpp @@ -48,9 +48,8 @@ PROGMEM const uint8_t WavepoolEffect::rc2pos[ROWS*COLS] = { WavepoolEffect::WavepoolEffect(void) { } -void WavepoolEffect::begin(void) { - event_handler_hook_use(eventHandlerHook); - LEDMode::begin(); +void WavepoolEffect::setup(void) { + Kaleidoscope.useEventHandlerHook(eventHandlerHook); } Key WavepoolEffect::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state) { @@ -195,7 +194,7 @@ void WavepoolEffect::update(void) { 0xff - intensity, ((uint16_t)intensity)*2); - LEDControl.setCrgbAt(r, c, color); + ::LEDControl.setCrgbAt(r, c, color); } } diff --git a/src/Kaleidoscope/LED-Wavepool.h b/src/Kaleidoscope/LED-Wavepool.h index 3d8d3d14..082b03d5 100644 --- a/src/Kaleidoscope/LED-Wavepool.h +++ b/src/Kaleidoscope/LED-Wavepool.h @@ -29,12 +29,13 @@ class WavepoolEffect : public LEDMode { public: WavepoolEffect(void); - void begin(void) final; - void update(void) final; - // ms before idle animation starts after last keypress static uint16_t idle_timeout; + protected: + void setup(void) final; + void update(void) final; + private: static uint8_t frames_since_event; static int8_t surface[2][WP_WID*WP_HGT];