Merge Power service refactor, rework power settings

- Merge OFW power service refactor stuff
- Move charge cap variable to service
- Mirror settings usage of desktop and bt services for power settings
- Proper power settings struct, no more weird settings pubsub
- Load power settings on SD insert
- Set shutdown on idle time in main power settings menu, not in submenu
- Update battery icon visibility in power tick event
- Remove unused power functions (power_trigger_ui_update(), power_set_battery_icon_enabled())
This commit is contained in:
Willy-JL
2024-08-13 21:25:19 +02:00
parent e5a9c22547
commit 1a1b3f117a
15 changed files with 445 additions and 354 deletions

View File

@@ -1,18 +1,10 @@
#include <toolbox/saved_struct.h>
#include <storage/storage.h>
#pragma once
#define POWER_SETTINGS_VER (1)
#include <stdint.h>
#define POWER_SETTINGS_MAGIC (0x21)
typedef struct {
uint32_t shutdown_idle_delay_ms;
} PowerSettings;
#ifdef __cplusplus
extern "C" {
#endif
bool SAVE_POWER_SETTINGS(uint32_t* x);
bool LOAD_POWER_SETTINGS(uint32_t* x);
#ifdef __cplusplus
}
#endif
void power_settings_load(PowerSettings* settings);
void power_settings_save(const PowerSettings* settings);