summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike <mjc@avtechpulse.com>2000-01-01 00:15:59 +0900
committerMike <mjc@avtechpulse.com>2000-01-01 00:15:59 +0900
commit09b55d5ca98747a3c33b6fca10541104626bc2c3 (patch)
tree3e7f64ec87b1c574549a8a80c4dd3f40921c57b5
parentc42275085f4256ff608421f098c7b806d1f8c55c (diff)
Rename piece-wise-linear variables for clarity, dropping reference to obsolete 12bit values
-rw-r--r--device-functions.c302
-rw-r--r--flash.c154
-rw-r--r--globals.h44
-rw-r--r--parser.c4
4 files changed, 252 insertions, 252 deletions
diff --git a/device-functions.c b/device-functions.c
index 037d30e..1cc4322 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -851,7 +851,7 @@ int Set_Delay(int check_possible_only,int word_override,int range_override,int c
} else {
/* 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];
+ min_one_shot_delay = globals.Flash.delay_pwl[channel][0][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)) {
@@ -1691,8 +1691,8 @@ int Set_Amp_Calib(int channel,float meas_ampl)
}
for (i=0; i<10; ++i)
- globals.Flash.ampl_pwl_amp[channel][relay_range][UseNegData][i]=
- globals.Flash.ampl_pwl_amp[channel][relay_range][UseNegData][i]*change_ratio;
+ globals.Flash.ampl_pwl[channel][relay_range][UseNegData][i]=
+ globals.Flash.ampl_pwl[channel][relay_range][UseNegData][i]*change_ratio;
/* see if new data prevents min/max from being obtained */
@@ -1701,12 +1701,12 @@ int Set_Amp_Calib(int channel,float meas_ampl)
if (status) {
/* revert to original calibration */
for (i=0; i<10; ++i)
- globals.Flash.ampl_pwl_amp[channel][relay_range][UseNegData][i]=
- globals.Flash.ampl_pwl_amp[channel][relay_range][UseNegData][i]/change_ratio;
+ globals.Flash.ampl_pwl[channel][relay_range][UseNegData][i]=
+ globals.Flash.ampl_pwl[channel][relay_range][UseNegData][i]/change_ratio;
}
- eprom_loc = (char *) &(globals.Flash.ampl_pwl_amp) - (char *) &(globals.Flash.flash_start);
- writeUserBlock(&globals.Flash, eprom_loc, sizeof(globals.Flash.ampl_pwl_amp));
+ eprom_loc = (char *) &(globals.Flash.ampl_pwl) - (char *) &(globals.Flash.flash_start);
+ writeUserBlock(&globals.Flash, eprom_loc, sizeof(globals.Flash.ampl_pwl));
return status;
}
@@ -1792,7 +1792,7 @@ int Set_OS_Calib(int channel,float meas_ampl)
}
for (i=0; i<10; ++i) {
- globals.Flash.os_pwl_amp[channel][0][0][i]=globals.Flash.os_pwl_amp[channel][0][0][i]*change_ratio;
+ globals.Flash.os_pwl[channel][0][0][i]=globals.Flash.os_pwl[channel][0][0][i]*change_ratio;
}
@@ -1802,12 +1802,12 @@ int Set_OS_Calib(int channel,float meas_ampl)
if (status) {
/* revert to original calibration */
for (i=0; i<10; ++i) {
- globals.Flash.os_pwl_amp[channel][0][0][i]=globals.Flash.os_pwl_amp[channel][0][0][i]/change_ratio;
+ globals.Flash.os_pwl[channel][0][0][i]=globals.Flash.os_pwl[channel][0][0][i]/change_ratio;
}
}
- eprom_loc = (char *) &(globals.Flash.os_pwl_amp) - (char *) &(globals.Flash.flash_start);
- writeUserBlock(&globals.Flash, eprom_loc, sizeof(globals.Flash.os_pwl_amp));
+ eprom_loc = (char *) &(globals.Flash.os_pwl) - (char *) &(globals.Flash.flash_start);
+ writeUserBlock(&globals.Flash, eprom_loc, sizeof(globals.Flash.os_pwl));
return status;
}
@@ -2051,11 +2051,11 @@ int Set_Cal_Nom(int channel,int calibration_point_number,int parameter, float *n
switch (parameter) {
case (pwl_ampl_values):
- nominal_val=globals.Flash.ampl_pwl_amp[channel][range][polarity][entry];
+ nominal_val=globals.Flash.ampl_pwl[channel][range][polarity][entry];
if (polarity) {
nominal_val=-nominal_val;
}
- nominal_wordout=globals.Flash.ampl_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.ampl_dacval[channel][range][polarity][entry];
if (Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.min_ampl[channel],0) || Set_Amplitude(0,0,0,0,0,0,channel,globals.Flash.max_ampl[channel],0)) {
/* confirm that timing settings can support min/max ampl settings */
return CalibrationTimingProblem;
@@ -2071,40 +2071,40 @@ int Set_Cal_Nom(int channel,int calibration_point_number,int parameter, float *n
}
break;
case (pwl_os_values):
- nominal_val=globals.Flash.os_pwl_amp[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.os_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.os_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.os_dacval[channel][range][polarity][entry];
break;
case pwl_pw_values:
- nominal_val=globals.Flash.pw_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.pw_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.pw_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.pw_dacval[channel][range][polarity][entry];
reset_state=disable_errors=1;
break;
case pwl_delay_values:
- nominal_val=globals.Flash.delay_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.delay_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.delay_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.delay_dacval[channel][range][polarity][entry];
disable_errors=1;
if (!globals.Flash.volt_ctrl_delay[channel]) {
reset_state=1;
}
break;
case pwl_period_values:
- nominal_val=globals.Flash.period_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.period_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.period_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.period_dacval[channel][range][polarity][entry];
reset_state=disable_errors=1;
break;
case pwl_burst_values:
- nominal_val=globals.Flash.burst_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.burst_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.burst_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.burst_dacval[channel][range][polarity][entry];
reset_state=disable_errors=1;
break;
case pwl_rise_time_values:
- nominal_val=globals.Flash.rise_time_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.rise_time_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.rise_time_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.rise_time_dacval[channel][range][polarity][entry];
reset_state=disable_errors=1;
break;
case pwl_slew_values:
- nominal_val=globals.Flash.slew_pwl_time[channel][range][polarity][entry];
- nominal_wordout=globals.Flash.slew_pwl_Vc_norm4095[channel][range][polarity][entry];
+ nominal_val=globals.Flash.slew_pwl[channel][range][polarity][entry];
+ nominal_wordout=globals.Flash.slew_dacval[channel][range][polarity][entry];
break;
}
@@ -2265,7 +2265,7 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
float nom_ampl;
int index;
int max_points,max_polarity,max_ranges;
- float *pwl_amp;
+ float *pwl;
int true_channel;
true_channel=channel;
@@ -2277,42 +2277,42 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
case (pwl_ampl_values):
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl_amp=&globals.Flash.ampl_pwl_amp[0][0][0][0];
+ pwl=&globals.Flash.ampl_pwl[0][0][0][0];
break;
case (pwl_os_values):
max_polarity=os_polarities;
max_ranges=os_ranges;
- pwl_amp=&globals.Flash.os_pwl_amp[0][0][0][0];
+ pwl=&globals.Flash.os_pwl[0][0][0][0];
break;
case pwl_pw_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_amp=&globals.Flash.pw_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.pw_pwl[0][0][0][0];
break;
case pwl_delay_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_amp=&globals.Flash.delay_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.delay_pwl[0][0][0][0];
break;
case pwl_period_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_amp=&globals.Flash.period_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.period_pwl[0][0][0][0];
break;
case pwl_burst_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_amp=&globals.Flash.burst_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.burst_pwl[0][0][0][0];
break;
case pwl_rise_time_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl_amp=&globals.Flash.rise_time_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.rise_time_pwl[0][0][0][0];
break;
case pwl_slew_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_amp=&globals.Flash.slew_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.slew_pwl[0][0][0][0];
break;
}
index=true_channel*max_ranges*max_polarity*max_points
@@ -2320,7 +2320,7 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
+polarity*max_points
+entry;
- nom_ampl=pwl_amp[index];
+ nom_ampl=pwl[index];
switch (parameter) {
case (pwl_ampl_values):
@@ -2384,14 +2384,14 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
cal_point=fabs(cal_point);
}
- *(float *)(&pwl_amp[index])=cal_point;
+ *(float *)(&pwl[index])=cal_point;
/* see if new point prevents min/max from being obtained */
status=Check_MinMax_Cal(channel,parameter);
if (status) {
/* revert to original value if required */
- *(float *)(&pwl_amp[index])=nom_ampl;
+ *(float *)(&pwl[index])=nom_ampl;
}
Set_Cal_Nom(channel,calibration_point_number,parameter,NULL);
@@ -2399,7 +2399,7 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
Main_update_shift_registers();
Show_Main_Menu();
- eprom_loc = (char *) (&pwl_amp[index]) - (char *) &(globals.Flash.flash_start);
+ eprom_loc = (char *) (&pwl[index]) - (char *) &(globals.Flash.flash_start);
writeUserBlock(&globals.Flash, eprom_loc, sizeof(nom_ampl));
globals.Flags.extended_ampl_min_max=NO;
@@ -2427,66 +2427,66 @@ int Set_VI_Del_Cal(int parameter,int channel,int calibration_point_number)
case (pwl_ampl_values):
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pointer_short1=&globals.Flash.ampl_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.ampl_pwl_amp[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.ampl_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.ampl_pwl_amp);
+ pointer_short1=&globals.Flash.ampl_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.ampl_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.ampl_dacval);
+ size_of_float1=sizeof(globals.Flash.ampl_pwl);
break;
case (pwl_os_values):
max_polarity=os_polarities;
max_ranges=os_ranges;
- pointer_short1=&globals.Flash.os_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.os_pwl_amp[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.os_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.os_pwl_amp);
+ pointer_short1=&globals.Flash.os_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.os_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.os_dacval);
+ size_of_float1=sizeof(globals.Flash.os_pwl);
break;
case pwl_pw_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_short1=&globals.Flash.pw_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.pw_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.pw_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.pw_pwl_time);
+ pointer_short1=&globals.Flash.pw_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.pw_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.pw_dacval);
+ size_of_float1=sizeof(globals.Flash.pw_pwl);
break;
case pwl_delay_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_short1=&globals.Flash.delay_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.delay_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.delay_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.delay_pwl_time);
+ pointer_short1=&globals.Flash.delay_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.delay_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.delay_dacval);
+ size_of_float1=sizeof(globals.Flash.delay_pwl);
break;
case pwl_period_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_short1=&globals.Flash.period_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.period_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.period_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.period_pwl_time);
+ pointer_short1=&globals.Flash.period_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.period_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.period_dacval);
+ size_of_float1=sizeof(globals.Flash.period_pwl);
break;
case pwl_burst_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_short1=&globals.Flash.burst_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.burst_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.burst_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.burst_pwl_time);
+ pointer_short1=&globals.Flash.burst_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.burst_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.burst_dacval);
+ size_of_float1=sizeof(globals.Flash.burst_pwl);
break;
case pwl_rise_time_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pointer_short1=&globals.Flash.rise_time_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.rise_time_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.rise_time_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.rise_time_pwl_time);
+ pointer_short1=&globals.Flash.rise_time_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.rise_time_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.rise_time_dacval);
+ size_of_float1=sizeof(globals.Flash.rise_time_pwl);
break;
case pwl_slew_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_short1=&globals.Flash.slew_pwl_Vc_norm4095[0][0][0][0];
- pointer_float1=&globals.Flash.slew_pwl_time[0][0][0][0];
- size_of_short1=sizeof(globals.Flash.slew_pwl_Vc_norm4095);
- size_of_float1=sizeof(globals.Flash.slew_pwl_time);
+ pointer_short1=&globals.Flash.slew_dacval[0][0][0][0];
+ pointer_float1=&globals.Flash.slew_pwl[0][0][0][0];
+ size_of_short1=sizeof(globals.Flash.slew_dacval);
+ size_of_float1=sizeof(globals.Flash.slew_pwl);
break;
}
@@ -2585,8 +2585,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
float min_ampl_in_range,max_ampl_in_range;
int max_points,max_polarity,max_ranges;
- float *pwl_amp;
- short *pwl_vc;
+ float *pwl;
+ short *pwl_dacval;
int index,use_range;
int range_i,entry_i;
int pw_polarity;
@@ -2622,8 +2622,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl_vc=&globals.Flash.ampl_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.ampl_pwl_amp[0][0][0][0];
+ pwl_dacval=&globals.Flash.ampl_dacval[0][0][0][0];
+ pwl=&globals.Flash.ampl_pwl[0][0][0][0];
if (new_ampl<0.0) {
*actual_pol=1;
*UseNegData=1;
@@ -2645,7 +2645,7 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
if ( globals.Flash.switchable_load[channel] &&
(globals.ChannelState[channel].load_type>globals.Flash.low_load_type[channel]) &&
- globals.Flash.ampl_pwl_Vc_norm4095[channel][3][*actual_pol][1] > 0) {
+ globals.Flash.ampl_dacval[channel][3][*actual_pol][1] > 0) {
starting_range=3;
top_range_only=0;
}
@@ -2689,16 +2689,16 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
decreasing_values_allowed=YES; /* allows Vc=0 to corresponds to most + OS, and Vc=10V to give most - OS */
max_polarity=os_polarities;
max_ranges=os_ranges;
- pwl_vc=&globals.Flash.os_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.os_pwl_amp[0][0][0][0];
+ pwl_dacval=&globals.Flash.os_dacval[0][0][0][0];
+ pwl=&globals.Flash.os_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
break;
case pwl_pw_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_vc=&globals.Flash.pw_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.pw_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.pw_dacval[0][0][0][0];
+ pwl=&globals.Flash.pw_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
@@ -2753,8 +2753,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
case pwl_delay_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_vc=&globals.Flash.delay_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.delay_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.delay_dacval[0][0][0][0];
+ pwl=&globals.Flash.delay_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
@@ -2765,8 +2765,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
case pwl_period_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_vc=&globals.Flash.period_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.period_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.period_dacval[0][0][0][0];
+ pwl=&globals.Flash.period_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
reciprocal_relationship=YES;
@@ -2774,8 +2774,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
case pwl_burst_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_vc=&globals.Flash.burst_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.burst_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.burst_dacval[0][0][0][0];
+ pwl=&globals.Flash.burst_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
reciprocal_relationship=YES;
@@ -2783,8 +2783,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
case pwl_rise_time_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl_vc=&globals.Flash.rise_time_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.rise_time_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.rise_time_dacval[0][0][0][0];
+ pwl=&globals.Flash.rise_time_pwl[0][0][0][0];
if (globals.ChannelState[channel].amplitude<0.0) {
*actual_pol=*UseNegData=1;
} else {
@@ -2796,8 +2796,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
case pwl_slew_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl_vc=&globals.Flash.slew_pwl_Vc_norm4095[0][0][0][0];
- pwl_amp=&globals.Flash.slew_pwl_time[0][0][0][0];
+ pwl_dacval=&globals.Flash.slew_dacval[0][0][0][0];
+ pwl=&globals.Flash.slew_pwl[0][0][0][0];
*UseNegData=0;
use_ampl=new_ampl;
reciprocal_relationship=NO;
@@ -2889,8 +2889,8 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
// floats seems to generate instructions that can't work on unaligned
// data and these are unaligned.
float pwlamp1, pwlamp2;
- memcpy(&pwlamp1, &pwl_amp[index], sizeof(pwlamp1));
- memcpy(&pwlamp2, &pwl_amp[index+1], sizeof(pwlamp2));
+ memcpy(&pwlamp1, &pwl[index], sizeof(pwlamp1));
+ memcpy(&pwlamp2, &pwl[index+1], sizeof(pwlamp2));
if ( (fabs(pwlamp1-pwlamp2)>smallest_allowed_number)
&&
@@ -2903,11 +2903,11 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
if ((parameter==pwl_ampl_values) && globals.Flash.ampl_os_ranges_related[channel]) {
for (i=0; i<points_in_range; i++) {
- if (max_os_in_range<globals.Flash.os_pwl_amp[channel][range_i][0][i]) {
- max_os_in_range=globals.Flash.os_pwl_amp[channel][range_i][0][i];
+ if (max_os_in_range<globals.Flash.os_pwl[channel][range_i][0][i]) {
+ max_os_in_range=globals.Flash.os_pwl[channel][range_i][0][i];
}
- if (min_os_in_range>globals.Flash.os_pwl_amp[channel][range_i][0][i]) {
- min_os_in_range=globals.Flash.os_pwl_amp[channel][range_i][0][i];
+ if (min_os_in_range>globals.Flash.os_pwl[channel][range_i][0][i]) {
+ min_os_in_range=globals.Flash.os_pwl[channel][range_i][0][i];
}
}
if ((globals.ChannelState[channel].offset<min_os_in_range) || (globals.ChannelState[channel].offset>max_os_in_range)) {
@@ -2917,11 +2917,11 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
if ((parameter==pwl_os_values) && globals.Flash.ampl_os_ranges_related[channel]) {
for (i=0; i<points_in_range; i++) {
- if (max_ampl_in_range<globals.Flash.ampl_pwl_amp[channel][range_i][*UseNegData][i]) {
- max_ampl_in_range=globals.Flash.ampl_pwl_amp[channel][range_i][*UseNegData][i];
+ if (max_ampl_in_range<globals.Flash.ampl_pwl[channel][range_i][*UseNegData][i]) {
+ max_ampl_in_range=globals.Flash.ampl_pwl[channel][range_i][*UseNegData][i];
}
- if (min_ampl_in_range>globals.Flash.ampl_pwl_amp[channel][range_i][*UseNegData][i]) {
- min_ampl_in_range=globals.Flash.ampl_pwl_amp[channel][range_i][*UseNegData][i];
+ if (min_ampl_in_range>globals.Flash.ampl_pwl[channel][range_i][*UseNegData][i]) {
+ min_ampl_in_range=globals.Flash.ampl_pwl[channel][range_i][*UseNegData][i];
}
}
if ((fabs(globals.ChannelState[channel].amplitude)<min_ampl_in_range) || (fabs(globals.ChannelState[channel].amplitude)>max_ampl_in_range)) {
@@ -2935,14 +2935,14 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
/* check for linear voltage-controlled PW */
if ( (parameter==pwl_pw_values)
&& globals.Flash.volt_ctrl_pw[channel]
- && (pwl_vc[index] < pwl_vc[index+1])) {
+ && (pwl_dacval[index] < pwl_dacval[index+1])) {
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])) {
+ && (pwl_dacval[index] < pwl_dacval[index+1])) {
reciprocal_relationship=NO;
}
@@ -2950,9 +2950,9 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
// Normally just the first range is voltage-controlled.
if (reciprocal_relationship) {
- *word_out = inverse_interpolation (pwl_vc[index], pwl_vc[index+1], pwlamp1, pwlamp2, tweaked_use_ampl);
+ *word_out = inverse_interpolation (pwl_dacval[index], pwl_dacval[index+1], pwlamp1, pwlamp2, tweaked_use_ampl);
} else {
- *word_out = linear_interpolation (pwl_vc[index], pwl_vc[index+1], pwlamp1, pwlamp2, tweaked_use_ampl);
+ *word_out = linear_interpolation (pwl_dacval[index], pwl_dacval[index+1], pwlamp1, pwlamp2, tweaked_use_ampl);
}
}
}
@@ -2979,7 +2979,7 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
index=true_channel*max_ranges*max_polarity*max_points
+(range_i)*max_polarity*max_points
+(*UseNegData)*max_points;
- if (pwl_amp[index]>smallest_allowed_number && pwl_amp[index]<tweaked_use_ampl) {
+ if (pwl[index]>smallest_allowed_number && pwl[index]<tweaked_use_ampl) {
use_range=range_i;
}
}
@@ -2995,14 +2995,14 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
+(entry_i);
/* find the last two non-zero entries, and extrapolate from them */
- if ( (fabs(pwl_amp[index])>smallest_allowed_number)
- && (fabs(pwl_amp[index+1])>smallest_allowed_number)
- && (fabs(pwl_amp[index]-pwl_amp[index+1])>smallest_allowed_number) ) {
+ if ( (fabs(pwl[index])>smallest_allowed_number)
+ && (fabs(pwl[index+1])>smallest_allowed_number)
+ && (fabs(pwl[index]-pwl[index+1])>smallest_allowed_number) ) {
*point_found=1;
*relay_range=use_range;
*entry=entry_i;
- *word_out = inverse_interpolation (pwl_vc[index], pwl_vc[index+1], pwl_amp[index], pwl_amp[index+1], tweaked_use_ampl);
+ *word_out = inverse_interpolation (pwl_dacval[index], pwl_dacval[index+1], pwl[index], pwl[index+1], tweaked_use_ampl);
}
}
}
@@ -3059,10 +3059,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pointer_x_short=&globals.Flash.ampl_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.ampl_pwl_amp[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.ampl_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.ampl_pwl_amp);
+ pointer_x_short=&globals.Flash.ampl_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.ampl_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.ampl_dacval);
+ size_of_y_float=sizeof(globals.Flash.ampl_pwl);
Set_VI_Control(pwl_ampl_values,channel,globals.ChannelState[channel].amplitude,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3079,10 +3079,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case (pwl_os_values):
max_polarity=os_polarities;
max_ranges=os_ranges;
- pointer_x_short=&globals.Flash.os_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.os_pwl_amp[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.os_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.os_pwl_amp);
+ pointer_x_short=&globals.Flash.os_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.os_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.os_dacval);
+ size_of_y_float=sizeof(globals.Flash.os_pwl);
old_val=globals.ChannelState[channel].offset;
Set_VI_Control(pwl_os_values,channel,old_val,&point_found,
@@ -3091,10 +3091,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_pw_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_x_short=&globals.Flash.pw_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.pw_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.pw_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.pw_pwl_time);
+ pointer_x_short=&globals.Flash.pw_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.pw_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.pw_dacval);
+ size_of_y_float=sizeof(globals.Flash.pw_pwl);
old_val=globals.ChannelState[channel].pw;
Set_VI_Control(pwl_pw_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3102,10 +3102,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_delay_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_x_short=&globals.Flash.delay_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.delay_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.delay_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.delay_pwl_time);
+ pointer_x_short=&globals.Flash.delay_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.delay_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.delay_dacval);
+ size_of_y_float=sizeof(globals.Flash.delay_pwl);
old_val=globals.ChannelState[channel].delay;
Set_VI_Control(pwl_delay_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3113,10 +3113,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_period_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_x_short=&globals.Flash.period_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.period_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.period_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.period_pwl_time);
+ pointer_x_short=&globals.Flash.period_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.period_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.period_dacval);
+ size_of_y_float=sizeof(globals.Flash.period_pwl);
old_val=1.0/globals.ChannelState[channel].frequency;
Set_VI_Control(pwl_period_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3124,10 +3124,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_burst_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_x_short=&globals.Flash.burst_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.burst_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.burst_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.burst_pwl_time);
+ pointer_x_short=&globals.Flash.burst_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.burst_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.burst_dacval);
+ size_of_y_float=sizeof(globals.Flash.burst_pwl);
old_val=globals.ChannelState[channel].burst_time;
Set_VI_Control(pwl_burst_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3135,10 +3135,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_rise_time_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pointer_x_short=&globals.Flash.rise_time_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.rise_time_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.rise_time_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.rise_time_pwl_time);
+ pointer_x_short=&globals.Flash.rise_time_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.rise_time_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.rise_time_dacval);
+ size_of_y_float=sizeof(globals.Flash.rise_time_pwl);
old_val=globals.ChannelState[channel].rise_time;
Set_VI_Control(pwl_rise_time_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3146,10 +3146,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
case pwl_slew_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pointer_x_short=&globals.Flash.slew_pwl_Vc_norm4095[0][0][0][0];
- pointer_y_float=&globals.Flash.slew_pwl_time[0][0][0][0];
- size_of_x_short=sizeof(globals.Flash.slew_pwl_Vc_norm4095);
- size_of_y_float=sizeof(globals.Flash.slew_pwl_time);
+ pointer_x_short=&globals.Flash.slew_dacval[0][0][0][0];
+ pointer_y_float=&globals.Flash.slew_pwl[0][0][0][0];
+ size_of_x_short=sizeof(globals.Flash.slew_dacval);
+ size_of_y_float=sizeof(globals.Flash.slew_pwl);
old_val=globals.ChannelState[channel].slew;
Set_VI_Control(pwl_slew_values,channel,old_val,&point_found,
&range,&atten_range,&polarity,&entry,&word_out,&actual_pol);
@@ -3332,42 +3332,42 @@ int Get_VI_Rng_Info(int parameter, int channel, int calibration_point_number, in
case pwl_ampl_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl=&globals.Flash.ampl_pwl_amp[0][0][0][0];
+ pwl=&globals.Flash.ampl_pwl[0][0][0][0];
break;
case pwl_os_values:
max_polarity=os_polarities;
max_ranges=os_ranges;
- pwl=&globals.Flash.os_pwl_amp[0][0][0][0];
+ pwl=&globals.Flash.os_pwl[0][0][0][0];
break;
case pwl_pw_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl=&globals.Flash.pw_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.pw_pwl[0][0][0][0];
break;
case pwl_delay_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl=&globals.Flash.delay_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.delay_pwl[0][0][0][0];
break;
case pwl_period_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl=&globals.Flash.period_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.period_pwl[0][0][0][0];
break;
case pwl_burst_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl=&globals.Flash.burst_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.burst_pwl[0][0][0][0];
break;
case pwl_rise_time_values:
max_polarity=ampl_polarities;
max_ranges=ampl_ranges;
- pwl=&globals.Flash.rise_time_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.rise_time_pwl[0][0][0][0];
break;
case pwl_slew_values:
max_polarity=timing_polarities;
max_ranges=timing_ranges;
- pwl=&globals.Flash.slew_pwl_time[0][0][0][0];
+ pwl=&globals.Flash.slew_pwl[0][0][0][0];
break;
}
@@ -4713,7 +4713,7 @@ int number_of_fixed_ampl_points(int channel)
gboolean non_zero_first_ampl_point (int channel)
{
- return (globals.Flash.ampl_pwl_amp[channel][0][0][0] != 0.0);
+ return (globals.Flash.ampl_pwl[channel][0][0][0] != 0.0);
}
diff --git a/flash.c b/flash.c
index 0178f30..d8c3529 100644
--- a/flash.c
+++ b/flash.c
@@ -526,15 +526,15 @@ static void initFlashValues(FlashStruct *mem)
mem->enable_avrq_extra_ampls=0;
for (i=0; i<points_in_range; i++) {
- mem->vcc1_pwl_Vc_norm4095[0][0][0][i]=0;
- mem->vcc1_pwl_amp[0][0][0][i]=0.0;
- mem->vcc2_pwl_Vc_norm4095[0][0][0][i]=0;
- mem->vcc2_pwl_amp[0][0][0][i]=0.0;
+ mem->vcc1_dacval[0][0][0][i]=0;
+ mem->vcc1_pwl[0][0][0][i]=0.0;
+ mem->vcc2_dacval[0][0][0][i]=0;
+ mem->vcc2_pwl[0][0][0][i]=0.0;
}
- mem->vcc1_pwl_Vc_norm4095[0][0][0][1]=dac_max;
- mem->vcc1_pwl_amp[0][0][0][1]=10.0;
- mem->vcc2_pwl_Vc_norm4095[0][0][0][1]=dac_max;
- mem->vcc2_pwl_amp[0][0][0][1]=25;
+ mem->vcc1_dacval[0][0][0][1]=dac_max;
+ mem->vcc1_pwl[0][0][0][1]=10.0;
+ mem->vcc2_dacval[0][0][0][1]=dac_max;
+ mem->vcc2_pwl[0][0][0][1]=25;
for (i=0; i<max_channels; i++) {
power_of_ten=1.0;
@@ -542,8 +542,8 @@ static void initFlashValues(FlashStruct *mem)
for (j=0; j<timing_ranges; j++) {
for (k=0; k<timing_polarities; k++) {
for (m=0; m<points_in_range; m++) {
- mem->slew_pwl_time[i][j][k][m]=0.0;
- mem->slew_pwl_Vc_norm4095[i][j][k][m]=0;
+ mem->slew_pwl[i][j][k][m]=0.0;
+ mem->slew_dacval[i][j][k][m]=0;
int temp_int;
@@ -553,52 +553,52 @@ static void initFlashValues(FlashStruct *mem)
temp_int = dac_max;
- mem->period_pwl_time[i][j][k][m]=(47e-9*power_of_ten)+41e-9;
- mem->pw_pwl_time[i][j][k][m]=(6e-9*power_of_ten)+20e-9;
- mem->delay_pwl_time[i][j][k][m]=((6e-9*power_of_ten)+10e-9) * (i+1.0);
- mem->burst_pwl_time[i][j][k][m]=(22e-9*power_of_ten)+25e-9;
+ mem->period_pwl[i][j][k][m]=(47e-9*power_of_ten)+41e-9;
+ mem->pw_pwl[i][j][k][m]=(6e-9*power_of_ten)+20e-9;
+ mem->delay_pwl[i][j][k][m]=((6e-9*power_of_ten)+10e-9) * (i+1.0);
+ mem->burst_pwl[i][j][k][m]=(22e-9*power_of_ten)+25e-9;
} else if (m==1) {
temp_int = dac_max/2.15;
- mem->period_pwl_time[i][j][k][m]=(100e-9*power_of_ten)+50e-9;
- mem->pw_pwl_time[i][j][k][m]=(14e-9*power_of_ten)+25e-9;
- mem->delay_pwl_time[i][j][k][m]=((14e-9*power_of_ten)+30e-9) * (i+1.0);
- mem->burst_pwl_time[i][j][k][m]=(33e-9*power_of_ten)+10e-9;
+ mem->period_pwl[i][j][k][m]=(100e-9*power_of_ten)+50e-9;
+ mem->pw_pwl[i][j][k][m]=(14e-9*power_of_ten)+25e-9;
+ mem->delay_pwl[i][j][k][m]=((14e-9*power_of_ten)+30e-9) * (i+1.0);
+ mem->burst_pwl[i][j][k][m]=(33e-9*power_of_ten)+10e-9;
} else if (m==2) {
temp_int = dac_max/4.6;
- mem->period_pwl_time[i][j][k][m]=(230e-9*power_of_ten)+100e-9;
- mem->pw_pwl_time[i][j][k][m]=(28e-9*power_of_ten)+50e-9;
- mem->delay_pwl_time[i][j][k][m]=((28e-9*power_of_ten)+60e-9) * (i+1.0);
- mem->burst_pwl_time[i][j][k][m]=(50e-9*power_of_ten)+10e-9;
+ mem->period_pwl[i][j][k][m]=(230e-9*power_of_ten)+100e-9;
+ mem->pw_pwl[i][j][k][m]=(28e-9*power_of_ten)+50e-9;
+ mem->delay_pwl[i][j][k][m]=((28e-9*power_of_ten)+60e-9) * (i+1.0);
+ mem->burst_pwl[i][j][k][m]=(50e-9*power_of_ten)+10e-9;
} else if (m==3) {
temp_int = dac_max / 10;
- mem->period_pwl_time[i][j][k][m]=(470e-9*power_of_ten)+160e-9;
- mem->pw_pwl_time[i][j][k][m]=(70e-9*power_of_ten)+80e-9;
- mem->delay_pwl_time[i][j][k][m]=((70e-9*power_of_ten))+90e-9 * (i+1.0);
- mem->burst_pwl_time[i][j][k][m]=(110e-9*power_of_ten)+10e-9;
+ mem->period_pwl[i][j][k][m]=(470e-9*power_of_ten)+160e-9;
+ mem->pw_pwl[i][j][k][m]=(70e-9*power_of_ten)+80e-9;
+ mem->delay_pwl[i][j][k][m]=((70e-9*power_of_ten))+90e-9 * (i+1.0);
+ mem->burst_pwl[i][j][k][m]=(110e-9*power_of_ten)+10e-9;
} else if (m==4) {
temp_int = dac_max / 20 ;
- mem->period_pwl_time[i][j][k][m]=(900e-9*power_of_ten)+200e-9;
- mem->pw_pwl_time[i][j][k][m]=(140e-9*power_of_ten)+80e-9;
- mem->delay_pwl_time[i][j][k][m]=((140e-9*power_of_ten)+90e-9) * (i+1.0);
- mem->burst_pwl_time[i][j][k][m]=(220e-9*power_of_ten)+10e-9;
+ mem->period_pwl[i][j][k][m]=(900e-9*power_of_ten)+200e-9;
+ mem->pw_pwl[i][j][k][m]=(140e-9*power_of_ten)+80e-9;
+ mem->delay_pwl[i][j][k][m]=((140e-9*power_of_ten)+90e-9) * (i+1.0);
+ mem->burst_pwl[i][j][k][m]=(220e-9*power_of_ten)+10e-9;
} else {
temp_int = 0;
- mem->pw_pwl_time[i][j][k][m]=0.0;
- mem->delay_pwl_time[i][j][k][m]=0.0;
- mem->period_pwl_time[i][j][k][m]=0.0;
- mem->burst_pwl_time[i][j][k][m]=0.0;
+ mem->pw_pwl[i][j][k][m]=0.0;
+ mem->delay_pwl[i][j][k][m]=0.0;
+ mem->period_pwl[i][j][k][m]=0.0;
+ mem->burst_pwl[i][j][k][m]=0.0;
}
- mem->pw_pwl_Vc_norm4095[i][j][k][m]=temp_int;
- mem->delay_pwl_Vc_norm4095[i][j][k][m]=temp_int;
- mem->period_pwl_Vc_norm4095[i][j][k][m]=temp_int;
- mem->burst_pwl_Vc_norm4095[i][j][k][m]=temp_int;
+ mem->pw_dacval[i][j][k][m]=temp_int;
+ mem->delay_dacval[i][j][k][m]=temp_int;
+ mem->period_dacval[i][j][k][m]=temp_int;
+ mem->burst_dacval[i][j][k][m]=temp_int;
}
}
power_of_ten*=10.0;
@@ -611,17 +611,17 @@ static void initFlashValues(FlashStruct *mem)
for (k=0; k<ampl_polarities; k++) {
for (m=0; m<points_in_range; m++) {
if (m==0) {
- mem->rise_time_pwl_Vc_norm4095[i][j][k][m]=dac_max;
- mem->rise_time_pwl_time[i][j][k][m]=(1e-9+power_of_two);
+ mem->rise_time_dacval[i][j][k][m]=dac_max;
+ mem->rise_time_pwl[i][j][k][m]=(1e-9+power_of_two);
} else if (m==1) {
- mem->rise_time_pwl_Vc_norm4095[i][j][k][m]=dac_max/2;
- mem->rise_time_pwl_time[i][j][k][m]=(1e-9+(power_of_two*1.5));
+ mem->rise_time_dacval[i][j][k][m]=dac_max/2;
+ mem->rise_time_pwl[i][j][k][m]=(1e-9+(power_of_two*1.5));
} else if (m==2) {
- mem->rise_time_pwl_Vc_norm4095[i][j][k][m]=dac_max/4.6;
- mem->rise_time_pwl_time[i][j][k][m]=(1e-9+(power_of_two*3.0));
+ mem->rise_time_dacval[i][j][k][m]=dac_max/4.6;
+ mem->rise_time_pwl[i][j][k][m]=(1e-9+(power_of_two*3.0));
} else {
- mem->rise_time_pwl_Vc_norm4095[i][j][k][m]=0;
- mem->rise_time_pwl_time[i][j][k][m]=0.0;
+ mem->rise_time_dacval[i][j][k][m]=0;
+ mem->rise_time_pwl[i][j][k][m]=0.0;
}
}
}
@@ -637,12 +637,12 @@ static void initFlashValues(FlashStruct *mem)
for (j=0; j<10; j++)
for (k=0; k<5; k++)
for (m=0; m<2; m++) {
- mem->ampl_pwl_Vc_norm4095[i][k][m][j]=0;
- mem->ampl_pwl_amp[i][k][m][j]=0.0;
+ mem->ampl_dacval[i][k][m][j]=0;
+ mem->ampl_pwl[i][k][m][j]=0.0;
}
- mem->ampl_pwl_Vc_norm4095[i][0][0][1]=dac_max;
- mem->ampl_pwl_amp[i][0][0][1]=100.0;
+ mem->ampl_dacval[i][0][0][1]=dac_max;
+ mem->ampl_pwl[i][0][0][1]=100.0;
for (j=0; j<max_stored_settings; j++) {
mem->rcl_frequency[i][j]=10000.0;
@@ -670,36 +670,36 @@ static void initFlashValues(FlashStruct *mem)
mem->mon_vi_ratio[i][j][k]=0.050*(j+1);
}
- mem->load_type_pwl_time[i][0][0][0] = 200;
- mem->load_type_pwl_time[i][0][0][1] = 10000;
- mem->load_type_pwl_Vc_norm4095[i][0][0][0] = dac_max;
- mem->load_type_pwl_Vc_norm4095[i][0][0][1] = dac_max / 60;
+ mem->load_type_pwl[i][0][0][0] = 200;
+ mem->load_type_pwl[i][0][0][1] = 10000;
+ mem->load_type_dacval[i][0][0][0] = dac_max;
+ mem->load_type_dacval[i][0][0][1] = dac_max / 60;
for (j=2; j<10; j++) {
- mem->load_type_pwl_time[i][0][0][j] = 0;
- mem->load_type_pwl_Vc_norm4095[i][0][0][j] = 0;
+ mem->load_type_pwl[i][0][0][j] = 0;
+ mem->load_type_dacval[i][0][0][j] = 0;
}
- mem->slew_pwl_time[i][4][0][0]=80e6;
- mem->slew_pwl_time[i][4][0][1]=240e6;
- mem->slew_pwl_time[i][3][0][0]=40e6;
- mem->slew_pwl_time[i][3][0][1]=120e6;
- mem->slew_pwl_time[i][2][0][0]=20e6;
- mem->slew_pwl_time[i][2][0][1]=60e6;
- mem->slew_pwl_time[i][1][0][0]=10e6;
- mem->slew_pwl_time[i][1][0][1]=30e6;
- mem->slew_pwl_time[i][0][0][0]=5e6;
- mem->slew_pwl_time[i][0][0][1]=15e6;
-
- mem->slew_pwl_Vc_norm4095[i][0][0][1]=dac_max;
- mem->slew_pwl_Vc_norm4095[i][1][0][1]=dac_max;
- mem->slew_pwl_Vc_norm4095[i][2][0][1]=dac_max;
- mem->slew_pwl_Vc_norm4095[i][3][0][1]=dac_max;
- mem->slew_pwl_Vc_norm4095[i][4][0][1]=dac_max;
+ mem->slew_pwl[i][4][0][0]=80e6;
+ mem->slew_pwl[i][4][0][1]=240e6;
+ mem->slew_pwl[i][3][0][0]=40e6;
+ mem->slew_pwl[i][3][0][1]=120e6;
+ mem->slew_pwl[i][2][0][0]=20e6;
+ mem->slew_pwl[i][2][0][1]=60e6;
+ mem->slew_pwl[i][1][0][0]=10e6;
+ mem->slew_pwl[i][1][0][1]=30e6;
+ mem->slew_pwl[i][0][0][0]=5e6;
+ mem->slew_pwl[i][0][0][1]=15e6;
+
+ mem->slew_dacval[i][0][0][1]=dac_max;
+ mem->slew_dacval[i][1][0][1]=dac_max;
+ mem->slew_dacval[i][2][0][1]=dac_max;
+ mem->slew_dacval[i][3][0][1]=dac_max;
+ mem->slew_dacval[i][4][0][1]=dac_max;
}
/* special consideration for CH2 delay */
- mem->delay_pwl_time[1][0][0][0]=-0.1e-9;
+ mem->delay_pwl[1][0][0][0]=-0.1e-9;
for (i=0; i<max_channels; i++) {
mem->routing_required[i]=0;
@@ -773,12 +773,12 @@ static void initFlashValues(FlashStruct *mem)
for (j=0; j<10; j++) {
for (k=0; k<5; k++) {
- mem->os_pwl_Vc_norm4095[i][k][0][j]=0;
- mem->os_pwl_amp[i][k][0][j]=0.0;
+ mem->os_dacval[i][k][0][j]=0;
+ mem->os_pwl[i][k][0][j]=0.0;
}
}
- mem->os_pwl_Vc_norm4095[i][0][0][1]=dac_max;
- mem->os_pwl_amp[i][0][0][1]=100.0;
+ mem->os_dacval[i][0][0][1]=dac_max;
+ mem->os_pwl[i][0][0][1]=100.0;
mem->ampl_DAC[i]=0;
mem->os_DAC[i]=1;
diff --git a/globals.h b/globals.h
index 3679c61..5a1e811 100644
--- a/globals.h
+++ b/globals.h
@@ -480,8 +480,8 @@ typedef struct {
/* so that per-channel section starts at 256 */
/* [chan][range 0-4][polarity][interpolation point 0-9] */
- short ampl_pwl_Vc_norm4095[max_channels][ampl_ranges][ampl_polarities][points_in_range];
- float ampl_pwl_amp[max_channels][ampl_ranges][ampl_polarities][points_in_range];
+ short ampl_dacval[max_channels][ampl_ranges][ampl_polarities][points_in_range];
+ float ampl_pwl[max_channels][ampl_ranges][ampl_polarities][points_in_range];
float rcl_frequency[max_channels][max_stored_settings];
float rcl_delay[max_channels][max_stored_settings];
@@ -534,8 +534,8 @@ typedef struct {
Use fixed_ampl_points instead */
short zout_min[max_channels]; /* addr 1912 */
- short os_pwl_Vc_norm4095[max_channels][os_ranges][os_polarities][points_in_range]; /* addr 1916 */
- float os_pwl_amp[max_channels][os_ranges][os_polarities][points_in_range]; /* addr 2116 */
+ short os_dacval[max_channels][os_ranges][os_polarities][points_in_range]; /* addr 1916 */
+ float os_pwl[max_channels][os_ranges][os_polarities][points_in_range]; /* addr 2116 */
short ampl_DAC[max_channels]; /* addr 2516 */
short os_DAC[max_channels]; /* addr 2520 */
@@ -546,21 +546,21 @@ typedef struct {
char ext_amplify_enabled[max_channels]; /* addr 2532 */
char volt_ctrl_delay[max_channels]; /* addr 2534 */
- float rise_time_pwl_time[max_channels][ampl_ranges][ampl_polarities][points_in_range]; /* addr 2536 */
+ float rise_time_pwl[max_channels][ampl_ranges][ampl_polarities][points_in_range]; /* addr 2536 */
short ext_amplify_xtra_rly[max_channels]; /* addr 3336 */
short ea_xtra_rly[max_channels]; /* addr 3340 */
short rcl_misc2[max_channels][max_stored_settings]; /* addr 3344 */
- short pw_pwl_Vc_norm4095[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 3360 */
- float pw_pwl_time[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 3680 */
+ short pw_dacval[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 3360 */
+ float pw_pwl[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 3680 */
- short delay_pwl_Vc_norm4095[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 4320 */
- float delay_pwl_time[max_channels][timing_ranges][timing_polarities][points_in_range];
+ short delay_dacval[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 4320 */
+ float delay_pwl[max_channels][timing_ranges][timing_polarities][points_in_range];
- short period_pwl_Vc_norm4095[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 5280 */
- float period_pwl_time[max_channels][timing_ranges][timing_polarities][points_in_range];
+ short period_dacval[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 5280 */
+ float period_pwl[max_channels][timing_ranges][timing_polarities][points_in_range];
float distort_X[max_channels]; /* distortion = Z + X / (Ampl + Y). */
@@ -587,8 +587,8 @@ typedef struct {
char is_monocycle[max_channels]; /* 6332 - generate control voltage for monocycle spacing, using CH2 PW calibration */
char monocycle_dac[max_channels]; /* 6334 */
- short burst_pwl_Vc_norm4095[max_channels][timing_ranges][timing_polarities][points_in_range]; /* 6336 */
- float burst_pwl_time[max_channels][timing_ranges][timing_polarities][points_in_range]; /* 6656 */
+ short burst_dacval[max_channels][timing_ranges][timing_polarities][points_in_range]; /* 6336 */
+ float burst_pwl[max_channels][timing_ranges][timing_polarities][points_in_range]; /* 6656 */
float pulse_width_pol_tweak[max_channels][ampl_polarities]; /* 7296 - allow for PW shift with polarity */
@@ -610,12 +610,12 @@ typedef struct {
short pw_dac[max_channels]; /* 7402 - for voltage-controlled PW only */
float rcl_rise_time[max_channels][max_stored_settings]; /* 7406 - rcl/sav data for rise time */
- short rise_time_pwl_Vc_norm4095[max_channels][ampl_ranges][ampl_polarities][points_in_range]; /* 7438 */
+ short rise_time_dacval[max_channels][ampl_ranges][ampl_polarities][points_in_range]; /* 7438 */
- short vcc1_pwl_Vc_norm4095[1][1][1][points_in_range]; /* no longer used */
- float vcc1_pwl_amp[1][1][1][points_in_range]; /* no longer used */
- short vcc2_pwl_Vc_norm4095[1][1][1][points_in_range]; /* no longer used */
- float vcc2_pwl_amp[1][1][1][points_in_range]; /* no longer used */
+ short vcc1_dacval[1][1][1][points_in_range]; /* no longer used */
+ float vcc1_pwl[1][1][1][points_in_range]; /* no longer used */
+ short vcc2_dacval[1][1][1][points_in_range]; /* no longer used */
+ float vcc2_pwl[1][1][1][points_in_range]; /* no longer used */
float rcl_vcc1[max_channels][max_stored_settings]; /* no longer used */
float rcl_vcc2[max_channels][max_stored_settings]; /* no longer used */
float rcl_vlogic[max_channels][max_stored_settings]; /* no longer used */
@@ -672,8 +672,8 @@ typedef struct {
float sparex1[max_channels]; /* addr 8704 */
float sparex2[max_channels]; /* addr 8712 */
float rcl_sparex3[max_channels][max_stored_settings]; /* addr 8720 */
- short load_type_pwl_Vc_norm4095[max_channels][load_type_ranges][load_type_polarities][points_in_range]; /* 8752 */
- float load_type_pwl_time[max_channels][load_type_ranges][load_type_polarities][points_in_range]; /* 8792 */
+ short load_type_dacval[max_channels][load_type_ranges][load_type_polarities][points_in_range]; /* 8752 */
+ float load_type_pwl[max_channels][load_type_ranges][load_type_polarities][points_in_range]; /* 8792 */
char pcb_203a_rise_time[max_channels]; /* addr 8872 */
@@ -699,8 +699,8 @@ typedef struct {
float max_slew[max_channels]; /* addr 8974 */
float rcl_slew[max_channels][max_stored_settings]; /* addr 8982 */
- short slew_pwl_Vc_norm4095[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 9014 */
- float slew_pwl_time[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 9334 */
+ short slew_dacval[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 9014 */
+ float slew_pwl[max_channels][timing_ranges][timing_polarities][points_in_range]; /* addr 9334 */
short fix_pw_dac_val[max_channels]; /* addr 9974 */
diff --git a/parser.c b/parser.c
index b9e7dec..3462df3 100644
--- a/parser.c
+++ b/parser.c
@@ -3408,13 +3408,13 @@ static int Go_dly_shift_82(gchar** response, int channel, char *parameter,char *
case query_simple:
- min_one_shot_delay = globals.Flash.delay_pwl_time[channel][0][0][0];
+ min_one_shot_delay = globals.Flash.delay_pwl[channel][0][0][0];
*response = g_strdup_printf (
"Fixed delay: %f ns, PG-SYNC propagation delay: %f ns, narrowest variable delay: %f ns, all delays valid: %s, delay monotonic in external trigger mode: %s",
globals.Flash.delay_shrink[channel]*1e9,
globals.Flash.propagation_delay[channel]*1e9,
- globals.Flash.delay_pwl_time[channel][0][0][0]*1e9,
+ globals.Flash.delay_pwl[channel][0][0][0]*1e9,
(globals.Flash.delay_shrink[channel] >= min_one_shot_delay) ? "TRUE" : "FALSE",
(( globals.Flash.delay_shrink[channel] - globals.Flash.propagation_delay[channel] ) >= min_one_shot_delay) ? "TRUE" : "FALSE");
return OK;