summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike <mjc@avtechpulse.com>2000-01-01 00:20:23 +0900
committerMike <mjc@avtechpulse.com>2000-01-01 00:20:23 +0900
commit8722d53003e7f18b916e5b8bbd3e527fd1097ca4 (patch)
tree4796db74e4b89379e9cb94ff2336e7e5efb97f0e
parent2c73bb707c28fac0f6b1f2725b71e0e4ece92e49 (diff)
separate minimum equiv offset from ampl, for AVIR-4-B-OT
-rw-r--r--device-functions.c2
-rw-r--r--error_utils.c8
-rw-r--r--flash.c1
-rw-r--r--globals.h2
-rw-r--r--menus.c18
5 files changed, 21 insertions, 10 deletions
diff --git a/device-functions.c b/device-functions.c
index fa070bd..c0472bb 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -1796,7 +1796,7 @@ int Set_OS_Calib(int channel,float meas_ampl)
float change_ratio;
int i,status,eprom_loc;
- if (fabs(globals.ChannelState[channel].offset)<globals.Flash.ampl_zero_equiv[channel]) {
+ if (fabs(globals.ChannelState[channel].offset)<globals.Flash.os_zero_equiv[channel]) {
return NeedNonZeroAmpl;
}
diff --git a/error_utils.c b/error_utils.c
index f146129..5a2a14f 100644
--- a/error_utils.c
+++ b/error_utils.c
@@ -770,6 +770,14 @@ int Error_check(ChannelStruct ChannelStateToTest[max_channels])
report_error = zero_equiv_ampl_negative;
}
+ if (fabs(globals.Flash.os_zero_equiv[i] > 2000.0)) {
+ report_error = zero_equiv_ampl_too_large;
+ }
+
+ if (globals.Flash.os_zero_equiv[i] < 0.0) {
+ report_error = zero_equiv_ampl_negative;
+ }
+
/* calculate maximum duty cycle based on amplitude and load, for later use */
max_duty_high_ampl=globals.Flash.max_duty_high[i];
diff --git a/flash.c b/flash.c
index dfa8474..bff0caa 100644
--- a/flash.c
+++ b/flash.c
@@ -731,6 +731,7 @@ static void initFlashValues(FlashStruct *mem)
mem->propagation_delay[i]=10.0e-9;
mem->delay_shrink[i]=40.0e-9;
mem->ampl_zero_equiv[i]=0.1;
+ mem->os_zero_equiv[i]=0.01;
mem->max_duty_low[i]=110.0;
mem->max_duty_high[i]=110.0;
diff --git a/globals.h b/globals.h
index fce5b72..82fa556 100644
--- a/globals.h
+++ b/globals.h
@@ -770,6 +770,8 @@ typedef struct {
float double_pulse_extra_deadtime[max_channels]; // addr 10668 + this
float double_pulse_min_sep[max_channels]; // addr 10676
+ float os_zero_equiv[max_channels]; // addr 10684
+
char flash_end;
} FlashStruct;
diff --git a/menus.c b/menus.c
index 9bf9623..419e7e0 100644
--- a/menus.c
+++ b/menus.c
@@ -2278,15 +2278,15 @@ static int Submenu_Mult_Value(float mult_by)
break;
case Show_offset:
- if (fabs(new_value)<globals.Flash.ampl_zero_equiv[channel] && mult_by>1.0) {
- if (new_value<0.0 || globals.Flash.max_offset[channel]<globals.Flash.ampl_zero_equiv[channel]) {
- new_value=-globals.Flash.ampl_zero_equiv[channel];
+ if (fabs(new_value)<globals.Flash.os_zero_equiv[channel] && mult_by>1.0) {
+ if (new_value<0.0 || globals.Flash.max_offset[channel]<globals.Flash.os_zero_equiv[channel]) {
+ new_value=-globals.Flash.os_zero_equiv[channel];
} else {
- new_value=globals.Flash.ampl_zero_equiv[channel];
+ new_value=globals.Flash.os_zero_equiv[channel];
}
}
- if (fabs(new_value) < globals.Flash.ampl_zero_equiv[channel]) {
+ if (fabs(new_value) < globals.Flash.os_zero_equiv[channel]) {
if (new_value<0.0) {
new_value=-smallest_allowed_number;
} else {
@@ -2496,9 +2496,9 @@ static void Submenu_Service_Encoder(int encoder_change)
}
}
- else if ((channel<max_channels) && abs_Submenu_Value<globals.Flash.ampl_zero_equiv[channel] && (Submenu_Numeric_Parameter-channel)==Show_offset) {
- abs_Submenu_Value=globals.Flash.ampl_zero_equiv[channel];
- if (globals.Flash.max_offset[channel]<globals.Flash.ampl_zero_equiv[channel]) {
+ else if ((channel<max_channels) && abs_Submenu_Value<globals.Flash.os_zero_equiv[channel] && (Submenu_Numeric_Parameter-channel)==Show_offset) {
+ abs_Submenu_Value=globals.Flash.os_zero_equiv[channel];
+ if (globals.Flash.max_offset[channel]<globals.Flash.os_zero_equiv[channel]) {
Submenu_Value=-abs_Submenu_Value;
}
}
@@ -2730,7 +2730,7 @@ static void Submenu_Service_Encoder(int encoder_change)
if (globals.Flash.min_offset[channel]==globals.Flash.max_offset[channel]) {
return;
}
- if (fabs(new_value) < globals.Flash.ampl_zero_equiv[channel]) {
+ if (fabs(new_value) < globals.Flash.os_zero_equiv[channel]) {
if (Submenu_Value<0.0) {
new_value=-smallest_allowed_number;
} else {