From 0aa3b9ec80108e690c2ca5157cb6d83087a40788 Mon Sep 17 00:00:00 2001 From: "Michael J. Chudobiak" Date: Thu, 3 May 2018 09:20:22 -0400 Subject: original number of points in each range was 10 --- device-functions.c | 28 ++++++++++++++-------------- flash.c | 6 +++--- globals.h | 48 ++++++++++++++++++++++++------------------------ 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; ienable_avrq_extra_ampls=0; - for (i=0; ivcc1_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; jslew_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; jrise_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 */ -- cgit