-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathactive-vent-set-controller.ic10
More file actions
63 lines (54 loc) · 1.15 KB
/
active-vent-set-controller.ic10
File metadata and controls
63 lines (54 loc) · 1.15 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
# drives a bank of active vents from one command
# set RESPINT when internal vents are the target
# mirror a memory to broadcast modes to other banks
alias ventCmd d0
alias extSensor d1
define CMD_CLEAR 0
define CMD_EXH_OUT 1
define CMD_EXH_IN 2
define CMD_INT_OUT 3
define CMD_INT_IN 4
define CMD_OFF_OUT 5
define CMD_OFF_IN 6
define CMD_STOP 7
define ACTIVEVENT -1129453144
define RESPINT 0
define CLEARCMDSLEEP 0.5
alias doExh r8
alias doInt r9
alias doOff r10
init:
sb ACTIVEVENT Lock 0
select doExh RESPINT CMD_EXH_IN CMD_EXH_OUT
select doInt RESPINT CMD_INT_IN CMD_INT_OUT
select doOff RESPINT CMD_OFF_IN CMD_OFF_OUT
main:
yield
l r0 ventCmd Setting
beq r0 doExh exhaust
beq r0 doInt intake
beq r0 doOff off
beq r0 CMD_STOP off
j main
exhaust:
sb ACTIVEVENT Lock 1
sb ACTIVEVENT Mode 1
sb ACTIVEVENT PressureInternal 40000
sb ACTIVEVENT PressureExternal 0
sb ACTIVEVENT On 1
j clear
intake:
sb ACTIVEVENT Lock 1
sb ACTIVEVENT Mode 0
sb ACTIVEVENT PressureInternal 0
l r0 extSensor Pressure
sb ACTIVEVENT PressureExternal r0
sb ACTIVEVENT On 1
j clear
off:
sb ACTIVEVENT On 0
sb ACTIVEVENT Lock 0
clear:
sleep CLEARCMDSLEEP
s ventCmd Setting CMD_CLEAR
j main