summaryrefslogtreecommitdiffstats
path: root/pressure_control/firmware
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-11-22 16:37:09 +0100
committerMichael Buesch <mb@bu3sch.de>2009-11-22 16:37:09 +0100
commitbc09f0795b99996e898731bad9853e32e59fd212 (patch)
tree8b855e1e15757d84da07956da294631372f5356f /pressure_control/firmware
parent979636579cef8070dc5c0060d386fcd6806f38b8 (diff)
downloadcnc-bc09f0795b99996e898731bad9853e32e59fd212.tar.xz
cnc-bc09f0795b99996e898731bad9853e32e59fd212.zip
pressure_control: Fix valve idle state
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'pressure_control/firmware')
-rw-r--r--pressure_control/firmware/valves.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/pressure_control/firmware/valves.c b/pressure_control/firmware/valves.c
index 4860246..c12e3ea 100644
--- a/pressure_control/firmware/valves.c
+++ b/pressure_control/firmware/valves.c
@@ -43,7 +43,11 @@ void valve0_switch(struct valves *v, uint8_t state)
} else if (state == VALVE_STATE_OPEN) {
MMIO8(v->close0.port) &= ~(v->close0.bitmask);
MMIO8(v->open0.port) |= v->open0.bitmask;
- }
+ } else if (state == VALVE_STATE_IDLE) {
+ MMIO8(v->open0.port) &= ~(v->open0.bitmask);
+ MMIO8(v->close0.port) &= ~(v->close0.bitmask);
+ } else
+ BUG_ON(1);
break;
}
}
@@ -64,7 +68,11 @@ void valve1_switch(struct valves *v, uint8_t state)
} else if (state == VALVE_STATE_OPEN) {
MMIO8(v->close1.port) &= ~(v->close1.bitmask);
MMIO8(v->open1.port) |= v->open1.bitmask;
- }
+ } else if (state == VALVE_STATE_IDLE) {
+ MMIO8(v->open1.port) &= ~(v->open1.bitmask);
+ MMIO8(v->close1.port) &= ~(v->close1.bitmask);
+ } else
+ BUG_ON(1);
break;
}
}
bues.ch cgit interface