summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike <mjc@avtechpulse.com>2000-01-01 00:16:57 +0900
committerMike <mjc@avtechpulse.com>2000-01-01 00:16:57 +0900
commit6ac848ad626c9adb498eba6972f5eb1bbced20b5 (patch)
tree20f59a2be798639f1952f6ed46ccfae4120664ac
parent44ce8c22c0cc5fdabd8e83e06f51a2fab994521c (diff)
make drive polarity of zout relay configurable for -R50 units and PCB 308AINSTRUMENT_6_4_03b
-rw-r--r--device-functions.c6
-rw-r--r--flash.c1
-rw-r--r--globals.h3
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 */
diff --git a/flash.c b/flash.c
index b339eb9..4523515 100644
--- a/flash.c
+++ b/flash.c
@@ -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;
diff --git a/globals.h b/globals.h
index a8fae30..9f13c6a 100644
--- a/globals.h
+++ b/globals.h
@@ -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 */