From a134c07a83df8469178c54565e8124c8b467c152 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 26 Jan 2016 15:03:12 -0800 Subject: [PATCH] data type modernization --- KeyboardioFirmware.h | 8 ++------ storage.cpp | 6 +++--- storage.h | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/KeyboardioFirmware.h b/KeyboardioFirmware.h index d81c74a0..1ca31709 100644 --- a/KeyboardioFirmware.h +++ b/KeyboardioFirmware.h @@ -39,15 +39,11 @@ char y; uint8_t matrixState[ROWS][COLS] = {0}; static const Key keymaps[KEYMAPS][ROWS][COLS] = { KEYMAP_LIST }; -byte primary_keymap = 0; -byte temporary_keymap = 0; - - - - // EEPROM related void save_primary_keymap(byte keymap); byte load_primary_keymap(); +uint8_t primary_keymap = 0; +uint8_t temporary_keymap = 0; diff --git a/storage.cpp b/storage.cpp index 9781be9b..177717f1 100644 --- a/storage.cpp +++ b/storage.cpp @@ -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); } -byte KeyboardStorage::load_primary_keymap() { - byte keymap = EEPROM.read(EEPROM_KEYMAP_LOCATION); +uint8_t KeyboardStorage::load_primary_keymap() { + uint8_t keymap = EEPROM.read(EEPROM_KEYMAP_LOCATION); if (keymap >= KEYMAPS ) { return 0; // undefined positions get saved as 255 } diff --git a/storage.h b/storage.h index b3e77b1c..9d4abc40 100644 --- a/storage.h +++ b/storage.h @@ -4,6 +4,6 @@ class KeyboardStorage { public: - byte load_primary_keymap(); - void save_primary_keymap(byte keymap); + uint8_t load_primary_keymap(); + void save_primary_keymap(uint8_t keymap); };