summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
authormjc <mjc@avtechpulse.com>1970-01-01 10:36:31 +0900
committermjc <mjc@avtechpulse.com>1970-01-01 10:36:31 +0900
commit3a7e097b05c1283e2a1dc344799cd3bf9bd96969 (patch)
tree1a88fb90ec3f18fe200b1fbc04551c3e902dfa69 /device-functions.c
parent2b750070dc78edaed92b8900c152ac899c385c47 (diff)
Enforce minimum ampl magnitude (based on zero_equiv_ampl) in AVRQ -AHV, -XHV options
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/device-functions.c b/device-functions.c
index 83a384f..51134ff 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -4707,6 +4707,12 @@ int number_of_fixed_ampl_points(int channel)
}
+gboolean non_zero_first_ampl_point (int channel)
+{
+ return (globals.Flash.ampl_pwl_amp[channel][0][0][0] != 0.0);
+}
+
+
float rst_ampl_value (int channel)
{
// smallest positive value, or zero
@@ -4714,8 +4720,16 @@ float rst_ampl_value (int channel)
int max;
max = number_of_fixed_ampl_points(channel);
- if (max == 0) {
+ if (non_zero_first_ampl_point(channel)) {
+
+ // For AVRQ -AHV, -XHV options, where valids ampls may be
+ // 1.0 to 1.5 kV, positive or negative
+ return globals.Flash.ampl_zero_equiv[channel];
+
+ } else if (max == 0) {
+
// not a unit that uses a list of fixed amplitudes
+ // normal scenario
if ((globals.Flash.min_ampl[channel] > 0.0) && (globals.Flash.max_ampl[channel] > 0.0)) {
// both min and max ampls are positive, range does not include zero. AVR-D4-B.
@@ -4727,7 +4741,10 @@ float rst_ampl_value (int channel)
// normal unit
return 0.0;
}
+
} else {
+ // a list of fixed amplitudes is used
+
int i, pos_count, neg_count;
pos_count = 0;
neg_count = 0;