-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueueManager.h
More file actions
95 lines (82 loc) · 1.47 KB
/
QueueManager.h
File metadata and controls
95 lines (82 loc) · 1.47 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
// QueueManager.h
#ifndef _QUEUEMANAGER_h
#define _QUEUEMANAGER_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#endif
#include <array>
enum class Reading : int
{
None = 0, // 0
H1, // 1
H2, // 2
H3, // 3
H4, // 4
H5, // 5
H6, // 6
T1, // 7
T2, // 8
T3, // 9
T4, // 10
T5, // 11
T6, // 12
P1, // 13
P2, // 14
A1, // 15
A2, // 16
HAvg1, // 17
TAvg1, // 18
HAvg2, // 19
TAvg2, // 20
PAvg1, // 21
AAvg1, // 22
HChart1, // 23
TChart1, // 24
HChart2, // 25
TChart2, // 26
LAST
};
enum class Setting : int
{
SetPoint = 0,
RelayMode,
Hysteresis,
Calibrate,
TempUnit,
Heater,
LAST
};
enum class Led : int
{
Heater = 0,
Relay
};
struct ReadingValue
{
int index;
float value;
};
struct IndexValue
{
int index;
int value;
};
extern QueueHandle_t RequestReadingQueue;
extern QueueHandle_t SendReadingQueue;
extern QueueHandle_t RequestHeaterLedQueue;
extern QueueHandle_t RequestRelayLedQueue;
extern QueueHandle_t SendLedQueue;
extern QueueHandle_t SendSettingQueue;
extern QueueHandle_t SaveSettingQueue;
class QueueManager
{
public:
static void Begin();
static bool ReadingIndexIsValid(int index);
static bool SettingIndexIsValid(int index);
static void SetReadingReceivedState(int i, int v);
static int GetReadingReceivedState(int i);
private:
static std::array<int, 27> readingReceivedStates;
};
#endif