diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index e95da27d9..60635602b 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -826,10 +826,16 @@ enum Functions { #define IS_ADJUST_GV_FUNC(func) (0) #endif -#if defined(VOICE) - #define HAS_REPEAT_PARAM(func) (func == FUNC_PLAY_SOUND || (func >= FUNC_PLAY_TRACK && func <= FUNC_PLAY_VALUE)) +#if defined(HAPTIC) + #define IS_HAPTIC_FUNC(func) (func == FUNC_HAPTIC) #else - #define HAS_REPEAT_PARAM(func) (func == FUNC_PLAY_SOUND) + #define IS_HAPTIC_FUNC(func) (0) +#endif + +#if defined(VOICE) + #define HAS_REPEAT_PARAM(func) (func == FUNC_PLAY_SOUND || (func >= FUNC_PLAY_TRACK && func <= FUNC_PLAY_VALUE) || IS_HAPTIC_FUNC(func)) +#else + #define HAS_REPEAT_PARAM(func) (func == FUNC_PLAY_SOUND || IS_HAPTIC_FUNC(func)) #endif enum ResetFunctionParam { diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 685c74ceb..fe8dd65ce 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -3564,6 +3564,9 @@ void evalFunctions() case FUNC_PLAY_SOUND: case FUNC_PLAY_TRACK: case FUNC_PLAY_VALUE: +#if defined(HAPTIC) + case FUNC_HAPTIC: +#endif { tmr10ms_t tmr10ms = get_tmr10ms(); uint8_t repeatParam = CFN_PLAY_REPEAT(sd); @@ -3578,6 +3581,11 @@ void evalFunctions() else if (CFN_FUNC(sd) == FUNC_PLAY_VALUE) { PLAY_VALUE(CFN_PARAM(sd), i+1); } +#if defined(HAPTIC) + else if (CFN_FUNC(sd) == FUNC_HAPTIC) { + haptic.event(AU_FRSKY_LAST+CFN_PARAM(sd)); + } +#endif else { playCustomFunctionFile(sd, i+1); } @@ -3643,7 +3651,7 @@ void evalFunctions() break; #endif -#if defined(HAPTIC) +#if defined(HAPTIC) && !defined(CPUARM) case FUNC_HAPTIC: haptic.event(AU_FRSKY_LAST+CFN_PARAM(sd)); break;