From 13954d0165c1379ed0c2d79ddfcacf8add50f42f Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 29 Jan 2016 19:08:21 -0800 Subject: [PATCH] Rename KeyboardStorage to Storage --- KeyboardioFirmware.h | 3 --- KeyboardioFirmware.ino | 3 --- key_events.h | 2 -- storage.cpp | 7 +++++-- storage.h | 7 +++++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/KeyboardioFirmware.h b/KeyboardioFirmware.h index 36d3aadd..e56c63c3 100644 --- a/KeyboardioFirmware.h +++ b/KeyboardioFirmware.h @@ -33,9 +33,6 @@ extern const Key keymaps[KEYMAPS][ROWS][COLS]; extern uint8_t primary_keymap; extern uint8_t temporary_keymap; -extern KeyboardStorage Storage; - - void scan_matrix(); diff --git a/KeyboardioFirmware.ino b/KeyboardioFirmware.ino index e17017e1..836db63e 100644 --- a/KeyboardioFirmware.ino +++ b/KeyboardioFirmware.ino @@ -12,9 +12,6 @@ const Key keymaps[KEYMAPS][ROWS][COLS] = { KEYMAP_LIST }; uint8_t primary_keymap = 0; uint8_t temporary_keymap = 0; -KeyboardStorage Storage; - - void scan_matrix() { //scan the Keyboard matrix looking for connections diff --git a/key_events.h b/key_events.h index d8e2016b..675a6fb2 100644 --- a/key_events.h +++ b/key_events.h @@ -13,8 +13,6 @@ extern const Key keymaps[KEYMAPS][ROWS][COLS]; extern uint8_t primary_keymap; extern uint8_t temporary_keymap; -extern KeyboardStorage Storage; - // sending events to the computer void handle_synthetic_key_event(byte switchState, Key mappedKey); void handle_key_event(byte row, byte col); diff --git a/storage.cpp b/storage.cpp index 177717f1..a33d6ea1 100644 --- a/storage.cpp +++ b/storage.cpp @@ -1,12 +1,14 @@ #include "storage.h" +Storage_::Storage_(void) { +} -void KeyboardStorage::save_primary_keymap(uint8_t keymap) { +void Storage_::save_primary_keymap(uint8_t keymap) { EEPROM.write(EEPROM_KEYMAP_LOCATION, keymap); } -uint8_t KeyboardStorage::load_primary_keymap() { +uint8_t Storage_::load_primary_keymap() { uint8_t keymap = EEPROM.read(EEPROM_KEYMAP_LOCATION); if (keymap >= KEYMAPS ) { return 0; // undefined positions get saved as 255 @@ -14,3 +16,4 @@ uint8_t KeyboardStorage::load_primary_keymap() { return 0; // return keymap; } +Storage_ Storage; diff --git a/storage.h b/storage.h index 2c164130..866e9c4f 100644 --- a/storage.h +++ b/storage.h @@ -4,8 +4,11 @@ #include #include "KeyboardConfig.h" -class KeyboardStorage { +class Storage_ { public: - uint8_t load_primary_keymap(); + Storage_(void); + uint8_t load_primary_keymap(void); void save_primary_keymap(uint8_t keymap); }; + +extern Storage_ Storage;