mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-24 19:53:08 +00:00
e3c7201a20
* Furi: rename and move core * Furi: drop CMSIS_OS header and unused api, partially refactor and cleanup the rest * Furi: CMSIS_OS drop and refactoring. * Furi: refactoring, remove cmsis legacy * Furi: fix incorrect assert on queue deallocation, cleanup timer * Furi: improve delay api, get rid of floats * hal: dropped furi_hal_crc * Furi: move DWT based delay to cortex HAL * Furi: update core documentation Co-authored-by: hedger <hedger@nanode.su>
47 lines
849 B
C
Executable file
47 lines
849 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>
|
|
|
|
#define POWER_BATTERY_HEALTHY_LEVEL 70
|
|
|
|
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;
|
|
|
|
bool battery_low;
|
|
bool show_low_bat_level_message;
|
|
uint8_t battery_level;
|
|
uint8_t power_off_timeout;
|
|
|
|
FuriMutex* api_mtx;
|
|
};
|
|
|
|
typedef enum {
|
|
PowerViewPopup,
|
|
PowerViewOff,
|
|
} PowerView;
|