mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-18 08:43:10 +00:00
e9e76e144c
* RPC: Update protobuf sources * RPC: Implement storage_stat_request * RPC: Test storage_stat_request * FuriRecord: fix use after free in destroy method. * Furi: refactor PubSub and it's usage. Fix allocation in RPC. * FuriCore: fix memory leak in pubsub * FuriCore: update unsubscribe method signature in pubsub, make subscription structure lighter. * FuriCore: remove dead code Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
43 lines
773 B
C
Executable file
43 lines
773 B
C
Executable file
#pragma once
|
|
|
|
#include "power.h"
|
|
|
|
#include <stdint.h>
|
|
#include <gui/view_dispatcher.h>
|
|
#include <gui/gui.h>
|
|
|
|
#include <gui/modules/popup.h>
|
|
#include "views/power_off.h"
|
|
|
|
#include <notification/notification-messages.h>
|
|
|
|
typedef enum {
|
|
PowerStateNotCharging,
|
|
PowerStateCharging,
|
|
PowerStateCharged,
|
|
} PowerState;
|
|
|
|
struct Power {
|
|
ViewDispatcher* view_dispatcher;
|
|
Popup* popup;
|
|
PowerOff* power_off;
|
|
|
|
ViewPort* battery_view_port;
|
|
Gui* gui;
|
|
NotificationApp* notification;
|
|
FuriPubSub* 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 {
|
|
PowerViewPopup,
|
|
PowerViewOff,
|
|
} PowerView;
|