diff options
-rw-r--r-- | device-functions.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/device-functions.c b/device-functions.c index 3d14f0a..a590830 100644 --- a/device-functions.c +++ b/device-functions.c @@ -326,7 +326,7 @@ int Set_Amplitude(int check_possible_only,int pol_override,int override_on,int w set_shiftreg_bits(SR_3, POS_10, TWO_BITS, 1<<relay_range); } else { /* sometimes CH2 can use pins 0-4 */ - set_shiftreg_bits(SR_3, POS_7, FIVE_BITS, 1<<relay_range); + set_shiftreg_bits(SR_3, POS_7, FIVE_BITS, 1<<relay_range); } int pol_bit = globals.Flash.polarity_xtra_rly[channel] + XTR_POS; @@ -885,12 +885,12 @@ int Set_Func(int channel,int mode) set_shiftreg_bits(SR_3, POS_17, THREE_BITS, mode); /* set amplify mode line */ - + int amplify_bit = XTR_POS + globals.Flash.ext_amplify_xtra_rly[channel]; if (mode==amp_mode_on) { set_shiftreg_bits(SR_2, amplify_bit, ONE_BIT, BIT_HIGH); } else { - set_shiftreg_bits(SR_2, amplify_bit, ONE_BIT, BIT_LOW); + set_shiftreg_bits(SR_2, amplify_bit, ONE_BIT, BIT_LOW); } } @@ -1068,16 +1068,16 @@ int Set_Trig_Source(int channel,int mode) set_shiftreg_bits(SR_0, POS_2, THREE_BITS, 0x0); } else if (mode==source_external) { globals.ChannelState[channel].hold_setting=hold_width; - set_shiftreg_bits(SR_0, POS_2, THREE_BITS, 0x3); + set_shiftreg_bits(SR_0, POS_2, THREE_BITS, 0x3); } else if (mode==source_manual) { globals.ChannelState[channel].hold_setting=hold_width; - set_shiftreg_bits(SR_0, POS_2, THREE_BITS, 0x1); + set_shiftreg_bits(SR_0, POS_2, THREE_BITS, 0x1); } else if (mode==source_hold) { gate_mode=1; } else if (mode==source_immediate) { - set_shiftreg_bits(SR_0, POS_2, THREE_BITS, 0x4); + set_shiftreg_bits(SR_0, POS_2, THREE_BITS, 0x4); Main_update_shift_registers(); - set_shiftreg_bits(SR_0, POS_2, THREE_BITS, 0x7); + set_shiftreg_bits(SR_0, POS_2, THREE_BITS, 0x7); } Main_update_shift_registers(); @@ -1095,9 +1095,9 @@ int Set_Gate_Sync(int channel,int mode) } if (mode==gate_sync) { - set_shiftreg_bits(SR_0, POS_0, ONE_BIT, BIT_LOW); + set_shiftreg_bits(SR_0, POS_0, ONE_BIT, BIT_LOW); } else { - set_shiftreg_bits(SR_0, POS_0, ONE_BIT, BIT_HIGH); + set_shiftreg_bits(SR_0, POS_0, ONE_BIT, BIT_HIGH); } globals.ChannelState[channel].gate_type=mode; @@ -1115,9 +1115,9 @@ int Set_Gate_Level(int channel,int mode) } if (mode==0) { - set_shiftreg_bits(SR_0, POS_1, ONE_BIT, BIT_HIGH); + set_shiftreg_bits(SR_0, POS_1, ONE_BIT, BIT_HIGH); } else { - set_shiftreg_bits(SR_0, POS_1, ONE_BIT, BIT_LOW); + set_shiftreg_bits(SR_0, POS_1, ONE_BIT, BIT_LOW); } globals.ChannelState[channel].gate_level=mode; @@ -1166,7 +1166,7 @@ int Set_zout(int channel,int setting,int really_for_zout) /* first channel uses dedicated Zout line */ if (channel==0) { if (setting!=globals.Flash.zout_max[channel]) { - set_shiftreg_bits(SR_3, POS_12, ONE_BIT, BIT_HIGH); /* power zout relay */ + set_shiftreg_bits(SR_3, POS_12, ONE_BIT, BIT_HIGH); /* power zout relay */ } else { set_shiftreg_bits(SR_3, POS_12, ONE_BIT, BIT_LOW); /* de-power zout relay */ } @@ -4776,15 +4776,15 @@ int change_password(gchar *old_password, gchar *new_password) static void set_shiftreg_bits(int shiftreg, int start_at_bit, int numbits, int value) { - long used_bits = (1<<numbits) - 1; - long mask = 0xfffff - (used_bits << start_at_bit); + long used_bits = (1<<numbits) - 1; + long mask = 0xfffff - (used_bits << start_at_bit); - long shift_value = (value & used_bits) << start_at_bit; - long masked_reg = globals.Registers.shift_reg_out[shiftreg] & mask; + long shift_value = (value & used_bits) << start_at_bit; + long masked_reg = globals.Registers.shift_reg_out[shiftreg] & mask; - printf ("shiftreg %d, start_at_bit %d, numbits %d, value %x\n",shiftreg,start_at_bit,numbits,value); - printf (" in %lx\n", globals.Registers.shift_reg_out[shiftreg]); - globals.Registers.shift_reg_out[shiftreg] = masked_reg | shift_value; - printf ("out %lx\n", globals.Registers.shift_reg_out[shiftreg]); +// printf ("shiftreg %d, start_at_bit %d, numbits %d, value %x\n",shiftreg,start_at_bit,numbits,value); +// printf (" in %lx\n", globals.Registers.shift_reg_out[shiftreg]); + globals.Registers.shift_reg_out[shiftreg] = masked_reg | shift_value; +// printf ("out %lx\n", globals.Registers.shift_reg_out[shiftreg]); } |