Skip to content

Commit 45529e7

Browse files
committed
fix
1 parent 9042294 commit 45529e7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

applications/services/power/power_service/power_settings.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
#define POWER_SETTINGS_VER_1 (1) // Previous version number
1010
#define POWER_SETTINGS_VER (2) // New version number
1111

12-
#define POWER_SETTINGS_PATH INT_PATH(POWER_SETTINGS_FILE_NAME)
13-
#define POWER_SETTINGS_MAGIC (0x18)
12+
#define POWER_SETTINGS_PATH INT_PATH(POWER_SETTINGS_FILE_NAME)
13+
#define POWER_SETTINGS_MAGIC_V1 (0x19)
14+
#define POWER_SETTINGS_MAGIC (0x21)
1415

1516
typedef struct {
1617
uint32_t auto_poweroff_delay_ms;
@@ -42,10 +43,11 @@ void power_settings_load(PowerSettings* settings) {
4243
POWER_SETTINGS_PATH,
4344
settings_previous,
4445
sizeof(PowerSettingsPrevious),
45-
POWER_SETTINGS_MAGIC,
46+
POWER_SETTINGS_MAGIC_V1,
4647
POWER_SETTINGS_VER_1);
4748
// new settings initialization
4849
if(success) {
50+
settings->auto_poweroff_delay_ms = settings_previous->auto_poweroff_delay_ms;
4951
settings->charge_supress_percent = 0;
5052
}
5153

0 commit comments

Comments
 (0)