Rename KeyboardStorage to Storage

pull/18/head
Jesse Vincent 9 years ago
parent 26f66d84cc
commit 13954d0165

@ -33,9 +33,6 @@ extern const Key keymaps[KEYMAPS][ROWS][COLS];
extern uint8_t primary_keymap;
extern uint8_t temporary_keymap;
extern KeyboardStorage Storage;
void scan_matrix();

@ -12,9 +12,6 @@ const Key keymaps[KEYMAPS][ROWS][COLS] = { KEYMAP_LIST };
uint8_t primary_keymap = 0;
uint8_t temporary_keymap = 0;
KeyboardStorage Storage;
void scan_matrix() {
//scan the Keyboard matrix looking for connections

@ -13,8 +13,6 @@ extern const Key keymaps[KEYMAPS][ROWS][COLS];
extern uint8_t primary_keymap;
extern uint8_t temporary_keymap;
extern KeyboardStorage Storage;
// sending events to the computer
void handle_synthetic_key_event(byte switchState, Key mappedKey);
void handle_key_event(byte row, byte col);

@ -1,12 +1,14 @@
#include "storage.h"
Storage_::Storage_(void) {
}
void KeyboardStorage::save_primary_keymap(uint8_t keymap) {
void Storage_::save_primary_keymap(uint8_t keymap) {
EEPROM.write(EEPROM_KEYMAP_LOCATION, keymap);
}
uint8_t KeyboardStorage::load_primary_keymap() {
uint8_t Storage_::load_primary_keymap() {
uint8_t keymap = EEPROM.read(EEPROM_KEYMAP_LOCATION);
if (keymap >= KEYMAPS ) {
return 0; // undefined positions get saved as 255
@ -14,3 +16,4 @@ uint8_t KeyboardStorage::load_primary_keymap() {
return 0; // return keymap;
}
Storage_ Storage;

@ -4,8 +4,11 @@
#include <EEPROM.h>
#include "KeyboardConfig.h"
class KeyboardStorage {
class Storage_ {
public:
uint8_t load_primary_keymap();
Storage_(void);
uint8_t load_primary_keymap(void);
void save_primary_keymap(uint8_t keymap);
};
extern Storage_ Storage;

Loading…
Cancel
Save