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