Move Storage to the hardware library too

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/97/head
Gergely Nagy 8 years ago
parent f0a191d6b1
commit 8d768e12a7

@ -16,7 +16,7 @@ Keyboardio_::setup(const byte keymap_count) {
event_handler_hook_use (NULL);
loop_hook_use (NULL);
Layer.defaultLayer (Storage.load_primary_keymap (keymap_count));
Layer.defaultLayer (KeyboardHardware.load_primary_layer (keymap_count));
}
custom_loop_t loopHooks[HOOK_MAX];

@ -1,19 +0,0 @@
#include "Storage.h"
Storage_::Storage_(void) {
}
void Storage_::save_primary_keymap(uint8_t keymap) {
EEPROM.write(EEPROM_KEYMAP_LOCATION, keymap);
}
uint8_t Storage_::load_primary_keymap(uint8_t keymap_count) {
uint8_t keymap = EEPROM.read(EEPROM_KEYMAP_LOCATION);
if (keymap >= keymap_count) {
return 0; // undefined positions get saved as 255
}
return 0; // return keymap;
}
Storage_ Storage;

@ -1,15 +0,0 @@
#pragma once
#include <Arduino.h>
#include <EEPROM.h>
#define EEPROM_KEYMAP_LOCATION 0
class Storage_ {
public:
Storage_(void);
uint8_t load_primary_keymap(uint8_t keymap_count);
void save_primary_keymap(uint8_t keymap);
};
extern Storage_ Storage;

@ -5,7 +5,6 @@
#include KEYBOARDIO_HARDWARE_H
#include "key_defs.h"
#include "keyswitch_state.h"
#include "Storage.h"
#include "hooks.h"
extern const Key keymaps[][ROWS][COLS];

Loading…
Cancel
Save