summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/device-functions.c b/device-functions.c
index 87c2bb4..e173d3b 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -1018,10 +1018,12 @@ int Set_Output_State(int channel,int mode)
TestState[i]=globals.ChannelState[i];
}
TestState[channel].output_state=mode;
- if ((error_num=Error_check(TestState))) {
+ if ((error_num=Error_check(TestState)) && (mode == output_on)) {
return error_num;
}
+ /* allow output to be switched off even if Error_check fails! */
+
/* suppress triggering during relay bounce */
/* set gate bit high, if not already high */
@@ -1055,7 +1057,7 @@ int Set_Output_State(int channel,int mode)
/* keep trigger suppressed during output relay update */
/* trigger gate will be released at end of following Main_update_shift_registers(); */
- return OK;
+ return error_num;
}