-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.h
60 lines (47 loc) · 1.52 KB
/
common.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
#pragma once
#include <Arduino.h>
#include <FS.h>
#include "credential.h"
#include "BufferController.h"
#include "MyWebServer.h"
/* Defines */
//#define DEBUG
#define BUILD_VERSION "0.0.5"
#define BUILD_DATETIME __DATE__ " " __TIME__
#ifdef DEBUG
#define BUILD_INFO BUILD_VERSION "-debug (" BUILD_DATETIME ")"
#else
#define BUILD_INFO BUILD_VERSION " (" BUILD_DATETIME ")"
#endif
#define PIXELS_NUM 16
#define RENDER_SIZE_MAX 32
#define CONFIG_LEAST_DURATION_MIN 1
#define CONFIG_LEAST_DURATION_MAX 120
#define CONFIG_LEAST_DURATION_DEFAULT 15
#define CONFIG_LEAST_LOOP_MIN 0
#define CONFIG_LEAST_LOOP_MAX 5
#define CONFIG_LEAST_LOOP_DEFAULT 2
#define CONFIG_ACTIVE_DURATION_MIN 60
#define CONFIG_ACTIVE_DURATION_MAX 3600
#define CONFIG_ACTIVE_DURATION_DEFAULT 300
/* Typedefs */
typedef unsigned long ulong;
/* Global Functions (Macros) */
#define IMPORT_BIN_FILE(file, sym) asm ( \
".global " #sym "\n" \
#sym ":\n" \
".incbin \"" file "\"\n" \
".byte 0\n" \
".global _sizeof_" #sym "\n" \
".set _sizeof_" #sym ", . - " #sym "\n" \
".balign 4\n")
#define isAfter(a, b) ((long)(a - b) >= 0)
#ifdef DEBUG
#define dprint(...) Serial.print(__VA_ARGS__)
#define dprintln(...) Serial.println(__VA_ARGS__)
#define dprintf(...) Serial.printf(__VA_ARGS__)
#else
#define dprint(...)
#define dprintln(...)
#define dprintf(...)
#endif