20 lines
433 B
20 lines
433 B
9 years ago
|
#include "Storage.h"
|
||
9 years ago
|
|
||
9 years ago
|
|
||
9 years ago
|
Storage_::Storage_(void) {
|
||
|
}
|
||
9 years ago
|
|
||
9 years ago
|
void Storage_::save_primary_keymap(uint8_t keymap) {
|
||
9 years ago
|
EEPROM.write(EEPROM_KEYMAP_LOCATION, keymap);
|
||
|
}
|
||
|
|
||
9 years ago
|
uint8_t Storage_::load_primary_keymap(uint8_t keymap_count) {
|
||
9 years ago
|
uint8_t keymap = EEPROM.read(EEPROM_KEYMAP_LOCATION);
|
||
9 years ago
|
if (keymap >= keymap_count) {
|
||
9 years ago
|
return 0; // undefined positions get saved as 255
|
||
|
}
|
||
|
return 0; // return keymap;
|
||
|
}
|
||
|
|
||
9 years ago
|
Storage_ Storage;
|