[preferences] Use static storage for singletons and flash buffer (#13727)

This commit is contained in:
J. Nick Koston
2026-02-03 04:03:52 +01:00
committed by GitHub
parent ae71f07abb
commit 9f1a427ce2
6 changed files with 34 additions and 28 deletions
+4 -3
View File
@@ -203,10 +203,11 @@ class ESP32Preferences : public ESPPreferences {
}
};
static ESP32Preferences s_preferences; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
void setup_preferences() {
auto *prefs = new ESP32Preferences(); // NOLINT(cppcoreguidelines-owning-memory)
prefs->open();
global_preferences = prefs;
s_preferences.open();
global_preferences = &s_preferences;
}
} // namespace esp32