diff options
-rw-r--r-- | device-functions.c | 6 | ||||
-rw-r--r-- | flash.c | 1 | ||||
-rw-r--r-- | globals.h | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/device-functions.c b/device-functions.c index ceab0c7..64feb6d 100644 --- a/device-functions.c +++ b/device-functions.c @@ -1358,7 +1358,8 @@ 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]) { + if ( ((setting==globals.Flash.zout_max[channel]) && globals.Flash.zout_relay_high_for_max[channel]) || + ((setting==globals.Flash.zout_min[channel]) && !globals.Flash.zout_relay_high_for_max[channel])) { 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 */ @@ -1367,7 +1368,8 @@ int Set_zout(int channel,int setting,int really_for_zout) /* second channel uses dedicated xtra-rly2 line */ if (channel==1) { - if (setting!=globals.Flash.zout_max[channel]) { + if ( ((setting==globals.Flash.zout_max[channel]) && globals.Flash.zout_relay_high_for_max[channel]) || + ((setting==globals.Flash.zout_min[channel]) && !globals.Flash.zout_relay_high_for_max[channel])) { set_shiftreg_bits(SR_2, XTR_POS + 2, ONE_BIT, BIT_HIGH); /* power zout relay */ } else { set_shiftreg_bits(SR_2, XTR_POS + 2, ONE_BIT, BIT_LOW); /* de-power zout relay */ @@ -838,6 +838,7 @@ static void initFlashValues(FlashStruct *mem) mem->max_avg_ampl[i]=0.0; mem->pol_relay_high_for_pos[i]=1; + mem->zout_relay_high_for_max[i]=0; mem->special_pw_range_minimum[i]=0.0; @@ -671,8 +671,7 @@ typedef struct { float pw_shift_below_this_ampl[max_channels]; /* addr 8684 */ float pw_shift_below_ampl_by[max_channels]; /* addr 8692 */ - /* AVRQ special configs */ - char spare_config1[max_channels]; /* addr 8700 */ + char zout_relay_high_for_max[max_channels]; /* addr 8700 */ char load_type_dac[max_channels]; /* addr 8702 */ float sparex1[max_channels]; /* addr 8704 */ float sparex2[max_channels]; /* addr 8712 */ |