From 377ccc477f91444ea08bbcbe2f4eec77d4e03e80 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Fri, 11 Oct 2019 12:14:32 +0200 Subject: [PATCH] Small changes in settings. --- src/settings.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/settings.cpp b/src/settings.cpp index 93134ec..7eaac23 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -47,14 +47,15 @@ Setting all_settings[] = { {"effects.tv_static.black_bar_speed", &settings.effects.tv_static.black_bar_speed, TYPE_UINT16}, }; -const uint8_t all_settings_size = 28; +const uint8_t all_settings_size = 29; bool change_setting(const char* key, uint16_t new_value) { LOGln("Settings * Setting %s to new value %d.", key, new_value); Setting* s = NULL; for (uint8_t i=0; iname)==0) { break; } } @@ -99,13 +100,14 @@ bool save_settings() { return false; } - for (int i=0; ivalue); + uint16_t default_value = setting_default(s); if (default_value != value) { char buf[50]; - snprintf(buf, 50, "%s=%d", s.name, value); + snprintf(buf, 50, "%s=%d", s->name, value); LOGln("Saving: %s", buf); f.println(buf); }