summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--device-functions.c28
-rw-r--r--flash.c6
-rw-r--r--globals.h48
3 files changed, 41 insertions, 41 deletions
diff --git a/device-functions.c b/device-functions.c
index 5c2ed2c..8847d92 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -2311,7 +2311,7 @@ int Set_VI_Cal_Pnt(int parameter,int channel,int calibration_point_number,float
pwl = 0;
pwl_distort = 0;
- max_points=points_in_range;
+ max_points=old_range_size_ten;
switch (parameter) {
case (pwl_ampl_values):
max_polarity=ampl_polarities;
@@ -2499,7 +2499,7 @@ int Set_VI_Del_Cal(int parameter,int channel,int calibration_point_number)
true_channel=channel;
- max_points=points_in_range;
+ max_points=old_range_size_ten;
pointer_short2=0;
switch (parameter) {
@@ -2605,10 +2605,10 @@ int Set_VI_Del_Cal(int parameter,int channel,int calibration_point_number)
}
}
- *(float *)(&pointer_float1[index+points_in_range-1])=0.0;
- *(short *)(&pointer_short1[index+points_in_range-1])=0;
+ *(float *)(&pointer_float1[index+old_range_size_ten-1])=0.0;
+ *(short *)(&pointer_short1[index+old_range_size_ten-1])=0;
if (pointer_short2) {
- *(short *)(&pointer_short2[index+points_in_range-1])=0;
+ *(short *)(&pointer_short2[index+old_range_size_ten-1])=0;
}
/* see if new point prevents min/max from being obtained */
@@ -2710,7 +2710,7 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
top_range_only=0;
starting_range=0;
- max_points=points_in_range;
+ max_points=old_range_size_ten;
reciprocal_relationship=NO;
decreasing_values_allowed=NO;
min_os_in_range=max_os_in_range=0.0;
@@ -3006,7 +3006,7 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
*point_found=1;
if ((parameter==pwl_ampl_values) && globals.Flash.ampl_os_ranges_related[channel]) {
- for (i=0; i<points_in_range; i++) {
+ for (i=0; i<old_range_size_ten; 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];
}
@@ -3020,7 +3020,7 @@ 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++) {
+ for (i=0; i<old_range_size_ten; 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];
}
@@ -3141,10 +3141,10 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
float abs_cal_point;
int max_points,max_polarity,max_ranges;
- float temp_y_float1[points_in_range+1];
- float temp_x_float1[points_in_range+1]; /* float copy of short, for calculations */
- int temp_x_short1[points_in_range+1];
- int temp_x_short2[points_in_range+1];
+ float temp_y_float1[old_range_size_ten+1];
+ float temp_x_float1[old_range_size_ten+1]; /* float copy of short, for calculations */
+ int temp_x_short1[old_range_size_ten+1];
+ int temp_x_short2[old_range_size_ten+1];
int index,actual_pol;
float *pointer_y_float1;
@@ -3159,7 +3159,7 @@ int Set_VI_Add_Cal(int parameter,int channel,float cal_point)
range=polarity=0;
- max_points=points_in_range;
+ max_points=old_range_size_ten;
pointer_x_short2=0;
abs_cal_point=cal_point;
@@ -3465,7 +3465,7 @@ int Get_VI_Rng_Info(int parameter, int channel, int calibration_point_number, in
*num_in_range=0;
/* determine array structure */
- max_points=points_in_range;
+ max_points=old_range_size_ten;
switch (parameter) {
case pwl_ampl_values:
diff --git a/flash.c b/flash.c
index e518438..c32d8d3 100644
--- a/flash.c
+++ b/flash.c
@@ -525,7 +525,7 @@ static void initFlashValues(FlashStruct *mem)
mem->enable_avrq_extra_ampls=0;
- for (i=0; i<points_in_range; i++) {
+ for (i=0; i<old_range_size_ten; i++) {
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;
@@ -541,7 +541,7 @@ static void initFlashValues(FlashStruct *mem)
power_of_two=24.0e-9;
for (j=0; j<timing_ranges; j++) {
for (k=0; k<timing_polarities; k++) {
- for (m=0; m<points_in_range; m++) {
+ for (m=0; m<old_range_size_ten; m++) {
mem->slew_pwl[i][j][k][m]=0.0;
mem->slew_dacval[i][j][k][m]=0;
@@ -616,7 +616,7 @@ static void initFlashValues(FlashStruct *mem)
power_of_two=20.0e-9;
for (j=0; j<ampl_ranges; j++) {
for (k=0; k<ampl_polarities; k++) {
- for (m=0; m<points_in_range; m++) {
+ for (m=0; m<old_range_size_ten; m++) {
if (m==0) {
mem->rise_time_dacval[i][j][k][m]=dac_max;
mem->rise_time_pwl[i][j][k][m]=(1e-9+power_of_two);
diff --git a/globals.h b/globals.h
index 96ee600..88ce7d4 100644
--- a/globals.h
+++ b/globals.h
@@ -125,7 +125,7 @@
#define os_ranges 5 /* must be equal to ampl_ranges now */
#define ampl_polarities 2
#define os_polarities 1
-#define points_in_range 10
+#define old_range_size_ten 10
#define timing_ranges 8
#define timing_polarities 1
@@ -483,8 +483,8 @@ typedef struct {
/* so that per-channel section starts at 256 */
/* [chan][range 0-4][polarity][interpolation point 0-9] */
- short ampl_dacval[max_channels][ampl_ranges][ampl_polarities][points_in_range];
- float ampl_pwl[max_channels][ampl_ranges][ampl_polarities][points_in_range];
+ short ampl_dacval[max_channels][ampl_ranges][ampl_polarities][old_range_size_ten];
+ float ampl_pwl[max_channels][ampl_ranges][ampl_polarities][old_range_size_ten];
float rcl_frequency[max_channels][max_stored_settings];
float rcl_delay[max_channels][max_stored_settings];
@@ -537,8 +537,8 @@ typedef struct {
Use fixed_ampl_points instead */
short zout_min[max_channels]; /* addr 1912 */
- 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 os_dacval[max_channels][os_ranges][os_polarities][old_range_size_ten]; /* addr 1916 */
+ float os_pwl[max_channels][os_ranges][os_polarities][old_range_size_ten]; /* addr 2116 */
short ampl_DAC[max_channels]; /* addr 2516 */
short os_DAC[max_channels]; /* addr 2520 */
@@ -549,21 +549,21 @@ typedef struct {
char ext_amplify_enabled[max_channels]; /* addr 2532 */
char volt_ctrl_delay[max_channels]; /* addr 2534 */
- float rise_time_pwl[max_channels][ampl_ranges][ampl_polarities][points_in_range]; /* addr 2536 */
+ float rise_time_pwl[max_channels][ampl_ranges][ampl_polarities][old_range_size_ten]; /* 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_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 pw_dacval[max_channels][timing_ranges][timing_polarities][old_range_size_ten]; /* addr 3360 */
+ float pw_pwl[max_channels][timing_ranges][timing_polarities][old_range_size_ten]; /* addr 3680 */
- 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 delay_dacval[max_channels][timing_ranges][timing_polarities][old_range_size_ten]; /* addr 4320 */
+ float delay_pwl[max_channels][timing_ranges][timing_polarities][old_range_size_ten];
- 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];
+ short period_dacval[max_channels][timing_ranges][timing_polarities][old_range_size_ten]; /* addr 5280 */
+ float period_pwl[max_channels][timing_ranges][timing_polarities][old_range_size_ten];
float distort_X[max_channels]; /* distortion = Z + X / (Ampl + Y). */
@@ -590,8 +590,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_dacval[max_channels][timing_ranges][timing_polarities][points_in_range]; /* 6336 */
- float burst_pwl[max_channels][timing_ranges][timing_polarities][points_in_range]; /* 6656 */
+ short burst_dacval[max_channels][timing_ranges][timing_polarities][old_range_size_ten]; /* 6336 */
+ float burst_pwl[max_channels][timing_ranges][timing_polarities][old_range_size_ten]; /* 6656 */
float pulse_width_pol_tweak[max_channels][ampl_polarities]; /* 7296 - allow for PW shift with polarity */
@@ -613,12 +613,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_dacval[max_channels][ampl_ranges][ampl_polarities][points_in_range]; /* 7438 */
+ short rise_time_dacval[max_channels][ampl_ranges][ampl_polarities][old_range_size_ten]; /* 7438 */
- 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 */
+ short vcc1_dacval[1][1][1][old_range_size_ten]; /* no longer used */
+ float vcc1_pwl[1][1][1][old_range_size_ten]; /* no longer used */
+ short vcc2_dacval[1][1][1][old_range_size_ten]; /* no longer used */
+ float vcc2_pwl[1][1][1][old_range_size_ten]; /* 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 */
@@ -675,8 +675,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_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 */
+ short load_type_dacval[max_channels][load_type_ranges][load_type_polarities][old_range_size_ten]; /* 8752 */
+ float load_type_pwl[max_channels][load_type_ranges][load_type_polarities][old_range_size_ten]; /* 8792 */
char pcb_203a_rise_time[max_channels]; /* addr 8872 */
@@ -702,8 +702,8 @@ typedef struct {
float max_slew[max_channels]; /* addr 8974 */
float rcl_slew[max_channels][max_stored_settings]; /* addr 8982 */
- 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 slew_dacval[max_channels][timing_ranges][timing_polarities][old_range_size_ten]; /* addr 9014 */
+ float slew_pwl[max_channels][timing_ranges][timing_polarities][old_range_size_ten]; /* addr 9334 */
short fix_pw_dac_val[max_channels]; /* addr 9974 */
@@ -764,7 +764,7 @@ typedef struct {
/* addr 10256, add ampl-dependent distort output, 10V full-scale */
- short distort_dacval[max_channels][ampl_ranges][ampl_polarities][points_in_range];
+ short distort_dacval[max_channels][ampl_ranges][ampl_polarities][old_range_size_ten];
char distort_dac[max_channels]; /* addr 10656 */
char distort_enabled[max_channels]; /* addr 10658 */