diff options
author | gornekich <n.gorbadey@gmail.com> | 2021-09-24 19:28:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-24 19:28:02 +0300 |
commit | d3b58f732f71fc30819ee674bf5a05fdc3222c82 (patch) | |
tree | 2e7a07a9e459cb21861b69ebc91abfeb741fe4b9 /applications/applications.c | |
parent | c64052b4912f56554835504c3c5f112380ce20dc (diff) |
[FL-1783] Power service refactoring (#718)
* 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>
Diffstat (limited to 'applications/applications.c')
-rwxr-xr-x[-rw-r--r--] | applications/applications.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/applications/applications.c b/applications/applications.c index c662bdd9..6c857b20 100644..100755 --- a/applications/applications.c +++ b/applications/applications.c @@ -46,12 +46,14 @@ extern void lfrfid_cli_init(); extern void nfc_cli_init(); extern void storage_cli_init(); extern void subghz_cli_init(); +extern void power_cli_init(); // Settings extern int32_t notification_settings_app(void* p); extern int32_t storage_settings_app(void* p); extern int32_t bt_settings_app(void* p); extern int32_t about_settings_app(void* p); +extern int32_t power_settings_app(void* p); const FlipperApplication FLIPPER_SERVICES[] = { /* Services */ @@ -143,18 +145,14 @@ const size_t FLIPPER_SERVICES_COUNT = sizeof(FLIPPER_SERVICES) / sizeof(FlipperA // Main menu APP const FlipperApplication FLIPPER_APPS[] = { -#ifdef APP_IBUTTON - {.app = ibutton_app, .name = "iButton", .stack_size = 2048, .icon = &A_iButton_14}, +#ifdef APP_SUBGHZ + {.app = subghz_app, .name = "Sub-GHz", .stack_size = 2048, .icon = &A_Sub1ghz_14}, #endif #ifdef APP_NFC {.app = nfc_app, .name = "NFC", .stack_size = 4096, .icon = &A_NFC_14}, #endif -#ifdef APP_SUBGHZ - {.app = subghz_app, .name = "Sub-GHz", .stack_size = 2048, .icon = &A_Sub1ghz_14}, -#endif - #ifdef APP_LF_RFID {.app = lfrfid_app, .name = "125 kHz RFID", .stack_size = 2048, .icon = &A_125khz_14}, #endif @@ -163,6 +161,10 @@ const FlipperApplication FLIPPER_APPS[] = { {.app = irda_app, .name = "Infrared", .stack_size = 1024 * 3, .icon = &A_Infrared_14}, #endif +#ifdef APP_IBUTTON + {.app = ibutton_app, .name = "iButton", .stack_size = 2048, .icon = &A_iButton_14}, +#endif + #ifdef APP_GPIO_TEST {.app = gpio_test_app, .name = "GPIO", .stack_size = 1024, .icon = &A_GPIO_14}, #endif @@ -192,6 +194,9 @@ const FlipperOnStartHook FLIPPER_ON_SYSTEM_START[] = { #ifdef SRV_BT bt_cli_init, #endif +#ifdef SRV_POWER + power_cli_init, +#endif #ifdef SRV_STORAGE storage_cli_init, #endif @@ -258,16 +263,23 @@ const FlipperApplication FLIPPER_ARCHIVE = // Settings menu const FlipperApplication FLIPPER_SETTINGS_APPS[] = { +#ifdef SRV_BT + {.app = bt_settings_app, .name = "Bluetooth", .stack_size = 1024, .icon = NULL}, +#endif + #ifdef SRV_NOTIFICATION - {.app = notification_settings_app, .name = "Notification", .stack_size = 1024, .icon = NULL}, + {.app = notification_settings_app, + .name = "LCD and notifications", + .stack_size = 1024, + .icon = NULL}, #endif #ifdef SRV_STORAGE {.app = storage_settings_app, .name = "Storage", .stack_size = 2048, .icon = NULL}, #endif -#ifdef SRV_BT - {.app = bt_settings_app, .name = "Bluetooth", .stack_size = 1024, .icon = NULL}, +#ifdef SRV_POWER + {.app = power_settings_app, .name = "Power", .stack_size = 1024, .icon = NULL}, #endif #ifdef APP_ABOUT |