summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device-functions.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/device-functions.c b/device-functions.c
index b52a6d5..e219bcf 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -1008,34 +1008,23 @@ int Set_Trig_Source(int channel,int mode)
mode=source_external;
}
-
+ gate_mode = 0;
if (mode==source_internal) {
- gate_mode=0;
/* frequency is automatically lowered if pw or delay have been changed to conflicting */
/* settings while in a non-internal mode */
globals.Registers.shift_reg_out[0] = (globals.Registers.shift_reg_out[0] & 0xe3) | 0;
} else if (mode==source_external) {
- gate_mode=0;
globals.ChannelState[channel].hold_setting=hold_width;
globals.Registers.shift_reg_out[0] = (globals.Registers.shift_reg_out[0] & 0xe3) | 3<<2;
} else if (mode==source_manual) {
- gate_mode=0;
globals.ChannelState[channel].hold_setting=hold_width;
globals.Registers.shift_reg_out[0] = (globals.Registers.shift_reg_out[0] & 0xe3) | 1<<2;
} else if (mode==source_hold) {
gate_mode=1;
} else if (mode==source_immediate) {
- if (gate_mode==1) {
- globals.Registers.shift_reg_out[0] = (globals.Registers.shift_reg_out[0] & 0xe3) | 4<<2;
- Main_update_shift_registers();
- gate_mode=0; /* allow triggering */
- bus_setpin(O_GATE, gate_mode);
- globals.Registers.shift_reg_out[0] = (globals.Registers.shift_reg_out[0] & 0xe3) | 7<<2;
- } else {
- globals.Registers.shift_reg_out[0] = (globals.Registers.shift_reg_out[0] & 0xe3) | 4<<2;
- Main_update_shift_registers();
- globals.Registers.shift_reg_out[0] = (globals.Registers.shift_reg_out[0] & 0xe3) | 7<<2;
- }
+ globals.Registers.shift_reg_out[0] = (globals.Registers.shift_reg_out[0] & 0xe3) | 4<<2;
+ Main_update_shift_registers();
+ globals.Registers.shift_reg_out[0] = (globals.Registers.shift_reg_out[0] & 0xe3) | 7<<2;
}
Main_update_shift_registers();