From e4e8efec96d8422f51bcd68f427c2529062b3405 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sun, 21 Dec 2014 20:14:13 +0100 Subject: [PATCH] Fixes #1927: THt persistent timer running after model load (with Throttle at -100%) --- radio/src/opentx.cpp | 5 ++++- radio/src/opentx.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 06f17b0d5..2874c90d8 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1811,7 +1811,10 @@ void doMixerCalculations() timerState->cnt=0; } else if (tm == TMRMODE_THR_TRG) { - if (val || newTimerVal > 0) { + if (val) { + timerState->state = TMR_TRIGGED; + } + if (timerState->state == TMR_TRIGGED) { newTimerVal++; } } diff --git a/radio/src/opentx.h b/radio/src/opentx.h index fab5eb6a0..d365a801b 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -860,6 +860,7 @@ extern uint8_t trimsDisplayMask; #define TMR_RUNNING 1 #define TMR_NEGATIVE 2 #define TMR_STOPPED 3 +#define TMR_TRIGGED 4 void timerReset(uint8_t idx); void flightReset();