[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>
This commit is contained in:
37
applications/power/power_service/power_i.h
Executable file
37
applications/power/power_service/power_i.h
Executable file
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include "power.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <gui/view_dispatcher.h>
|
||||
#include <gui/gui.h>
|
||||
#include "views/power_off.h"
|
||||
|
||||
#include <notification/notification-messages.h>
|
||||
|
||||
typedef enum {
|
||||
PowerStateNotCharging,
|
||||
PowerStateCharging,
|
||||
PowerStateCharged,
|
||||
} PowerState;
|
||||
|
||||
struct Power {
|
||||
ViewDispatcher* view_dispatcher;
|
||||
PowerOff* power_off;
|
||||
|
||||
ViewPort* battery_view_port;
|
||||
Gui* gui;
|
||||
NotificationApp* notification;
|
||||
PubSub event_pubsub;
|
||||
PowerEvent event;
|
||||
|
||||
PowerState state;
|
||||
PowerInfo info;
|
||||
osMutexId_t info_mtx;
|
||||
|
||||
bool battery_low;
|
||||
uint8_t battery_level;
|
||||
uint8_t power_off_timeout;
|
||||
};
|
||||
|
||||
typedef enum { PowerViewOff } PowerView;
|
Reference in New Issue
Block a user