diff --git a/README.md b/README.md index 9e247684..ec8373da 100644 --- a/README.md +++ b/README.md @@ -40,12 +40,15 @@ We can then update the keymap via [Focus][plugin:focus]. #include #include +KALEIDOSCOPE_INIT_PLUGINS(EEPROMSettings, + EEPROMKeymap, + Focus); + void setup() { Serial.begin(9600); - Kaleidoscope.use(&EEPROMKeymap, &Focus); - + Kaleidoscope.setup(); - + Focus.addHook(FOCUS_HOOK_KEYMAP); Focus.addHook(FOCUS_HOOK_KEYMAP_TRANSFER); diff --git a/examples/EEPROM-Keymap/EEPROM-Keymap.ino b/examples/EEPROM-Keymap/EEPROM-Keymap.ino index 1f3dd91d..5a1bb85c 100644 --- a/examples/EEPROM-Keymap/EEPROM-Keymap.ino +++ b/examples/EEPROM-Keymap/EEPROM-Keymap.ino @@ -1,6 +1,6 @@ /* -*- mode: c++ -*- * Kaleidoscope-EEPROM-Keymap -- EEPROM-based keymap support. - * Copyright (C) 2017 Gergely Nagy + * Copyright (C) 2017, 2018 Gergely Nagy * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ #include #include +// *INDENT-OFF* const Key keymaps[][ROWS][COLS] PROGMEM = { [0] = KEYMAP_STACKED (Key_NoKey, Key_1, Key_2, Key_3, Key_4, Key_5, Key_NoKey, @@ -32,18 +33,19 @@ const Key keymaps[][ROWS][COLS] PROGMEM = { Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip, Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals, - Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, + Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl, Key_skip), }; +// *INDENT-ON* + +KALEIDOSCOPE_INIT_PLUGINS(EEPROMSettings, EEPROMKeymap, Focus); void setup() { Serial.begin(9600); - Kaleidoscope.use(&EEPROMKeymap, &Focus); - Kaleidoscope.setup(); Focus.addHook(FOCUS_HOOK_SETTINGS); diff --git a/src/Kaleidoscope/EEPROM-Keymap.cpp b/src/Kaleidoscope/EEPROM-Keymap.cpp index a581c464..015854ac 100644 --- a/src/Kaleidoscope/EEPROM-Keymap.cpp +++ b/src/Kaleidoscope/EEPROM-Keymap.cpp @@ -1,6 +1,6 @@ /* -*- mode: c++ -*- * Kaleidoscope-EEPROM-Keymap -- EEPROM-based keymap support. - * Copyright (C) 2017 Gergely Nagy + * Copyright (C) 2017, 2018 Gergely Nagy * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,13 +24,6 @@ namespace kaleidoscope { uint16_t EEPROMKeymap::keymap_base_; uint8_t EEPROMKeymap::max_layers_; -EEPROMKeymap::EEPROMKeymap(void) { -} - -void EEPROMKeymap::begin(void) { - Kaleidoscope.use(&::EEPROMSettings); -} - void EEPROMKeymap::max_layers(uint8_t max) { max_layers_ = max; keymap_base_ = ::EEPROMSettings.requestSlice(max_layers_ * ROWS * COLS * 2); diff --git a/src/Kaleidoscope/EEPROM-Keymap.h b/src/Kaleidoscope/EEPROM-Keymap.h index 66c89620..564fce98 100644 --- a/src/Kaleidoscope/EEPROM-Keymap.h +++ b/src/Kaleidoscope/EEPROM-Keymap.h @@ -1,6 +1,6 @@ /* -*- mode: c++ -*- * Kaleidoscope-EEPROM-Keymap -- EEPROM-based keymap support. - * Copyright (C) 2017 Gergely Nagy + * Copyright (C) 2017, 2018 Gergely Nagy * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,14 +22,12 @@ #include namespace kaleidoscope { -class EEPROMKeymap : public KaleidoscopePlugin { +class EEPROMKeymap : public kaleidoscope::Plugin { public: - EEPROMKeymap(void); + EEPROMKeymap(void) {} static void max_layers(uint8_t max); - void begin(void) final; - static uint16_t keymap_base(void); static Key getKey(uint8_t layer, byte row, byte col);