summaryrefslogtreecommitdiffstats
path: root/Model01-Firmware.ino
diff options
context:
space:
mode:
Diffstat (limited to 'Model01-Firmware.ino')
-rw-r--r--Model01-Firmware.ino29
1 files changed, 29 insertions, 0 deletions
diff --git a/Model01-Firmware.ino b/Model01-Firmware.ino
index 2789078..371effb 100644
--- a/Model01-Firmware.ino
+++ b/Model01-Firmware.ino
@@ -16,6 +16,13 @@
// The Kaleidoscope core
#include "Kaleidoscope.h"
+// Support for storing the keymap in EEPROM
+#include "Kaleidoscope-EEPROM-Settings.h"
+#include "Kaleidoscope-EEPROM-Keymap.h"
+
+// Support for communicating with the host via a simple Serial protocol
+#include "Kaleidoscope-FocusSerial.h"
+
// Support for keys that move the mouse
#include "Kaleidoscope-MouseKeys.h"
@@ -396,6 +403,22 @@ USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol,
// The order can be important. For example, LED effects are
// added in the order they're listed here.
KALEIDOSCOPE_INIT_PLUGINS(
+ // The EEPROMSettings & EEPROMKeymap plugins make it possible to have an
+ // editable keymap in EEPROM.
+ EEPROMSettings,
+ EEPROMKeymap,
+
+ // Focus allows bi-directional communication with the host, and is the
+ // interface through which the keymap in EEPROM can be edited.
+ Focus,
+
+ // FocusSettingsCommand adds a few Focus commands, intended to aid in changing some settings of the keyboard, such as the default layer (via the `settings.defaultLayer` command)
+ FocusSettingsCommand,
+
+ // FocusEEPROMCommand adds a set of Focus commands, which are very helpful in
+ // both debugging, and in backing up one's EEPROM contents.
+ FocusEEPROMCommand,
+
// The boot greeting effect pulses the LED button for 10 seconds after the keyboard is first connected
BootGreetingEffect,
@@ -488,6 +511,12 @@ void setup() {
// This avoids over-taxing devices that don't have a lot of power to share
// with USB devices
LEDOff.activate();
+
+ // To make the keymap editable without flashing new firmware, we store
+ // additional layers in EEPROM. For now, we reserve space for five layers. If
+ // one wants to use these layers, just set the default layer to one in EEPROM,
+ // by using the `settings.defaultLayer` Focus command.
+ EEPROMKeymap.setup(5, EEPROMKeymap.Mode::EXTEND);
}
/** loop is the second of the standard Arduino sketch functions.