data type modernization

pull/18/head
Jesse Vincent 9 years ago
parent 956c974aed
commit a134c07a83

@ -39,15 +39,11 @@ char y;
uint8_t matrixState[ROWS][COLS] = {0}; uint8_t matrixState[ROWS][COLS] = {0};
static const Key keymaps[KEYMAPS][ROWS][COLS] = { KEYMAP_LIST }; static const Key keymaps[KEYMAPS][ROWS][COLS] = { KEYMAP_LIST };
byte primary_keymap = 0;
byte temporary_keymap = 0;
// EEPROM related // EEPROM related
void save_primary_keymap(byte keymap); void save_primary_keymap(byte keymap);
byte load_primary_keymap(); byte load_primary_keymap();
uint8_t primary_keymap = 0;
uint8_t temporary_keymap = 0;

@ -2,12 +2,12 @@
void KeyboardStorage::save_primary_keymap(byte keymap) { void KeyboardStorage::save_primary_keymap(uint8_t keymap) {
EEPROM.write(EEPROM_KEYMAP_LOCATION, keymap); EEPROM.write(EEPROM_KEYMAP_LOCATION, keymap);
} }
byte KeyboardStorage::load_primary_keymap() { uint8_t KeyboardStorage::load_primary_keymap() {
byte keymap = EEPROM.read(EEPROM_KEYMAP_LOCATION); uint8_t keymap = EEPROM.read(EEPROM_KEYMAP_LOCATION);
if (keymap >= KEYMAPS ) { if (keymap >= KEYMAPS ) {
return 0; // undefined positions get saved as 255 return 0; // undefined positions get saved as 255
} }

@ -4,6 +4,6 @@
class KeyboardStorage { class KeyboardStorage {
public: public:
byte load_primary_keymap(); uint8_t load_primary_keymap();
void save_primary_keymap(byte keymap); void save_primary_keymap(uint8_t keymap);
}; };

Loading…
Cancel
Save