-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueueManager.cpp
More file actions
49 lines (39 loc) · 1.24 KB
/
QueueManager.cpp
File metadata and controls
49 lines (39 loc) · 1.24 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
//
//
//
#include "QueueManager.h"
void QueueManager::Begin()
{
//Serial.println("sizeof:" + String(sizeof(ReadingValue)));
RequestReadingQueue = xQueueCreate(64, sizeof(int));
SendReadingQueue = xQueueCreate(64, sizeof(ReadingValue));
RequestHeaterLedQueue = xQueueCreate(4, sizeof(int));
RequestRelayLedQueue = xQueueCreate(4, sizeof(int));
SendLedQueue = xQueueCreate(4, sizeof(IndexValue));
SendSettingQueue = xQueueCreate(16, sizeof(IndexValue));
SaveSettingQueue = xQueueCreate(16, sizeof(IndexValue));
}
bool QueueManager::ReadingIndexIsValid(int index)
{
return (index >= 1 && index < (int)Reading::LAST);
}
bool QueueManager::SettingIndexIsValid(int index)
{
return (index >= 0 && index < (int)Setting::LAST);
}
void QueueManager::SetReadingReceivedState(int i, int v)
{
readingReceivedStates[i] = v;
}
int QueueManager::GetReadingReceivedState(int i)
{
return readingReceivedStates[i];
}
QueueHandle_t RequestReadingQueue;
QueueHandle_t SendReadingQueue;
QueueHandle_t RequestHeaterLedQueue;
QueueHandle_t RequestRelayLedQueue;
QueueHandle_t SendLedQueue;
QueueHandle_t SendSettingQueue;
QueueHandle_t SaveSettingQueue;
std::array<int, 27> QueueManager::readingReceivedStates = { 0 };