From 754daf480b463ed836dd3139a3dae67b6f91b059 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Jan 1970 10:02:44 +0900 Subject: set *rcl amplitudes to safe values if fixed amplitudes used --- flash.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/flash.c b/flash.c index 6ec20c0..0cf05a8 100644 --- a/flash.c +++ b/flash.c @@ -3,6 +3,7 @@ #include "i2c.h" #include "version.h" #include "flash.h" +#include "device-functions.h" #include #include #include @@ -958,6 +959,14 @@ void fixFlash(FlashStruct *mem) } int j; + float safe_val = 0.0; + gboolean uses_fixed_ampl; + + uses_fixed_ampl = (number_of_fixed_ampl_points(i) > 0); + if (uses_fixed_ampl) { + safe_val = rst_fixed_ampl_point (i); + } + for (j=0; jrcl_burst_time[i][j] < globals.Constraints.composite_min_burst_time[i]) { mem->rcl_burst_time[i][j]=globals.Constraints.composite_min_burst_time[i]; @@ -975,6 +984,12 @@ void fixFlash(FlashStruct *mem) mem->rcl_soft_current_limit[i][j]=mem->max_soft_current_limit[i]; ++fix_initial_constants; } + + if (uses_fixed_ampl && !fixed_ampl_ok(i,mem->rcl_amplitude[i][j])) { + mem->rcl_amplitude[i][j] = safe_val; + ++fix_initial_constants; + } + } // for AVM-6-B in particular @@ -998,6 +1013,9 @@ void fixFlash(FlashStruct *mem) eprom_loc = (char *) &(mem->rcl_soft_current_limit) - (char *) &(mem->flash_start); writeUserBlock(&globals.Flash, eprom_loc, sizeof(mem->rcl_soft_current_limit)); + + eprom_loc = (char *) &(mem->rcl_amplitude) - (char *) &(mem->flash_start); + writeUserBlock(&globals.Flash, eprom_loc, sizeof(mem->rcl_amplitude)); } } -- cgit