summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/device-functions.c b/device-functions.c
index c083f42..6630c19 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -2043,7 +2043,8 @@ int Set_Dly_Shr_Cal(int channel,int calibration_point_number,float cal_point)
int Set_Cal_Nom(int channel,int calibration_point_number,int parameter, float *nom_val)
{
int nominal_wordout,nominal_wordout_aux,polarity,range,entry,status,num_in_range,num_of_ranges;
- float nominal_val,other_setting,temp1,temp2;
+ float nominal_val,temp1,temp2;
+ float other_setting, other_setting_freq, other_setting_pw;
int reset_state;
int disable_errors;
int true_channel;
@@ -2214,16 +2215,23 @@ int Set_Cal_Nom(int channel,int calibration_point_number,int parameter, float *n
break;
case pwl_burst_values:
- other_setting=20.0*nominal_val;
- if (other_setting>10.0) {
- other_setting=10.0; /* reduce pulse width if required */
+ other_setting_freq = 1 / (20.0 * nominal_val);
+ other_setting_pw = nominal_val;
+
+ if (other_setting_freq < 0.1) {
+ other_setting_freq = 0.1;
}
- status=Set_frequency(0,0,0,channel,1.0/other_setting);
+
+ if (other_setting_pw > 0.1) {
+ other_setting_pw = 0.1;
+ }
+
+ status=Set_frequency(0,0,0,channel,other_setting_freq);
Main_update_shift_registers();
if (!status) {
- status=Set_Pw(0,0,0,globals.Flash.ChanKey_pw?channel:0,nominal_val,0);
+ status=Set_Pw(0,0,0,globals.Flash.ChanKey_pw?channel:0,other_setting_pw,0);
}
if (!status) {
status=Set_Burst_Count(channel,4,nominal_val);