Small changes in settings.
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Fabian Schlenz 2019-10-11 12:14:32 +02:00
parent efebe9adb4
commit 377ccc477f

View File

@ -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; i<all_settings_size; i++) {
if (strcmp(key, all_settings[i].name)==0) {
s = &all_settings[i];
s = &(all_settings[i]);
if (strcmp(key, s->name)==0) {
break;
}
}
@ -99,13 +100,14 @@ bool save_settings() {
return false;
}
for (int i=0; i<all_settings_size; i++) {
Setting s = all_settings[i];
uint16_t value = *(s.value);
uint16_t default_value = setting_default(&s);
Setting* s;
for (uint8_t i=0; i<all_settings_size; i++) {
s = &(all_settings[i]);
uint16_t value = *(s->value);
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);
}