From e1618d0e81f5f867f6a796025ac8c8148c72a471 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Tue, 27 Feb 2024 20:15:07 -0800 Subject: [PATCH] Convert all of the settings_addr_ uses to settings_base_ to better match the rest of our code. --- .../src/kaleidoscope/plugin/MouseKeys.h | 2 +- .../src/kaleidoscope/plugin/MouseKeysConfig.cpp | 8 ++++---- .../src/kaleidoscope/plugin/OneShot.h | 2 +- .../src/kaleidoscope/plugin/OneShotConfig.cpp | 8 ++++---- .../src/kaleidoscope/plugin/PersistentLEDMode.cpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys.h b/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys.h index 768e282913..48a41d9ca1 100644 --- a/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys.h +++ b/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeys.h @@ -202,7 +202,7 @@ class MouseKeysConfig : public Plugin { private: // The base address in persistent storage for configuration data: - uint16_t settings_addr_; + uint16_t settings_base_; }; } // namespace plugin diff --git a/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeysConfig.cpp b/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeysConfig.cpp index a1940348b8..a1f0fedb0b 100644 --- a/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeysConfig.cpp +++ b/plugins/Kaleidoscope-MouseKeys/src/kaleidoscope/plugin/MouseKeysConfig.cpp @@ -33,12 +33,12 @@ namespace plugin { // MouseKeys configurator EventHandlerResult MouseKeysConfig::onSetup() { - settings_addr_ = ::EEPROMSettings.requestSliceAndData(&::MouseKeys.settings_, sizeof(MouseKeys::settings_)); + settings_base_ = ::EEPROMSettings.requestSliceAndData(&::MouseKeys.settings_, sizeof(MouseKeys::settings_)); // If the EEPROM is empty, store the default settings. - if (!::EEPROMSettings.isSliceValid(settings_addr_, sizeof(::MouseKeys.settings_))) { - Runtime.storage().put(settings_addr_, ::MouseKeys.settings_); + if (!::EEPROMSettings.isSliceValid(settings_base_, sizeof(::MouseKeys.settings_))) { + Runtime.storage().put(settings_base_, ::MouseKeys.settings_); Runtime.storage().commit(); } @@ -141,7 +141,7 @@ EventHandlerResult MouseKeysConfig::onFocusEvent(const char *input) { // Update settings stored in EEPROM, and indicate that this Focus event has // been handled successfully. - Runtime.storage().put(settings_addr_, ::MouseKeys.settings_); + Runtime.storage().put(settings_base_, ::MouseKeys.settings_); Runtime.storage().commit(); return EventHandlerResult::EVENT_CONSUMED; } diff --git a/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.h b/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.h index d6eb2d1b41..526d77201a 100644 --- a/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.h +++ b/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShot.h @@ -263,7 +263,7 @@ class OneShotConfig : public Plugin { private: // The base address in persistent storage for configuration data: - uint16_t settings_addr_; + uint16_t settings_base_; }; } // namespace plugin diff --git a/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShotConfig.cpp b/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShotConfig.cpp index 48dd4c29a6..2b93a8a564 100644 --- a/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShotConfig.cpp +++ b/plugins/Kaleidoscope-OneShot/src/kaleidoscope/plugin/OneShotConfig.cpp @@ -30,11 +30,11 @@ namespace kaleidoscope { namespace plugin { EventHandlerResult OneShotConfig::onSetup() { - settings_addr_ = ::EEPROMSettings.requestSliceAndData(&::OneShot.settings_, sizeof(::OneShot.settings_)); + settings_base_ = ::EEPROMSettings.requestSliceAndData(&::OneShot.settings_, sizeof(::OneShot.settings_)); // If the EEPROM is empty, store the default settings. - if (!::EEPROMSettings.isSliceValid(settings_addr_, sizeof(::OneShot.settings_))) { - Runtime.storage().put(settings_addr_, ::OneShot.settings_); + if (!::EEPROMSettings.isSliceValid(settings_base_, sizeof(::OneShot.settings_))) { + Runtime.storage().put(settings_base_, ::OneShot.settings_); Runtime.storage().commit(); } @@ -143,7 +143,7 @@ EventHandlerResult OneShotConfig::onFocusEvent(const char *input) { default: return EventHandlerResult::ABORT; } - Runtime.storage().put(settings_addr_, ::OneShot.settings_); + Runtime.storage().put(settings_base_, ::OneShot.settings_); Runtime.storage().commit(); } diff --git a/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.cpp b/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.cpp index 04f03396d7..200b3535fb 100644 --- a/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.cpp +++ b/plugins/Kaleidoscope-PersistentLEDMode/src/kaleidoscope/plugin/PersistentLEDMode.cpp @@ -38,7 +38,7 @@ EventHandlerResult PersistentLEDMode::onSetup() { settings_base_ = ::EEPROMSettings.requestSliceAndData(&settings_, sizeof(settings_)); // If the EEPROM is empty, store the default settings. - if (::EEPROMSettings.isSliceValid(settings_addr_, sizeof(settings_))) { + if (::EEPROMSettings.isSliceValid(settings_base_, sizeof(settings_))) { ::LEDControl.set_mode(settings_.default_mode_index); }