From e45fe924520ec4ee1463f9402a4506ade5743700 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Sat, 21 Nov 2009 21:46:36 +0100 Subject: pressure_control: ADC averaging Signed-off-by: Michael Buesch --- pressure_control/firmware/main.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pressure_control/firmware/main.h') diff --git a/pressure_control/firmware/main.h b/pressure_control/firmware/main.h index b229ade..915e66e 100644 --- a/pressure_control/firmware/main.h +++ b/pressure_control/firmware/main.h @@ -44,10 +44,10 @@ struct pressure_config { struct pressure_state { /* Sensing and adjustment logic enabled? */ bool device_enabled; - /* The last measured pressure (in mBar). + /* The sum of the last measured pressures (in mBar). * It depends on sensor_cycle which valves this * value belongs to. */ - uint16_t measured_mbar; + uint32_t measured_mbar; /* The current pressure for the individual valves */ uint16_t measured_mbar_xy; uint16_t measured_mbar_z; @@ -57,6 +57,8 @@ struct pressure_state { /* True, if the current pressure value needs checking against * the desired pressure config. */ bool needs_checking; + /* The current count of lowlevel ADC measurements. */ + uint8_t nr_adc_measurements; }; void get_pressure_config(struct pressure_config *xy, -- cgit v1.2.3