-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconstants.h
35 lines (28 loc) · 920 Bytes
/
constants.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
#ifndef CONSTANTS_H
#define CONSTANTS_H
#include "config.h"
#include <FastLED.h>
// Network constants
#define SUBSCRIBE_INTERVAL_MS 1000
#define MAX_CONNECTION_LOSS_MS 5000
// Command constants
#define SUBSCRIBE_COMMAND "S:"
// Status constants
#define STATUS_LED_COUNT 3
#define STATUS_CONNECTING CRGB::Orange
#define STATUS_CONNECTED CRGB::Purple
// LED strip constants
#define BYTES_PER_LED 3
#define HEADER_SIZE 1
#define LED_BUFFER_SIZE HEADER_SIZE + BYTES_PER_LED * LED_COUNT
// Network event constants
#if defined(ESP8266)
#define EVENT_CONNECTED WIFI_EVENT_STAMODE_CONNECTED
#define EVENT_GOT_IP WIFI_EVENT_STAMODE_GOT_IP
#define EVENT_DISCONNECTED WIFI_EVENT_STAMODE_DISCONNECTED
#elif defined(ESP32)
#define EVENT_CONNECTED SYSTEM_EVENT_STA_CONNECTED
#define EVENT_GOT_IP SYSTEM_EVENT_STA_GOT_IP
#define EVENT_DISCONNECTED SYSTEM_EVENT_STA_DISCONNECTED
#endif
#endif CONSTANTS_H