|
|
@ -21,7 +21,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace kaleidoscope {
|
|
|
|
namespace kaleidoscope {
|
|
|
|
|
|
|
|
|
|
|
|
#define INTERPOLATE // smoother, slower animation
|
|
|
|
#define INTERPOLATE 1 // smoother, slower animation
|
|
|
|
#define MS_PER_FRAME 40 // 40 = 25 fps
|
|
|
|
#define MS_PER_FRAME 40 // 40 = 25 fps
|
|
|
|
#define FRAMES_PER_DROP 120 // max time between raindrops during idle animation
|
|
|
|
#define FRAMES_PER_DROP 120 // max time between raindrops during idle animation
|
|
|
|
|
|
|
|
|
|
|
@ -38,16 +38,9 @@ PROGMEM const uint8_t WavepoolEffect::rc2pos[ROWS*COLS] = {
|
|
|
|
42, 43, 44, 45, 46, 47, 58,62, 63,67, 50, 51, 52, 53, 54, 55,
|
|
|
|
42, 43, 44, 45, 46, 47, 58,62, 63,67, 50, 51, 52, 53, 54, 55,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
WavepoolEffect::WavepoolEffect(void) {
|
|
|
|
EventHandlerResult WavepoolEffect::onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t key_state) {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WavepoolEffect::setup(void) {
|
|
|
|
|
|
|
|
Kaleidoscope.useEventHandlerHook(eventHandlerHook);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Key WavepoolEffect::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state) {
|
|
|
|
|
|
|
|
if (row >= ROWS || col >= COLS)
|
|
|
|
if (row >= ROWS || col >= COLS)
|
|
|
|
return mapped_key;
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
|
|
|
|
|
|
|
|
if (keyIsPressed(key_state)) {
|
|
|
|
if (keyIsPressed(key_state)) {
|
|
|
|
uint8_t offset = (row*COLS)+col;
|
|
|
|
uint8_t offset = (row*COLS)+col;
|
|
|
@ -55,7 +48,7 @@ Key WavepoolEffect::eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t
|
|
|
|
frames_since_event = 0;
|
|
|
|
frames_since_event = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return mapped_key;
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WavepoolEffect::raindrop(uint8_t x, uint8_t y, int8_t *page) {
|
|
|
|
void WavepoolEffect::raindrop(uint8_t x, uint8_t y, int8_t *page) {
|
|
|
|