summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike <mjc@avtechpulse.com>2000-01-01 00:57:24 +0900
committerMike <mjc@avtechpulse.com>2000-01-01 00:57:24 +0900
commit4dc26232f303ff91955ed5656da5bae6d8978242 (patch)
treee8a2cffaa353a7bdda2c41a0413dbccb046c159f
parent6dd6772dc72dde0e1412ace800931c1117eadbba (diff)
make self-cal reference frequency configurable
-rw-r--r--device-functions.c3
-rw-r--r--flash.c2
-rw-r--r--globals.h6
3 files changed, 8 insertions, 3 deletions
diff --git a/device-functions.c b/device-functions.c
index 2565a02..9f3a086 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -4222,7 +4222,8 @@ int I2C_Self_Cal(int channel, int meas_mode, float *meas, float target_time)
continue;
}
- this = count * 100e-9;
+ this = count / get_bounded_float (globals.Flash.self_cal_ref_freq, SELF_CAL_REF_FREQ);
+
max_error = 0.001;
avg = 0.0;
diff --git a/flash.c b/flash.c
index 92a5370..529ce74 100644
--- a/flash.c
+++ b/flash.c
@@ -517,6 +517,8 @@ static void initFlashValues(FlashStruct *mem)
mem->prf_limiter=1;
+ mem->self_cal_ref_freq = SELF_CAL_REF_FREQ;
+
mem->pcb116c_mon=1; /* more recent ADC, different reading code */
mem->warn_even_if_output_off=0;
diff --git a/globals.h b/globals.h
index 6645967..147eb7e 100644
--- a/globals.h
+++ b/globals.h
@@ -230,7 +230,7 @@
// hardware default values
#define DEFAULT_OUTPUT_ON_DELAY 0.8 // needs at least 800 ms, due to soft-on circuit
-
+#define SELF_CAL_REF_FREQ 1e7 // 10 MHz
// menu stuff
#define Main_Menu_On 0
@@ -464,7 +464,9 @@ typedef struct {
char prf_limiter; /* 243 */
- char spare_padding[12]; /* 244 - padding between common and per-channel sections of the */
+ float self_cal_ref_freq; /* 244 */
+
+ char spare_padding[8]; /* 248 - padding between common and per-channel sections of the */
/* flash eeprom. Adjust size if variables added to common section, */
/* so that per-channel section starts at 256 */