Merge pull request #1019 from opentx/bsongis/Issue1007

Fixes #1007
This commit is contained in:
Andre Bernet
2014-04-28 22:39:38 +02:00
2 changed files with 18 additions and 4 deletions
+9 -3
View File
@@ -826,10 +826,16 @@ enum Functions {
#define IS_ADJUST_GV_FUNC(func) (0) #define IS_ADJUST_GV_FUNC(func) (0)
#endif #endif
#if defined(VOICE) #if defined(HAPTIC)
#define HAS_REPEAT_PARAM(func) (func == FUNC_PLAY_SOUND || (func >= FUNC_PLAY_TRACK && func <= FUNC_PLAY_VALUE)) #define IS_HAPTIC_FUNC(func) (func == FUNC_HAPTIC)
#else #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 #endif
enum ResetFunctionParam { enum ResetFunctionParam {
+9 -1
View File
@@ -3564,6 +3564,9 @@ void evalFunctions()
case FUNC_PLAY_SOUND: case FUNC_PLAY_SOUND:
case FUNC_PLAY_TRACK: case FUNC_PLAY_TRACK:
case FUNC_PLAY_VALUE: case FUNC_PLAY_VALUE:
#if defined(HAPTIC)
case FUNC_HAPTIC:
#endif
{ {
tmr10ms_t tmr10ms = get_tmr10ms(); tmr10ms_t tmr10ms = get_tmr10ms();
uint8_t repeatParam = CFN_PLAY_REPEAT(sd); uint8_t repeatParam = CFN_PLAY_REPEAT(sd);
@@ -3578,6 +3581,11 @@ void evalFunctions()
else if (CFN_FUNC(sd) == FUNC_PLAY_VALUE) { else if (CFN_FUNC(sd) == FUNC_PLAY_VALUE) {
PLAY_VALUE(CFN_PARAM(sd), i+1); 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 { else {
playCustomFunctionFile(sd, i+1); playCustomFunctionFile(sd, i+1);
} }
@@ -3643,7 +3651,7 @@ void evalFunctions()
break; break;
#endif #endif
#if defined(HAPTIC) #if defined(HAPTIC) && !defined(CPUARM)
case FUNC_HAPTIC: case FUNC_HAPTIC:
haptic.event(AU_FRSKY_LAST+CFN_PARAM(sd)); haptic.event(AU_FRSKY_LAST+CFN_PARAM(sd));
break; break;