From cc978c4d1538c80ef6ea6deb26d972a25622c915 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Wed, 25 Feb 2015 16:03:17 +0100 Subject: controller: Reset measured values on pot reset Signed-off-by: Michael Buesch --- firmware/controller.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 + * Copyright (c) 2013-2015 Michael Buesch * * 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; -- cgit v1.2.3