-
Notifications
You must be signed in to change notification settings - Fork 2
/
yuricable_pro_max.h
89 lines (79 loc) · 2.19 KB
/
yuricable_pro_max.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#pragma once
#include <furi.h>
#include <furi_hal_light.h>
#include <gui/gui.h>
#include <gui/view_dispatcher.h>
#include <gui/scene_manager.h>
#include <gui/modules/widget.h>
#include <gui/modules/submenu.h>
#include <power/power_service/power.h>
#include "lib/sdq/sdq_device.c"
typedef enum { EventTypeKey } EventType;
typedef enum {
YuriCableProMaxMainMenuScene,
YuriCableProMaxDCSDScene,
YuriCableProMaxResetScene,
YuriCableProMaxDFUScene,
YuriCableProMaxCharginScene,
YuriCableProMaxSceneCount
} YuriCableProMaxScene;
typedef enum {
YuriCableProMaxSubmenuView,
YuriCableProMaxWidgetView,
} YuriCableProMaxView;
typedef enum {
YuriCableProMaxMainMenuSceneDCSD,
YuriCableProMaxMainMenuSceneReset,
YuriCableProMaxMainMenuSceneDFU,
YuriCableProMaxMainMenuSceneCharging,
} YuriCableProMaxMainMenuSceneIndex;
typedef enum {
YuriCableProMaxMainMenuTitle,
YuriCableProMaxDCSDSubmenuTitle,
YuriCableProMaxResetSubmenuTitle,
YuriCableProMaxDFUSubmenuTitle,
YuriCableProMaxChargingSubmenuTitle,
YuriCableProMaxSubmenuTitlesCount
} YuriCableProMaxSubmenuTitles;
const char* YuriCableProMaxSubmenuTitlesStrings[] = {
"YuriCable Pro Max",
"DCSD - Bootlog",
"Force Reset",
"Force DFU",
"5V Charging",
};
typedef struct {
SDQDevice* sdq;
IconAnimation* listeningAnimation;
YuriCableProMaxSubmenuTitles selectedSubmenu;
bool ledMainMenu;
bool ledSequenceCommandExecutedPlayed;
} YuriCableData;
typedef struct App {
Gui* gui;
SceneManager* scene_manager;
ViewDispatcher* view_dispatcher;
Submenu* submenu;
Widget* widget;
FuriMessageQueue* queue;
FuriMutex* mutex;
YuriCableData* data;
FuriThread* led_thread;
FuriThread* battery_info_update_thread;
Power* power;
PowerInfo info;
} App;
typedef enum {
YuriCableProMaxMainMenuSceneDCSDModeEvent,
YuriCableProMaxMainMenuSceneResetModeEvent,
YuriCableProMaxMainMenuSceneDFUModeEvent,
YuriCableProMaxMainMenuSceneChargingModeEvent
} YuriCableProMaxMainMenuSceneEvent;
typedef struct {
EventType type;
InputEvent input;
} Event;
typedef enum {
LedEvtStop = (1 << 0),
LedEvtStart = (1 << 1),
} LedEvtFlags;