summaryrefslogtreecommitdiffstats
path: root/pressure_control/firmware/sensor.c
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/sensor.c
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/sensor.c')
-rw-r--r--pressure_control/firmware/sensor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pressure_control/firmware/sensor.c b/pressure_control/firmware/sensor.c
index 08eca77..6e59bb1 100644
--- a/pressure_control/firmware/sensor.c
+++ b/pressure_control/firmware/sensor.c
@@ -72,6 +72,12 @@ void sensor_trigger_read(struct sensor *s)
adc_trigger(s->adc_mux, 1);
}
+void sensor_retrigger(void)
+{
+ /* Retrigger an ADC conversion on the currently active sensor. */
+ adc_trigger(active_sensor->adc_mux, 1);
+}
+
void sensor_init(struct sensor *s)
{
mdelay(20); /* Warm-up time */
bues.ch cgit interface