Updated to use the new plugin APIs

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/365/head
Gergely Nagy 7 years ago
parent e9111f595c
commit 435018eb6a

@ -40,12 +40,15 @@ We can then update the keymap via [Focus][plugin:focus].
#include <Kaleidoscope-EEPROM-Settings.h>
#include <Kaleidoscope-Focus.h>
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);

@ -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 <Kaleidoscope-EEPROM-Keymap.h>
#include <Kaleidoscope-Focus.h>
// *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);

@ -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);

@ -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 <Kaleidoscope-EEPROM-Settings.h>
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);

Loading…
Cancel
Save