-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtools.h
More file actions
107 lines (81 loc) · 3.59 KB
/
tools.h
File metadata and controls
107 lines (81 loc) · 3.59 KB
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
// tools.h
#ifndef _TOOLS_h
#define _TOOLS_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#define DEF_SERIAL_SPEED 115200
#define DEF_SERIAL_PORT Serial
#define DEF_BOOT_DEBUGING true
#define NR_GLOBAL_OPTIONS_BYTES 5 // to hold the bools in bits not bytes! Enum below must fit in here!!!
enum GLOBAL_OPTIONS_ENUM
{
DEBUG_OUT = 0 // Debug to Serial ?
,WIFI_MODE_TPM = 1 // True = Client, False = AP
,OTA_SERVER = 2 // Enable Arduino OTA
,STATIC_IP_ENABLED = 3 // Static IP?
,HTTP_ENABLED = 4 // enable the HTTP server
,WIFI_EVENTS = 5 // Show all Wifi Events not only 7 Ipaddress .
,OSC_EDIT = 6 // alow Edditing of NR LEds and Start Led ?
,FFT_MASTER = 7 // Master FFT-Server ? if not = slave!
,FFT_ENABLE = 8 // FFT enabled
,BLEND_INVERT = 9 // invert all blend modes!
,OSC_MC_SEND = 10 // send OSC to slave OSC devices ?
,UPDATE_LEDS = 11 //
,BPM_COUNTER = 12 // Pallete BPM mode ?
,FFT_OSTC_VIZ = 13 // send FFT data to Open Stage Controll for analisys ?
,DEBUG_TELNET = 14 // Debug to telnet ?
,FFT_MASTER_SEND = 15 // if in master mode send out the UDP Multicast packets?
//2
,WIFI_POWER = 16 // enable WIFI power.
,BTN_LASTSTATE = 17 // what was the last bttn state
,DATA1_ENABLE = 18 // enable Data line 1
,DATA2_ENABLE = 19 // enable Data line 2
,DATA3_ENABLE = 20 // enable Data line 3
,DATA4_ENABLE = 21 // enable Data line 4
,WIFI_POWER_ON_BOOT = 22 // was wifi on on boot?
,POT_DISABLE = 23 // Disable HW Pots BRI & FPS!
//3
,SEQUENCER_ON = 24 // Is the sequencer switched on?
,MQTT_ON = 25 // Enable Mqtt.
,ARTNET_SEND = 26 // Are we a artnet sender (no direct output only calculation unit)
,ARTNET_RECIVE = 27 // Is it a artnet recive node (exclusive)
,WIFI_MODE_BOOT = 28 // What was the wifimode at boot time.
,FADE_INOUT = 29 // Trigger for save/load loop
,FADE_INOUT_SAVE = 30 // are we saving or loading for the fade. flase = load
,FADE_INOUT_FADEBACK = 31 // used for SAve load loop Fadebackin
//4
,POTS_LVL_MASTER = 32 // override the LVL from the save to the value set on the pot
,PAUSE_DISPLAY = 33 // frezze the display but continue to calculate in the background
,ARTNET_REMAPPING = 34 // remap artnet universe to FFT data and use almost all other features.
,MANUAL_REFRESH = 35 // is it a custom load.
,CONF_OVERRIDES_LAMP = 36 // when loading a config it overwrites the Lamp config (a save pattern save also saves the Led Layout )
,APP_VIZIT = 37
//5
};
// Functions
boolean setup_controlls();
// The main DEbuging Functions.
void debugMe(String input, boolean line = true, boolean allways = false);
void debugMe(float input, boolean line = true, boolean allways = false);
void debugMe(uint8_t input, boolean line = true, boolean allways = false);
void debugMe(int input, boolean line = true, boolean allways = false);
void debugMe(IPAddress input, boolean line = true , boolean allways = false);
void debugMe(tm input, boolean line = true, boolean allways = false);
String debug_ResetReason(boolean core); // core 0 or 1
//void verbose_print_reset_reason(RESET_REASON reason);
//void print_reset_reason(RESET_REASON reason);
// Boolean functions
boolean get_bool(uint8_t bit_nr);
void write_bool(uint8_t bit_nr, boolean value);
void load_bool();
// Get bit for bools
uint8_t get_strip_menu_bit(int strip);
uint8_t striptobit(int strip_no);
//generic functions
uint16_t calc_rounded_devision(uint16_t value, uint16_t divider);
boolean isODDnumber(uint8_t number);
float byte_tofloat(uint8_t value, uint8_t max_value = 255);
#endif