-
-
Notifications
You must be signed in to change notification settings - Fork 167
/
globals.h
135 lines (99 loc) · 2.63 KB
/
globals.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#pragma once
// Globals.h
//#define FGCOLOR TFT_PURPLE+0x3000
extern char16_t FGCOLOR;
#define ALCOLOR TFT_RED
#define BGCOLOR TFT_BLACK
#include <Arduino.h>
#include <functional>
#include <vector>
//#include <SPIFFS.h>
#include <LittleFS.h>
#include <NTPClient.h>
#include <Timezone.h>
#include <ESP32Time.h>
#include <EEPROM.h>
#include <ArduinoJson.h>
#if defined (STICK_C_PLUS) || defined (STICK_C)
#include <AXP192.h>
extern AXP192 axp192;
#endif
#if defined(HAS_RTC)
#include "../lib/RTC/cplus_RTC.h"
#endif
#if defined(CARDPUTER)
#include <Keyboard.h>
extern Keyboard_Class Keyboard;
#endif
#if defined(M5STACK)
#include <M5Unified.h>
#endif
// Declaração dos objetos TFT
#if defined(HAS_SCREEN)
#if defined(M5STACK)
#define tft M5.Lcd
extern M5Canvas sprite;
extern M5Canvas draw;
#else
#include <TFT_eSPI.h>
extern TFT_eSPI tft;
extern TFT_eSprite sprite;
extern TFT_eSprite draw;
#endif
#else
#include "VectorDisplay.h"
extern SerialDisplayClass tft;
extern SerialDisplayClass& sprite;
extern SerialDisplayClass& draw;
#endif
extern char timeStr[10];
extern bool clock_set;
extern time_t localTime;
extern struct tm* timeInfo;
extern ESP32Time rtc;
extern NTPClient timeClient;
extern Timezone myTZ;
extern int prog_handler; // 0 - Flash, 1 - LittleFS, 2 - Download
extern bool sdcardMounted; // inform if SD Cardis active or not
extern bool wifiConnected; // inform if wifi is active or not
extern bool BLEConnected; // inform if BLE is active or not
extern bool gpsConnected; // inform if GPS is active or not
struct Option {
std::string label;
std::function<void()> operation;
bool selected = false;
Option(const std::string& lbl, const std::function<void()>& op, bool sel = false)
: label(lbl), operation(op), selected(sel) {}
};
extern std::vector<Option> options;
extern String ssid;
extern String pwd;
extern String fileToCopy;
extern int rotation;
extern uint8_t buff[4096];
extern const int bufSize;
extern bool returnToMenu; // variable to check and break loops to return to main menu
extern int IrTx;
extern int IrRx;
extern int RfTx;
extern int RfRx;
extern int RfModule;
extern float RfFreq;
// Screen sleep control variables
extern unsigned long previousMillis;
extern bool isSleeping;
extern bool isScreenOff;
extern bool dimmer;
extern int dimmerSet;
void readFGCOLORFromEEPROM();
void backToMenu();
void updateTimeStr(struct tm timeInfo);
extern JsonDocument settings;
extern unsigned long dimmerTemp;
extern int dimmerSet;
extern int bright;
extern bool dimmer;
extern String wui_usr;
extern String wui_pwd;
extern int tmz;
void setup_gpio();