"make astyle

pull/365/head
Jesse Vincent 8 years ago
parent a0cebeb0ee
commit 97008a28f0
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -21,25 +21,25 @@
#include <Kaleidoscope-Focus.h>
namespace KaleidoscopePlugins {
uint16_t EEPROMKeymap::keymapBase;
uint8_t EEPROMKeymap::maxLayers;
uint16_t EEPROMKeymap::keymapBase;
uint8_t EEPROMKeymap::maxLayers;
EEPROMKeymap::EEPROMKeymap (void) {
}
EEPROMKeymap::EEPROMKeymap (void) {
}
void
EEPROMKeymap::begin (void) {
void
EEPROMKeymap::begin (void) {
USE_PLUGINS (&::EEPROMSettings);
}
}
void
EEPROMKeymap::reserveSpace (uint8_t layers) {
void
EEPROMKeymap::reserveSpace (uint8_t layers) {
maxLayers = layers;
keymapBase = ::EEPROMSettings.requestSlice (maxLayers * ROWS * COLS * 2);
}
}
Key
EEPROMKeymap::getKey (uint8_t layer, byte row, byte col) {
Key
EEPROMKeymap::getKey (uint8_t layer, byte row, byte col) {
Key key;
if (layer >= maxLayers)
@ -51,45 +51,45 @@ namespace KaleidoscopePlugins {
key.keyCode = EEPROM.read (keymapBase + pos + 1);
return key;
}
}
Key
EEPROMKeymap::getKeyOverride (uint8_t layer, byte row, byte col) {
Key
EEPROMKeymap::getKeyOverride (uint8_t layer, byte row, byte col) {
Key key;
key = getKey (layer, row, col);
if (key == Key_Transparent)
key = Layer.getKeyFromPROGMEM (layer, row, col);
return key;
}
}
uint16_t
EEPROMKeymap::base (void) {
uint16_t
EEPROMKeymap::base (void) {
return keymapBase;
}
}
void
EEPROMKeymap::updateKey (uint16_t basePos, Key key) {
void
EEPROMKeymap::updateKey (uint16_t basePos, Key key) {
EEPROM.update (keymapBase + basePos * 2, key.flags);
EEPROM.update (keymapBase + basePos * 2 + 1, key.keyCode);
}
}
Key
EEPROMKeymap::parseKey (void) {
Key
EEPROMKeymap::parseKey (void) {
Key key;
key.raw = Serial.parseInt ();
return key;
}
}
void
EEPROMKeymap::printKey (Key k) {
void
EEPROMKeymap::printKey (Key k) {
::Focus.printNumber (k.raw);
}
}
bool
EEPROMKeymap::focusKeymap (const char *command) {
bool
EEPROMKeymap::focusKeymap (const char *command) {
if (strcmp_P (command, PSTR ("keymap.map")) != 0)
return false;
@ -114,10 +114,10 @@ namespace KaleidoscopePlugins {
}
return true;
}
}
bool
EEPROMKeymap::focusKeymapTransfer (const char *command) {
bool
EEPROMKeymap::focusKeymapTransfer (const char *command) {
if (strcmp_P (command, PSTR ("keymap.transfer")) != 0)
return false;
@ -133,7 +133,7 @@ namespace KaleidoscopePlugins {
}
return true;
}
}
};

@ -22,7 +22,7 @@
#include <Kaleidoscope-EEPROM-Settings.h>
namespace KaleidoscopePlugins {
class EEPROMKeymap : public KaleidoscopePlugin {
class EEPROMKeymap : public KaleidoscopePlugin {
public:
EEPROMKeymap (void);
@ -45,7 +45,7 @@ namespace KaleidoscopePlugins {
static Key parseKey (void);
static void printKey (Key key);
};
};
};
extern KaleidoscopePlugins::EEPROMKeymap EEPROMKeymap;

Loading…
Cancel
Save