summaryrefslogtreecommitdiff
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
parent1518785c23d5122a52259d73e50069f1d8fc8a8b (diff)
added support for sequential vs binary attenuator stages
-rw-r--r--device-functions.c10
-rw-r--r--flash.c3
-rw-r--r--globals.h2
3 files changed, 13 insertions, 2 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);
diff --git a/flash.c b/flash.c
index 637f599..8ff94e2 100644
--- a/flash.c
+++ b/flash.c
@@ -861,7 +861,8 @@ static void initFlashValues(FlashStruct *mem)
}
mem->ext2_enabled[i] = 0;
- mem->toggle_trig_at_boot[i] = 0;
+ mem->toggle_trig_at_boot[i] = 1;
+ mem->sequential_attenuators[i] = 0;
}
mem->relay_delay_in_sec=0.5;
diff --git a/globals.h b/globals.h
index 7eaf0ff..c8cba93 100644
--- a/globals.h
+++ b/globals.h
@@ -741,6 +741,8 @@ typedef struct {
char ext2_enabled[max_channels]; /* addr 10250, for KMPF */
char toggle_trig_at_boot[max_channels]; /* addr 10252, for IL710 units */
+ char sequential_attenuators[max_channels]; /* addr 10254, for AVRZ-5W-B-LVA style of 3 identical attenuators */
+
char flash_end;
} FlashStruct;