diff options
author | root <root@avtech.domain.avtechpulse.com> | 1970-01-01 09:00:40 +0900 |
---|---|---|
committer | root <root@avtech.domain.avtechpulse.com> | 1970-01-01 09:00:40 +0900 |
commit | e543ca1b79ffaa919d58593103296d037c126a0f (patch) | |
tree | 794d88bd4c954e7590b4f8b05c5b810acd17d863 /device-functions.c | |
parent | ae151649ecf9f612195053c1358f9d450eb96767 (diff) |
first attempt at implementing CH2 2CHPP delay function
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/device-functions.c b/device-functions.c index 4f9cc22..310d945 100644 --- a/device-functions.c +++ b/device-functions.c @@ -792,7 +792,8 @@ int Set_Delay(int check_possible_only,int word_override,int range_override,int c /* won't work for all values if apparent fixed delay is less than minimum variable delay */ min_one_shot_delay = globals.Flash.delay_pwl_time[channel][0][0][0]; - if ( (globals.Flash.delay_shrink[channel] > 0.0) && + if ( !globals.Flash.volt_ctrl_delay[channel] && + (globals.Flash.delay_shrink[channel] > 0.0) && (globals.Flash.delay_shrink[channel] < min_one_shot_delay)) { return DelayRangeError; } @@ -819,26 +820,29 @@ int Set_Delay(int check_possible_only,int word_override,int range_override,int c return ExternalModeDelayError; } + setting = set_delay; - /* tweak depending on polarity */ - adj_setting = set_delay; - if (globals.ChannelState[channel].amplitude<0.0) { - adj_setting -= globals.Flash.delay_pol_tweak[channel][1]; - } else { - adj_setting -= globals.Flash.delay_pol_tweak[channel][0]; - } + if (!globals.Flash.volt_ctrl_delay[channel]) { + /* tweak depending on polarity */ + adj_setting = set_delay; + if (globals.ChannelState[channel].amplitude<0.0) { + adj_setting -= globals.Flash.delay_pol_tweak[channel][1]; + } else { + adj_setting -= globals.Flash.delay_pol_tweak[channel][0]; + } - setting = adj_setting + globals.Flash.delay_shrink[channel] - globals.Flash.propagation_delay[channel]; + setting = adj_setting + globals.Flash.delay_shrink[channel] - globals.Flash.propagation_delay[channel]; - if (setting >= min_one_shot_delay) { - Set_AdvDel(channel,to_Advance); - } else { - setting = globals.Flash.delay_shrink[channel] + globals.Flash.propagation_delay[channel] - adj_setting; - Set_AdvDel(channel,to_Delay); + if (setting >= min_one_shot_delay) { + Set_AdvDel(channel,to_Advance); + } else { + setting = globals.Flash.delay_shrink[channel] + globals.Flash.propagation_delay[channel] - adj_setting; + Set_AdvDel(channel,to_Delay); + } } /* protect against impossible settings during first turn-on */ - if (setting<zero_equiv_timing) { + if ((setting<zero_equiv_timing) && (globals.Flash.min_delay[channel] >= 0.0) ) { return HardwareError; } @@ -2816,6 +2820,13 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int reciprocal_relationship=NO; } + /* check for linear voltage-controlled delay */ + if ( (parameter==pwl_delay_values) + && globals.Flash.volt_ctrl_delay[channel] + && (pwl_vc[index] < pwl_vc[index+1])) { + reciprocal_relationship=NO; + } + if (reciprocal_relationship) { inverse_word_out = fraction * (1.0/((float) pwl_vc[index]) - 1.0/((float) pwl_vc[index+1])); inverse_word_out+=1/((float) pwl_vc[index]); |