mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-30 00:32:06 +03:00
d3b58f732f
* settings power: introduce power settings app * power: move power API to separate file * settings power: implement reboot scene * settings power: add power off scene * assets: add crying dolphin, fix Subghz assets names * settings power: fix power off scene GUI * settings power: add battery info scene * power: add cli to application on start hook * power: remove power from main menu * power: move to power service folder * power service: rework power off logic * power: add pubsub events * bt: subscribe to battery level change, update characteristic * application: change order of Settings applications * gui: add bubble element * power: gui improvements * application: rename Notification -> LCD and notifications * Applications: menu order according to documentation and add missing power cli init * settings power: add disconnect USB scene * power cli: notify user to disconnect USB after poweroff * Power: update poweroff message in cli Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
31 lines
1.1 KiB
C
31 lines
1.1 KiB
C
#include "power_settings_scene.h"
|
|
|
|
// Generate scene on_enter handlers array
|
|
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_enter,
|
|
void (*const power_settings_on_enter_handlers[])(void*) = {
|
|
#include "power_settings_scene_config.h"
|
|
};
|
|
#undef ADD_SCENE
|
|
|
|
// Generate scene on_event handlers array
|
|
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_event,
|
|
bool (*const power_settings_on_event_handlers[])(void* context, SceneManagerEvent event) = {
|
|
#include "power_settings_scene_config.h"
|
|
};
|
|
#undef ADD_SCENE
|
|
|
|
// Generate scene on_exit handlers array
|
|
#define ADD_SCENE(prefix, name, id) prefix##_scene_##name##_on_exit,
|
|
void (*const power_settings_on_exit_handlers[])(void* context) = {
|
|
#include "power_settings_scene_config.h"
|
|
};
|
|
#undef ADD_SCENE
|
|
|
|
// Initialize scene handlers configuration structure
|
|
const SceneManagerHandlers power_settings_scene_handlers = {
|
|
.on_enter_handlers = power_settings_on_enter_handlers,
|
|
.on_event_handlers = power_settings_on_event_handlers,
|
|
.on_exit_handlers = power_settings_on_exit_handlers,
|
|
.scene_num = PowerSettingsAppSceneNum,
|
|
};
|