Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Feb 13, 2025
1 parent 9042294 commit 45529e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions applications/services/power/power_service/power_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
#define POWER_SETTINGS_VER_1 (1) // Previous version number
#define POWER_SETTINGS_VER (2) // New version number

#define POWER_SETTINGS_PATH INT_PATH(POWER_SETTINGS_FILE_NAME)
#define POWER_SETTINGS_MAGIC (0x18)
#define POWER_SETTINGS_PATH INT_PATH(POWER_SETTINGS_FILE_NAME)
#define POWER_SETTINGS_MAGIC_V1 (0x19)
#define POWER_SETTINGS_MAGIC (0x21)

typedef struct {
uint32_t auto_poweroff_delay_ms;
Expand Down Expand Up @@ -42,10 +43,11 @@ void power_settings_load(PowerSettings* settings) {
POWER_SETTINGS_PATH,
settings_previous,
sizeof(PowerSettingsPrevious),
POWER_SETTINGS_MAGIC,
POWER_SETTINGS_MAGIC_V1,
POWER_SETTINGS_VER_1);
// new settings initialization
if(success) {
settings->auto_poweroff_delay_ms = settings_previous->auto_poweroff_delay_ms;
settings->charge_supress_percent = 0;
}

Expand Down

0 comments on commit 45529e7

Please sign in to comment.