From 48c913a96a917c2681f181237c3a1e28061e7d6d Mon Sep 17 00:00:00 2001 From: "bsongis@gmail.com" Date: Thu, 4 Apr 2013 06:29:12 +0000 Subject: [PATCH] [all] Bug in AUTOSOURCE feature --- src/opentx.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opentx.cpp b/src/opentx.cpp index 2f543faab..06d8316a5 100644 --- a/src/opentx.cpp +++ b/src/opentx.cpp @@ -1119,9 +1119,9 @@ bool getSwitch(int8_t swtch, bool nc) } swstate_t switches_states = 0; -tmr10ms_t s_move_last_time = 0; int8_t getMovedSwitch() { + static tmr10ms_t s_move_last_time = 0; int8_t result = 0; #if defined(PCBTARANIS) @@ -1175,6 +1175,7 @@ int8_t getMovedSwitch() #if defined(AUTOSOURCE) int8_t getMovedSource() { + static tmr10ms_t s_move_last_time = 0; static int16_t sourcesStates[NUM_STICKS+NUM_POTS]; int8_t result = 0;