1
0

Merge pull request #65 from keyboardio/f/focus

Support an EEPROM-based keymap overlay & Focus
This commit is contained in:
Jesse Vincent 2018-10-08 16:09:42 -07:00 committed by GitHub
commit 7277753004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,13 @@
// The Kaleidoscope core // The Kaleidoscope core
#include "Kaleidoscope.h" #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 // Support for keys that move the mouse
#include "Kaleidoscope-MouseKeys.h" #include "Kaleidoscope-MouseKeys.h"
@ -396,6 +403,22 @@ USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol,
// The order can be important. For example, LED effects are // The order can be important. For example, LED effects are
// added in the order they're listed here. // added in the order they're listed here.
KALEIDOSCOPE_INIT_PLUGINS( 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 // The boot greeting effect pulses the LED button for 10 seconds after the keyboard is first connected
BootGreetingEffect, BootGreetingEffect,
@ -488,6 +511,12 @@ void setup() {
// This avoids over-taxing devices that don't have a lot of power to share // This avoids over-taxing devices that don't have a lot of power to share
// with USB devices // with USB devices
LEDOff.activate(); 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. /** loop is the second of the standard Arduino sketch functions.