Skip to content

Commit

Permalink
Fix battery not being initialized before battery_manager runs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakkra committed Oct 24, 2023
1 parent 1ed04b4 commit 4a4bacb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ if SPI_FLASH_LOADER
endif
endmenu


menu "ZSWatch Init Priorities"
config ZSW_DRIVER_INIT_PRIORITY
int
default 85

endmenu

rsource "drivers/Kconfig"

module = APP
Expand Down
2 changes: 1 addition & 1 deletion app/src/battery/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ unsigned int battery_level_pptt(unsigned int batt_mV,
/ (pa->lvl_mV - pb->lvl_mV));
}

SYS_INIT(battery_setup, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
SYS_INIT(battery_setup, APPLICATION, CONFIG_ZSW_DRIVER_INIT_PRIORITY);

#else

Expand Down
2 changes: 1 addition & 1 deletion app/src/drivers/zsw_vibration_motor.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ static int vibration_motor_init(void)
return 0;
}

SYS_INIT(vibration_motor_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);
SYS_INIT(vibration_motor_init, APPLICATION, CONFIG_ZSW_DRIVER_INIT_PRIORITY);

0 comments on commit 4a4bacb

Please sign in to comment.