-
-
Notifications
You must be signed in to change notification settings - Fork 374
/
config.h
146 lines (110 loc) · 4.8 KB
/
config.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
135
136
137
138
139
140
141
142
143
144
145
146
/*
This software is licensed under the MIT License. See the license file for details.
Source: https://github.com/spacehuhntech/WiFiDuck
*/
#pragma once
#define VERSION "1.0.4"
/* ===== Serial Bridge ===== */
// #define BRIDGE_ENABLE
// #define BRIDGE_PORT Serial1
// #define BRIDGE_SWITCH 6
// #define BRIDGE_RST 4
// #define BRIDGE_0 5
// #define BRIDGE_0_INVERTED
// #define BRIDGE_SAFE
/*! DEBUG Settings */
// #define ENABLE_DEBUG
// #define DEBUG_PORT Serial
// #define DEBUG_BAUD 115200
/*! ===== Communication Settings ===== */
// #define ENABLE_SERIAL
#define SERIAL_COM Serial1
#define SERIAL_BAUD 9600
// #define ENABLE_I2C
#define I2C_ADDR 0x31
#define BUFFER_SIZE 256
#define PACKET_SIZE 32
/*! ===== LED Settings ===== */
// #define NEOPIXEL
// #define NEOPIXEL_NUM 1
// #define LED_PIN 7
// #define DOTSTAR
// #define DOTSTAR_NUM 1
// #define DOTSTAR_DI 7
// #define DOTSTAR_CI 8
// #define LED_RGB
// #define LED_ANODE
// #define LED_R 5
// #define LED_G 6
// #define LED_B 9
//*! ===== Color Modes ===== */
#define COLOR_ESP_UNFLASHED 0,0,255
/*! ===== Parser Settings ===== */
#define CASE_SENSETIVE false
#define DEFAULT_SLEEP 5
/*! ========== Safety Checks ========= */
#if !defined(ENABLE_I2C) && !defined(ENABLE_SERIAL)
#define ENABLE_I2C
#endif /* if !defined(ENABLE_I2C) && !defined(ENABLE_SERIAL) */
#if defined(BRIDGE_ENABLE) && !defined(ENABLE_SERIAL)
#warning Serial bridge enabled, but serial communication disabled. Enabling serial again...
#define ENABLE_SERIAL
#endif /* if defined(BRIDGE_ENABLE) */
#if defined(BRIDGE_ENABLE)
#if !defined(BRIDGE_PORT)
#error Serial bridge port not defined!
#endif /* if !defined(BRIDGE_PORT) */
#if !defined(BRIDGE_SWITCH)
#error Serial bridge button not defined!
#endif /* if !defined(BRIDGE_SWITCH) */
#if !defined(BRIDGE_RST)
#error Serial bridge reset not defined!
#endif /* if !defined(BRIDGE_RST) */
#if !defined(BRIDGE_0)
#error Serial bridge GPIO-0 not defined!
#endif /* if !defined(BRIDGE_0) */
#endif /* if defined(BRIDGE_ENABLE) */
#if defined(NEOPIXEL)
#if defined(ENABLE_I2C) && (LED_PIN==2 || LED_PIN==3)
#error Neopixel pin overlaps with I2C pins, disable I2C or change the LED pin!
#endif /* if defined(ENABLE_I2C) && (LED_PIN==2 || LED_PIN==3) */
#if defined(ENABLE_SERIAL) && (LED_PIN==0 || LED_PIN==1)
#error Neopixel pin overlaps with serial pins, disable serial or change the LED pin!
#endif /* if defined(ENABLE_SERIAL) && (LED_PIN==0 || LED_PIN==1) */
#if defined(BRIDGE_ENABLE) && (LED_PIN==BRIDGE_RST || LED_PIN==BRIDGE_0 || LED_PIN==BRIDGE_SWITCH)
#error Neopixel pin overlaps with serial bridge pins, disable serial bridge or change the LED pin!
#endif /* if defined(BRIDGE_ENABLE) && (LED_PIN==BRIDGE_RST || LED_PIN==BRIDGE_0) */
#if defined(NEOPIXEL) && !defined(NEOPIXEL_NUM)
#define NEOPIXEL_NUM 1
#endif /* if defined(NEOPIXEL) && !defined(NEOPIXEL_NUM) */
#elif defined(DOTSTAR)
#if !defined(DOTSTAR_DI)
#error Dotstar DI pin not set!
#endif /* if !defined(DOTSTAR_DI) */
#if !defined(DOTSTAR_CI)
#error Dotstar CI pin not set!
#endif /* if !defined(DOTSTAR_CI) */
// DI
#if defined(ENABLE_I2C) && (DOTSTAR_DI==2 || DOTSTAR_DI==3)
#error Dotstar DI pin overlaps with I2C pins, disable I2C or change the LED pin!
#endif /* if defined(ENABLE_I2C) && (DOTSTAR_DI==2 || DOTSTAR_DI==3) */
#if defined(ENABLE_SERIAL) && (DOTSTAR_DI==0 || DOTSTAR_DI==1)
#error Dotstar DI pin overlaps with serial pins, disable serial or change the LED pin!
#endif /* if defined(ENABLE_SERIAL) && (DOTSTAR_DI==0 || DOTSTAR_DI==1) */
#if defined(BRIDGE_ENABLE) && (DOTSTAR_DI==BRIDGE_RST || DOTSTAR_DI==BRIDGE_0 || DOTSTAR_DI==BRIDGE_SWITCH)
#error Dotstar DI pin overlaps with serial bridge pins, disable serial bridge or change the LED pin!
#endif /* if defined(BRIDGE_ENABLE) && (DOTSTAR_DI==BRIDGE_RST || DOTSTAR_DI==BRIDGE_0 || DOTSTAR_DI==BRIDGE_SWITCH) */
// CI
#if defined(ENABLE_I2C) && (DOTSTAR_CI==2 || DOTSTAR_CI==3)
#error Dotstar CI pin overlaps with I2C pins, disable I2C or change the LED pin!
#endif /* if defined(ENABLE_I2C) && (DOTSTAR_CI==2 || DOTSTAR_CI==3) */
#if defined(ENABLE_SERIAL) && (DOTSTAR_CI==0 || DOTSTAR_CI==1)
#error Dotstar CI pin overlaps with serial pins, disable serial or change the LED pin!
#endif /* if defined(ENABLE_SERIAL) && (DOTSTAR_CI==0 || DOTSTAR_CI==1) */
#if defined(BRIDGE_ENABLE) && (DOTSTAR_CI==BRIDGE_RST || DOTSTAR_CI==BRIDGE_0 || DOTSTAR_CI==BRIDGE_SWITCH)
#error Dotstar CI pin overlaps with serial bridge pins, disable serial bridge or change the LED pin!
#endif /* if defined(BRIDGE_ENABLE) && (DOTSTAR_CI==BRIDGE_RST || DOTSTAR_CI==BRIDGE_0 || DOTSTAR_CI==BRIDGE_SWITCH) */
#if defined(DOTSTAR) && !defined(DOTSTAR_NUM)
#define DOTSTAR_NUM 1
#endif /* if defined(DOTSTAR) && !defined(DOTSTAR_NUM) */
#endif /* if defined(NEOPIXEL) */