add settings locations
Some checks failed
/ build (push) Has been cancelled

This commit is contained in:
Carsten Graf
2025-09-08 22:30:15 +02:00
parent 55eb062d2c
commit 173b13fcfc
13 changed files with 940 additions and 247 deletions

View File

@@ -24,15 +24,15 @@ void loadButtonConfig() {
// Persist and load best times
void saveBestTimes() {
preferences.begin("times", false);
preferences.putULong("best1", timerData.bestTime1);
preferences.putULong("best2", timerData.bestTime2);
preferences.putULong("best1", timerData1.bestTime);
preferences.putULong("best2", timerData2.bestTime);
preferences.end();
}
void loadBestTimes() {
preferences.begin("times", true);
timerData.bestTime1 = preferences.getULong("best1", 0);
timerData.bestTime2 = preferences.getULong("best2", 0);
timerData1.bestTime = preferences.getULong("best1", 0);
timerData2.bestTime = preferences.getULong("best2", 0);
preferences.end();
}
@@ -93,4 +93,15 @@ int checkLicence() {
return tier;
}
void saveLocationIdToPrefs(const String &locationId) {
preferences.begin("locationid", false);
preferences.putString("locationid", locationId);
preferences.end();
}
String getLocationIdFromPrefs() {
preferences.begin("locationid", true);
String locationId = preferences.getString("locationid", "");
preferences.end();
return locationId;
}