-
Notifications
You must be signed in to change notification settings - Fork 0
/
Outputs.h
80 lines (72 loc) · 4.8 KB
/
Outputs.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
#define CLOSE false
#define OPEN not(CLOSE)
#define TURN_OFF false
#define TURN_ON not(TURN_OFF)
#define DOUBLE_FLUX TURN_ON
#define SIMPLE_FLUX not(DOUBLE_FLUX)
#define TIMEOUT_BYPASS 30
#define NB_MODES 3
struct Bypass
{
int PinOpen;
int PinClose;
int SwitchOpen;
int SwitchClosed;
bool isOpen;
bool isOpening;
bool isClosed;
bool isClosing;
unsigned int TimeoutCounter;
} ;
struct OutputGoal
{
bool VentiloCave;
bool VentiloCheminee;
bool DoubleFlux;
bool BypassCave;
bool BypassVMC;
} ;
OutputGoal g_OutputGoal = {TURN_OFF, TURN_OFF, DOUBLE_FLUX, CLOSE, CLOSE};
const OutputGoal OutputTable[NB_MODES][12] = {
/*MODE ETE */
/*Air Ext.| Air Int | Cheminée*/ /*VentiloCave | VentiloCheminee | DoubleFlux | BypassCave | BypassVMC */
/*Froid | Froid | Arrêt */ {{TURN_OFF , TURN_OFF , DOUBLE_FLUX, CLOSE , OPEN },
/*Froid | Froid | Marche */ {TURN_OFF , TURN_ON , DOUBLE_FLUX, CLOSE , OPEN },
/*Froid | Chaud | Arrêt */ {TURN_ON , TURN_OFF , DOUBLE_FLUX, OPEN , OPEN },
/*Froid | Chaud | Marche */ {TURN_OFF , TURN_ON , DOUBLE_FLUX, CLOSE , OPEN },
/*Moyen | Froid | Arrêt */ {TURN_OFF , TURN_OFF , DOUBLE_FLUX, CLOSE , OPEN },
/*Moyen | Froid | Marche */ {TURN_ON , TURN_ON , DOUBLE_FLUX, OPEN , OPEN },
/*Moyen | Chaud | Arrêt */ {TURN_OFF , TURN_OFF , SIMPLE_FLUX, CLOSE , CLOSE },
/*Moyen | Chaud | Marche */ {TURN_ON , TURN_ON , SIMPLE_FLUX, OPEN , CLOSE },
/*Chaud | Froid | Arrêt */ {TURN_OFF , TURN_OFF , DOUBLE_FLUX, CLOSE , OPEN },
/*Chaud | Froid | Marche */ {TURN_OFF , TURN_OFF , DOUBLE_FLUX, CLOSE , OPEN },
/*Chaud | Chaud | Arrêt */ {TURN_OFF , TURN_OFF , SIMPLE_FLUX, CLOSE , CLOSE },
/*Chaud | Chaud | Marche */ {TURN_OFF , TURN_OFF , SIMPLE_FLUX, CLOSE , CLOSE }},
/*MODE MI-SAISON */
/*Air Ext.| Air Int | Cheminée*/ /*VentiloCave | VentiloCheminee | DoubleFlux | BypassCave | BypassVMC */
/*Froid | Froid | Arrêt */ {{TURN_OFF , TURN_OFF , DOUBLE_FLUX, CLOSE , OPEN },
/*Froid | Froid | Marche */ {TURN_OFF , TURN_ON , DOUBLE_FLUX, CLOSE , OPEN },
/*Froid | Chaud | Arrêt */ {TURN_OFF , TURN_OFF , DOUBLE_FLUX, CLOSE , OPEN },
/*Froid | Chaud | Marche */ {TURN_OFF , TURN_ON , DOUBLE_FLUX, CLOSE , OPEN },
/*Moyen | Froid | Arrêt */ {TURN_ON , TURN_OFF , DOUBLE_FLUX, OPEN , OPEN },
/*Moyen | Froid | Marche */ {TURN_ON , TURN_ON , DOUBLE_FLUX, OPEN , OPEN },
/*Moyen | Chaud | Arrêt */ {TURN_ON , TURN_OFF , SIMPLE_FLUX, OPEN , OPEN },
/*Moyen | Chaud | Marche */ {TURN_ON , TURN_ON , SIMPLE_FLUX, OPEN , OPEN },
/*Chaud | Froid | Arrêt */ {TURN_OFF , TURN_OFF , DOUBLE_FLUX, CLOSE , OPEN },
/*Chaud | Froid | Marche */ {TURN_OFF , TURN_OFF , DOUBLE_FLUX, CLOSE , OPEN },
/*Chaud | Chaud | Arrêt */ {TURN_OFF , TURN_OFF , SIMPLE_FLUX, CLOSE , CLOSE },
/*Chaud | Chaud | Marche */ {TURN_OFF , TURN_OFF , SIMPLE_FLUX, CLOSE , CLOSE }},
/*MODE HIVER */
/*Air Ext.| Air Int | Cheminée*/ /*VentiloCave | VentiloCheminee | DoubleFlux | BypassCave | BypassVMC */
/*Froid | Froid | Arrêt */ {{TURN_OFF , TURN_OFF , DOUBLE_FLUX, CLOSE , OPEN },
/*Froid | Froid | Marche */ {TURN_OFF , TURN_ON , DOUBLE_FLUX, CLOSE , OPEN },
/*Froid | Chaud | Arrêt */ {TURN_OFF , TURN_OFF , DOUBLE_FLUX, CLOSE , OPEN },
/*Froid | Chaud | Marche */ {TURN_OFF , TURN_ON , DOUBLE_FLUX, CLOSE , OPEN },
/*Moyen | Froid | Arrêt */ {TURN_ON , TURN_OFF , DOUBLE_FLUX, OPEN , OPEN },
/*Moyen | Froid | Marche */ {TURN_ON , TURN_ON , DOUBLE_FLUX, OPEN , OPEN },
/*Moyen | Chaud | Arrêt */ {TURN_ON , TURN_OFF , DOUBLE_FLUX, OPEN , OPEN },
/*Moyen | Chaud | Marche */ {TURN_ON , TURN_ON , DOUBLE_FLUX, OPEN , OPEN },
/*Chaud | Froid | Arrêt */ {TURN_ON , TURN_OFF , DOUBLE_FLUX, OPEN , OPEN },
/*Chaud | Froid | Marche */ {TURN_ON , TURN_ON , DOUBLE_FLUX, OPEN , OPEN },
/*Chaud | Chaud | Arrêt */ {TURN_ON , TURN_OFF , SIMPLE_FLUX, OPEN , CLOSE },
/*Chaud | Chaud | Marche */ {TURN_ON , TURN_ON , SIMPLE_FLUX, OPEN , CLOSE }}};