forked from sle118/FreeTouchDeck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSystem.h
51 lines (49 loc) · 1.33 KB
/
System.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
#pragma once
#include <cJSON.h>
#include "esp_attr.h"
#include "BleKeyboard.h"
#include "UserConfig.h"
#include "FTAction.h"
namespace FreeTouchDeck
{
extern BleKeyboard bleKeyboard;
enum class SystemMode
{
STANDARD,
CONSOLE,
CONFIG
};
void DumpCJson(cJSON *doc);
void touchInit();
void SetSleepInterval(unsigned long sleepInterval);
const char *enum_to_string(SystemMode mode);
void LoadSystemConfig();
void PrintBasicMemInfo();
void PrintMemStats();
void StopBluetooth();
#ifdef PRINT_MEM_INFO
void PrintMemInfo(const char * fn, uint16_t line);
#else
#define PrintMemInfo(fn,line)
#endif
void TFTPrintMemInfo();
void powerInit();
void InitSystem();
void HandleSleepConfig();
void HandleBeepConfig();
void ChangeMode(SystemMode newMode);
void *malloc_fn(size_t sz);
bool EnterSleep();
void HandleActions();
void HandleScreen();
char * AllocPrintJson(cJSON * doc, bool freeDoc = true);
bool SaveJsonToFile(const char * fileName,cJSON * content,bool freeDoc=true);
void processSleep();
bool getTouch(uint16_t *t_x, uint16_t *t_y);
bool isTouched();
void WaitTouchReboot();
void ResetSleep();
char *ps_strdup(const char *fmt);
extern SystemMode restartReason;
extern SystemMode RunMode;
}