Drop the V1 plugin API compatibility code

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/365/head
Gergely Nagy 6 years ago
parent 675c0ac475
commit d44044bcc8

@ -139,20 +139,6 @@ cRGB Rainbow::compute(uint8_t *step) {
}
// Legacy V1 API
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
void StalkerEffect::setup(void) {
Kaleidoscope.useEventHandlerHook(legacyEventHandler);
}
Key StalkerEffect::legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t key_state) {
EventHandlerResult r = ::StalkerEffect.onKeyswitchEvent(mapped_key, row, col, key_state);
if (r == EventHandlerResult::OK)
return mapped_key;
return Key_NoKey;
}
#endif
}
kaleidoscope::StalkerEffect StalkerEffect;

@ -38,23 +38,10 @@ class StalkerEffect : public LEDMode {
EventHandlerResult onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t keyState);
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
kaleidoscope::EventHandlerResult onSetup() {
::LEDControl.mode_add(this);
return kaleidoscope::EventHandlerResult::OK;
}
#endif
protected:
void onActivate(void) final;
void update(void) final;
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
void setup(void) final;
static Key legacyEventHandler(Key mapped_key, byte row, byte col, uint8_t key_state);
#endif
private:
static uint16_t step_start_time_;
static uint8_t map_[ROWS][COLS];

Loading…
Cancel
Save