diff options
author | Jesse Vincent <jesse@fsck.com> | 2018-10-08 16:09:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-08 16:09:42 -0700 |
commit | 72777530040fea32568c578e988ac54eaa23cafa (patch) | |
tree | 8495204b682e6bd52cbd73399a182f558fb56422 /Model01-Firmware.ino | |
parent | c24497f0e6b3fb7254c80da3bfcde68464aa9e2d (diff) | |
parent | 718aba9a43351e8bc327a71ce13167815809c622 (diff) | |
download | model01-firmware-72777530040fea32568c578e988ac54eaa23cafa.tar.gz model01-firmware-72777530040fea32568c578e988ac54eaa23cafa.tar.bz2 model01-firmware-72777530040fea32568c578e988ac54eaa23cafa.zip |
Merge pull request #65 from keyboardio/f/focus
Support an EEPROM-based keymap overlay & Focus
Diffstat (limited to 'Model01-Firmware.ino')
-rw-r--r-- | Model01-Firmware.ino | 29 |
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. |