summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2011-03-26 18:44:07 +0100
committerMichael Buesch <mb@bu3sch.de>2011-03-26 18:44:07 +0100
commitb8c56207327e6ec8f7e8ec8b5641192030de0ede (patch)
treecd09758b458af73bca77a1e96113a1635743a8b4
parent0e403da074e0e61162b0de6ea3a69f7afc3ac284 (diff)
downloadcnc-b8c56207327e6ec8f7e8ec8b5641192030de0ede.tar.xz
cnc-b8c56207327e6ec8f7e8ec8b5641192030de0ede.zip
pressure_control: Some fixes
Signed-off-by: Michael Buesch <mb@bu3sch.de>
-rw-r--r--pressure_control/firmware/main.c10
-rw-r--r--pressure_control/firmware/remote.c2
2 files changed, 11 insertions, 1 deletions
diff --git a/pressure_control/firmware/main.c b/pressure_control/firmware/main.c
index 8e824d4..06bd4d8 100644
--- a/pressure_control/firmware/main.c
+++ b/pressure_control/firmware/main.c
@@ -246,6 +246,11 @@ static void check_pressure(void)
switch (sensor_cycle) {
case SENSOR_CYCLE_XY:
state.measured_mbar_xy = state.measured_mbar;
+ if (!cfg_xy.autoadjust_enable &&
+ state.measured_mbar_xy >= XY_MAX_PRESSURE) {
+ /* Enforce hard max-limit in manual mode. */
+ __valves_global_switch(&xy_control_valves, VALVES_IDLE);
+ }
if (state.device_enabled) {
do_check_pressure(&xy_control_valves, &cfg_xy,
state.measured_mbar_xy,
@@ -254,6 +259,11 @@ static void check_pressure(void)
break;
case SENSOR_CYCLE_Z:
state.measured_mbar_z = state.measured_mbar;
+ if (!cfg_z.autoadjust_enable &&
+ state.measured_mbar_z >= Z_MAX_PRESSURE) {
+ /* Enforce hard max-limit in manual mode. */
+ __valves_global_switch(&z_control_valves, VALVES_IDLE);
+ }
if (state.device_enabled) {
do_check_pressure(&z_control_valves, &cfg_z,
state.measured_mbar_z,
diff --git a/pressure_control/firmware/remote.c b/pressure_control/firmware/remote.c
index d15ff99..ffa6e24 100644
--- a/pressure_control/firmware/remote.c
+++ b/pressure_control/firmware/remote.c
@@ -319,7 +319,7 @@ static void handle_received_message(void)
valve1_switch(v, rx_msg.valve.state == 0 ?
VALVE_STATE_CLOSE : VALVE_STATE_OPEN);
valve_wait_toggle(v);
- valve0_switch(v, VALVE_STATE_IDLE);
+ valve1_switch(v, VALVE_STATE_IDLE);
} else
err = MSG_ERR_INVAL;
break;
bues.ch cgit interface