From 608cc506418375737ba53d520fabf905c19ca672 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 1 Jan 2000 01:22:35 +0900 Subject: better monitor averaging (for AVO-8E3 S/N 13790) with auto-reset of average --- globals.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'globals.h') diff --git a/globals.h b/globals.h index 534a9bc..85d81d4 100644 --- a/globals.h +++ b/globals.h @@ -350,6 +350,9 @@ typedef struct { } CalStruct; +#define CURR_MON_MAX_OLD_COUNTS 50 // monitor readings are around 50/sec, average over one second +#define MAX_STEP_DEV_FROM_AVG 5 // reset monitor average if more than N steps difference + typedef struct { float frequency; /* the global frequency variable */ float delay; /* the global delay variable */ @@ -361,6 +364,8 @@ typedef struct { /* not part of sav/rcl, generated by amplitude routines */ float Curr_Mon_value; /* current monitor reading */ + float old_mon_vals[CURR_MON_MAX_OLD_COUNTS]; /* for monitor averaging */ + int num_mon_vals; /* how many monitor readings are stored */ float displayed_mon_val; /* used to determine when LCD update is required */ int Curr_Mon_offset; /* current monitor ADC offset */ -- cgit