diff --git a/src/config.cpp b/src/config.cpp index 3c1b46b..c9b6a76 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -79,6 +79,10 @@ void config_valid() { body->controller_mode = 2; printf("[Config] controller_mode is invalid\n"); } + if (body->config_version != CONFIG_VERSION) { + body->config_version = CONFIG_VERSION; + printf("[Config] Warning: Config may breking change\n"); + } } void config_load() { diff --git a/src/config.h b/src/config.h index 2add120..92a015a 100644 --- a/src/config.h +++ b/src/config.h @@ -8,7 +8,7 @@ #include struct __attribute__((packed)) Config_body { - uint8_t config_version = 1; // Config Version + uint8_t config_version; // Config Version float haptics_gain; // [1.0,2.0] float speaker_volume; // [-100,0] uint8_t inactive_time; // [10,60] min