summaryrefslogtreecommitdiffstats
path: root/pressure_control
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-11-22 13:27:57 +0100
committerMichael Buesch <mb@bu3sch.de>2009-11-22 13:27:57 +0100
commit9c025d4fbc0630c2caf12caf67770ad62b0843b7 (patch)
treecce6febdc84537d993605fdef547087aae3678e8 /pressure_control
parenta5535dc44ba3ec8110c7b1ac56a629352c4cb023 (diff)
downloadcnc-9c025d4fbc0630c2caf12caf67770ad62b0843b7.tar.xz
cnc-9c025d4fbc0630c2caf12caf67770ad62b0843b7.zip
pressure_control: Reduce averaging
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'pressure_control')
-rw-r--r--pressure_control/firmware/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pressure_control/firmware/main.c b/pressure_control/firmware/main.c
index 9cddf08..4794434 100644
--- a/pressure_control/firmware/main.c
+++ b/pressure_control/firmware/main.c
@@ -67,7 +67,7 @@ static DEFINE_SENSOR(xy_control_sensor, (1<<MUX0), 245, 4400, 10000);
/* Report hysteresis (in mBar).
* Don't report changes lower than this (With some exceptions). */
-#define REPORT_HYSTERESIS 25
+#define REPORT_HYSTERESIS 15
@@ -153,9 +153,9 @@ void sensor_result(struct sensor *s, uint16_t mbar)
{
state.measured_mbar += mbar;
- if (++state.nr_adc_measurements >= 8) {
+ if (++state.nr_adc_measurements >= 4) {
state.nr_adc_measurements = 0;
- state.measured_mbar /= 8;
+ state.measured_mbar /= 4;
mb();
/* Defer processing of the value to the mainloop, so we can
* do it with interrupts enabled. */
bues.ch cgit interface