Update to use the new EEPROM-Settings library

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/365/head
Gergely Nagy 8 years ago
parent 4e1a579136
commit 5a7601bb30

@ -48,11 +48,15 @@ void setup () {
USE_PLUGINS (&EEPROMKeymap, &Focus);
Focus.addHook (FOCUS_HOOK_SETTINGS);
Focus.addHook (FOCUS_HOOK_KEYMAP);
Focus.addHook (FOCUS_HOOK_HELP);
Focus.addHook (FOCUS_HOOK_VERSION);
Layer.getKey = EEPROMKeymap.getKey;
EEPROMKeymap.reserveSpace (2);
EEPROMSettings.seal ();
}
void loop () {

@ -29,10 +29,12 @@ namespace KaleidoscopePlugins {
void
EEPROMKeymap::begin (void) {
USE_PLUGINS (&::EEPROMSettings);
}
uint16_t layerSize = ROWS * COLS * 2;
maxLayers = (E2END - ::EEPROMSettings.endOfSettings ()) / layerSize;
keymapBase = ::EEPROMSettings.endOfSettings () + 1;
void
EEPROMKeymap::reserveSpace (uint8_t layers) {
maxLayers = layers;
keymapBase = ::EEPROMSettings.requestSlice (maxLayers * ROWS * COLS * 2);
}
Key

@ -28,8 +28,11 @@ namespace KaleidoscopePlugins {
virtual void begin (void) final;
static Key getKey (uint8_t layer, byte row, byte col);
static void reserveSpace (uint8_t layers);
static uint16_t base (void);
static Key getKey (uint8_t layer, byte row, byte col);
static bool focusKeymap (const char *command);
private:

Loading…
Cancel
Save