summaryrefslogtreecommitdiffstats
path: root/pressure_control/firmware/main.h
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-11-21 21:46:36 +0100
committerMichael Buesch <mb@bu3sch.de>2009-11-21 21:46:36 +0100
commite45fe924520ec4ee1463f9402a4506ade5743700 (patch)
treedf94db066f0011da2502cf9cca79f22b47b1413b /pressure_control/firmware/main.h
parent8846e3f77ac57f3eb5235cd16dea7fd0f24c90d5 (diff)
downloadcnc-e45fe924520ec4ee1463f9402a4506ade5743700.tar.xz
cnc-e45fe924520ec4ee1463f9402a4506ade5743700.zip
pressure_control: ADC averaging
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'pressure_control/firmware/main.h')
-rw-r--r--pressure_control/firmware/main.h6
1 files changed, 4 insertions, 2 deletions
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,
bues.ch cgit interface