From 5173907efd87bbd2055aa1f7a8bee801276d9cc5 Mon Sep 17 00:00:00 2001 From: bsongis Date: Thu, 18 Sep 2014 08:33:40 +0200 Subject: [PATCH] Fixes #1727 --- radio/src/opentx.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index d2d0ebdf0..be454fa3e 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2114,8 +2114,15 @@ void evalFunctions() #if defined(HAPTIC) && !defined(CPUARM) case FUNC_HAPTIC: - haptic.event(AU_FRSKY_LAST+CFN_PARAM(sd)); + { + tmr10ms_t tmr10ms = get_tmr10ms(); + uint8_t repeatParam = CFN_PLAY_REPEAT(sd); + if (!lastFunctionTime[i] || (repeatParam && (signed)(tmr10ms-lastFunctionTime[i])>=1000*repeatParam)) { + lastFunctionTime[i] = tmr10ms; + haptic.event(AU_FRSKY_LAST+CFN_PARAM(sd)); + } break; + } #endif #if defined(SDCARD)