diff options
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 10 |
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); |