summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2015-02-25 16:03:17 +0100
committerMichael Buesch <m@bues.ch>2015-02-25 16:03:17 +0100
commitcc978c4d1538c80ef6ea6deb26d972a25622c915 (patch)
tree00da550323c93a356a793e6fd7566355e296413d
parent97fb4acb2e9c66c0c4d1ec1553c3cfa000d1293d (diff)
downloadmoistcontrol-cc978c4d1538c80ef6ea6deb26d972a25622c915.tar.xz
moistcontrol-cc978c4d1538c80ef6ea6deb26d972a25622c915.zip
controller: Reset measured values on pot reset
Signed-off-by: Michael Buesch <m@bues.ch>
-rw-r--r--firmware/controller.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/firmware/controller.c b/firmware/controller.c
index e356514..941d3ef 100644
--- a/firmware/controller.c
+++ b/firmware/controller.c
@@ -1,7 +1,7 @@
/*
* Moistcontrol - Controller state machine
*
- * Copyright (c) 2013 Michael Buesch <m@bues.ch>
+ * Copyright (c) 2013-2015 Michael Buesch <m@bues.ch>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -407,6 +407,8 @@ static void pot_reset(struct flowerpot *pot)
/* Reset all state values. */
pot->state.is_watering = 0;
+ pot->state.last_measured_raw_value = 0;
+ pot->state.last_measured_value = 0;
pot->next_measurement = jiffies_get() + sec_to_jiffies(FIRST_CTRL_INTERVAL_SEC);
pot_state_enter(pot, POT_IDLE);
pot->valve_manual_en = 0;
bues.ch cgit interface