summaryrefslogtreecommitdiff
path: root/globals.h
diff options
context:
space:
mode:
Diffstat (limited to 'globals.h')
-rw-r--r--globals.h5
1 files changed, 5 insertions, 0 deletions
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 */