From f70588d90e5166739b3d527f51b02c28f906c7df Mon Sep 17 00:00:00 2001 From: Sean Godinez Date: Fri, 22 Nov 2013 17:34:53 -0600 Subject: reset logic fix --- io-module/mts_io.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/io-module/mts_io.c b/io-module/mts_io.c index 9f27af2..728e39b 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -1212,12 +1212,15 @@ static void blink_callback(struct work_struct *ignored) if (vpid) { if (reset_pressed) { reset_count++; - } else if (reset_count > 0 && reset_count < RESET_HOLD_COUNT) { - kill_pid(vpid, reset_short_signal, 1); - reset_count = 0; - } else if (reset_count >= RESET_HOLD_COUNT && reset_count < RESET_LONG_HOLD_COUNT) { - reset_count = 0; - kill_pid(vpid, reset_long_signal, 1); + } else { + //Reset button has not been pressed + if (reset_count > 0 && reset_count < RESET_HOLD_COUNT) { + kill_pid(vpid, reset_short_signal, 1); + reset_count = 0; + } else if (reset_count >= RESET_HOLD_COUNT && reset_count < RESET_LONG_HOLD_COUNT) { + reset_count = 0; + kill_pid(vpid, reset_long_signal, 1); + } } if (reset_count >= RESET_LONG_HOLD_COUNT) { -- cgit v1.2.3