summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--error_utils.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/error_utils.c b/error_utils.c
index 24a9af5..f146129 100644
--- a/error_utils.c
+++ b/error_utils.c
@@ -887,7 +887,8 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
if (ChannelStateToTest[i].double_pulse==double_on) {
- temp=0.95/(ChannelStateToTest[i].pw+fabs(ChannelStateToTest[i].delay));
+ // pulse sep must be less than one half-period
+ temp = 0.5 / ChannelStateToTest[i].delay;
if (temp<globals.Constraints.err_max_freq[i]) {
globals.Constraints.err_max_freq[i]=temp;
if (ChannelStateToTest[i].frequency>(1.001*globals.Constraints.err_max_freq[i])) {
@@ -954,6 +955,10 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
report_error=Double_Separation_Too_Small;
}
}
+
+ if (ChannelStateToTest[i].burst_count>1) {
+ report_error=Cant_Do_Burst_and_Double;
+ }
}
if (ChannelStateToTest[i].trigger_source==source_internal) {
@@ -994,20 +999,6 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
}
- if (ChannelStateToTest[i].double_pulse==double_on) {
- temp=(0.95/ChannelStateToTest[i].frequency)-ChannelStateToTest[i].delay;
- if (temp<globals.Constraints.err_max_pw[i]) {
- globals.Constraints.err_max_pw[i]=temp;
- if (ChannelStateToTest[i].pw>(1.001*globals.Constraints.err_max_pw[i])) {
- report_error=Double_Separation_Too_Large;
- }
- }
-
- if (ChannelStateToTest[i].burst_count>1) {
- report_error=Cant_Do_Burst_and_Double;
- }
- }
-
if ((globals.Flash.max_avg_ampl[i]) > 0.0 && (fabs(ChannelStateToTest[i].amplitude)) > 0.0) {
temp=100.0 * globals.Flash.max_avg_ampl[i] /
(fabs(ChannelStateToTest[i].amplitude) * ChannelStateToTest[i].frequency * duty_scale);
@@ -1104,7 +1095,8 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
}
if (ChannelStateToTest[i].double_pulse==double_on) {
- temp=(0.95/ChannelStateToTest[i].frequency)-ChannelStateToTest[i].pw;
+ // one half-period
+ temp = 0.5 / ChannelStateToTest[i].frequency;
if (temp<globals.Constraints.err_max_delay[i]) {
globals.Constraints.err_max_delay[i]=temp;
if ( (globals.Constraints.err_max_delay[i]>=0.0 && ChannelStateToTest[i].delay>(1.001*globals.Constraints.err_max_delay[i]))