diff options
author | root <root@avtech.domain.avtechpulse.com> | 1970-01-01 09:14:53 +0900 |
---|---|---|
committer | root <root@avtech.domain.avtechpulse.com> | 1970-01-01 09:14:53 +0900 |
commit | dd8cc92a83e426ae110668bc53c306de6216551e (patch) | |
tree | c6d4edabbad3a81461988656ab2af7bbcc912ff0 | |
parent | 1518785c23d5122a52259d73e50069f1d8fc8a8b (diff) |
added support for sequential vs binary attenuator stages
-rw-r--r-- | device-functions.c | 10 | ||||
-rw-r--r-- | flash.c | 3 | ||||
-rw-r--r-- | globals.h | 2 |
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); @@ -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; @@ -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; |