mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-19 09:13:11 +00:00
38 lines
693 B
C
38 lines
693 B
C
|
#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;
|