From f27a3a46ec3fc6cd93400d6b14d2c96edebf8a8c Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 17 Aug 2017 12:01:21 +0200 Subject: [PATCH] Stop using deprecated interfaces Use `Kaleidoscope.use`, `Kaleidoscope.useEventHandlerHook`, and `Kaleidoscope.useLoopHook` instead of `USE_PLUGINS`, `event_handler_hook_use`, and `loop_hook_use`, which are getting deprecated. Signed-off-by: Gergely Nagy --- README.md | 10 +++++----- examples/Leader/Leader.ino | 2 +- src/Kaleidoscope/Leader.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d8326b41..d48d0601 100644 --- a/README.md +++ b/README.md @@ -48,17 +48,17 @@ static void leaderTX() { Serial.println("leaderTX"); } -static const kaleidoscope::Leader::dictionary_t leader_dictionary PROGMEM = +static const kaleidoscope::Leader::dictionary_t leader_dictionary PROGMEM = LEADER_DICT({LEADER_SEQ(LEAD(0), Key_A), leaderA}, {LEADER_SEQ(LEAD(0), Key_T, Key_X), leaderTX}); void setup() { Serial.begin(9600); - - USE_PLUGINS(&Leader); - + + Kaleidoscope.use(&Leader); + Kaleidoscope.setup(); - + Leader.dictionary = leader_dictionary; } ``` diff --git a/examples/Leader/Leader.ino b/examples/Leader/Leader.ino index 6d5a5d3d..ee25451d 100644 --- a/examples/Leader/Leader.ino +++ b/examples/Leader/Leader.ino @@ -51,7 +51,7 @@ LEADER_DICT({LEADER_SEQ(LEAD(0), Key_A), leaderTestA}, {LEADER_SEQ(LEAD(0), Key_A, Key_A), leaderTestAA}); void setup() { - USE_PLUGINS(&Leader); + Kaleidoscope.use(&Leader); Kaleidoscope.setup(); diff --git a/src/Kaleidoscope/Leader.cpp b/src/Kaleidoscope/Leader.cpp index e2ff1457..aa075e55 100644 --- a/src/Kaleidoscope/Leader.cpp +++ b/src/Kaleidoscope/Leader.cpp @@ -75,8 +75,8 @@ Leader::Leader(void) { } void Leader::begin(void) { - event_handler_hook_use(eventHandlerHook); - loop_hook_use(loopHook); + Kaleidoscope.useEventHandlerHook(eventHandlerHook); + Kaleidoscope.useLoopHook(loopHook); } void Leader::reset(void) {