diff options
-rw-r--r-- | device-functions.c | 16 | ||||
-rw-r--r-- | flash.c | 1 | ||||
-rw-r--r-- | globals.h | 5 |
3 files changed, 22 insertions, 0 deletions
diff --git a/device-functions.c b/device-functions.c index de21933..46b9083 100644 --- a/device-functions.c +++ b/device-functions.c @@ -2456,6 +2456,22 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int top_range_only=1; } + if (globals.Flash.couple_first_N_pw_ranges_to_ampl_ranges[channel]) { + int curr_pw_range = 0; + int parse_sr = globals.Registers.shift_reg_out[3] & 0x7f; + + while (parse_sr) { + ++curr_pw_range; + parse_sr = parse_sr >> 1; + } + + starting_range = curr_pw_range; + + if (starting_range > globals.Flash.couple_first_N_pw_ranges_to_ampl_ranges[channel]) { + starting_range = globals.Flash.couple_first_N_pw_ranges_to_ampl_ranges[channel]; + } + } + break; case pwl_os_values: decreasing_values_allowed=YES; /* allows Vc=0 to corresponds to most + OS, and Vc=10V to give most - OS */ @@ -729,6 +729,7 @@ static void initFlashValues(FlashStruct *mem) mem->vcc2_min[i]=3.0; mem->use_high_ampl_ranges_for_high_pw_ranges[i]=0; + mem->couple_first_N_pw_ranges_to_ampl_ranges[i]=0; } mem->relay_delay_in_sec=0.5; @@ -693,6 +693,11 @@ typedef struct { char use_high_ampl_ranges_for_high_pw_ranges[max_channels]; /* addr 10066 - for AVMP-4 */ + char couple_first_N_pw_ranges_to_ampl_ranges[max_channels]; // addr 10068 + // for example, if N = 2 (as for AVR-E3-B-R5-N-M5) + // PG A = pw range 0, ampl range 0 + // PG B = pw range 1, ampl range 1 + // PG C = pw range 2+, ampl range 2 char spare_end; char flash_end; |