summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1970-01-01 10:29:26 +0900
committerroot <root@avtech.domain.avtechpulse.com>1970-01-01 10:29:26 +0900
commita5a5d069c211304c0c7da2b0dd04889292e40970 (patch)
tree78aba18186eacd752fd96cc012379aeacb09ae82 /device-functions.c
parentb118e55266a970b265ad5641ff5578d04293cb83 (diff)
do not set XTR polarity line for CH2 if not dual-polarity, to save XTR lines
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/device-functions.c b/device-functions.c
index 9275df7..f616d41 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -380,11 +380,14 @@ int Set_Amplitude(int check_possible_only,int pol_override,int override_on,int w
set_shiftreg_bits(SR_3, POS_7, FIVE_BITS, 1<<relay_range);
}
- int pol_bit = globals.Flash.polarity_xtra_rly[channel] + XTR_POS;
- if (new_ampl<0.0) {
- set_shiftreg_bits(SR_2, pol_bit, ONE_BIT, BIT_LOW); /* set O.POL line low to switch pol relay to - */
- } else {
- set_shiftreg_bits(SR_2, pol_bit, ONE_BIT, BIT_HIGH); /* set O.POL line high to switch pol relay to + */
+ // only do this on dual-polarity dual-channel units
+ if ((globals.Flash.min_ampl[channel] * globals.Flash.max_ampl[channel]) < 0.0) {
+ int pol_bit = globals.Flash.polarity_xtra_rly[channel] + XTR_POS;
+ if (new_ampl<0.0) {
+ set_shiftreg_bits(SR_2, pol_bit, ONE_BIT, BIT_LOW); /* set O.POL line low to switch pol relay to - */
+ } else {
+ set_shiftreg_bits(SR_2, pol_bit, ONE_BIT, BIT_HIGH); /* set O.POL line high to switch pol relay to + */
+ }
}
}