summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1970-01-01 09:14:53 +0900
committerroot <root@avtech.domain.avtechpulse.com>1970-01-01 09:14:53 +0900
commitdd8cc92a83e426ae110668bc53c306de6216551e (patch)
treec6d4edabbad3a81461988656ab2af7bbcc912ff0 /device-functions.c
parent1518785c23d5122a52259d73e50069f1d8fc8a8b (diff)
added support for sequential vs binary attenuator stages
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/device-functions.c b/device-functions.c
index 997390f..c466ae4 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -335,7 +335,15 @@ int Set_Amplitude(int check_possible_only,int pol_override,int override_on,int w
if ((atten_range < 0) || (atten_range >= max_attens)) {
atten_ctl = 0xff;
} else {
- atten_ctl = ~((1 << (atten_range+1)) - 1);
+ if (globals.Flash.sequential_attenuators[channel]) {
+ // For AVRZ-5W-B-LVA, which uses 3 identical 20 dB attenuators.
+ // 0, 1, 2 or 3 in series are used.
+ atten_ctl = ~((1 << (atten_range+1)) - 1);
+ } else {
+ // For more standard configurations, where different attenuators
+ // are combined in a binary style - 000, 001, 010, 011, 100, etc
+ atten_ctl = ~(atten_range+1);
+ }
}
I2C_Write(PCF8574+Octal_Relay_Driver, atten_ctl);