1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 01:35:21 +03:00

Edge detection only on "Reset Flight", commit 6bc6e074e1 introduced unnecessary change in behavior for Reset Timer (fix #5036)

This commit is contained in:
Andre Bernet 2017-06-25 17:40:54 +02:00
parent fb1098c16e
commit a587f8b825

View file

@ -330,46 +330,46 @@ void evalFunctions()
break; break;
case FUNC_RESET: case FUNC_RESET:
if (!(functionsContext.activeSwitches & switch_mask)) { switch (CFN_PARAM(cfn)) {
switch (CFN_PARAM(cfn)) { case FUNC_RESET_TIMER1:
case FUNC_RESET_TIMER1: case FUNC_RESET_TIMER2:
case FUNC_RESET_TIMER2:
#if defined(CPUARM) #if defined(CPUARM)
case FUNC_RESET_TIMER3: case FUNC_RESET_TIMER3:
#endif #endif
timerReset(CFN_PARAM(cfn)); timerReset(CFN_PARAM(cfn));
break; break;
case FUNC_RESET_FLIGHT: case FUNC_RESET_FLIGHT:
if (!(functionsContext.activeSwitches & switch_mask)) {
#if defined(CPUARM) #if defined(CPUARM)
mainRequestFlags |= (1 << REQUEST_FLIGHT_RESET); // on systems with threads flightReset() must not be called from the mixers thread! mainRequestFlags |= (1 << REQUEST_FLIGHT_RESET); // on systems with threads flightReset() must not be called from the mixers thread!
#else #else
flightReset(); flightReset();
#endif // defined(CPUARM) #endif // defined(CPUARM)
break; }
break;
#if defined(TELEMETRY_FRSKY) #if defined(TELEMETRY_FRSKY)
case FUNC_RESET_TELEMETRY: case FUNC_RESET_TELEMETRY:
telemetryReset(); telemetryReset();
break; break;
#endif #endif
#if ROTARY_ENCODERS > 0 #if ROTARY_ENCODERS > 0
case FUNC_RESET_ROTENC1: case FUNC_RESET_ROTENC1:
#if ROTARY_ENCODERS > 1 #if ROTARY_ENCODERS > 1
case FUNC_RESET_ROTENC2: case FUNC_RESET_ROTENC2:
#endif #endif
rotencValue[CFN_PARAM(cfn)-FUNC_RESET_ROTENC1] = 0; rotencValue[CFN_PARAM(cfn)-FUNC_RESET_ROTENC1] = 0;
break; break;
#endif
}
#if defined(CPUARM)
if (CFN_PARAM(cfn)>=FUNC_RESET_PARAM_FIRST_TELEM) {
uint8_t item = CFN_PARAM(cfn)-FUNC_RESET_PARAM_FIRST_TELEM;
if (item < MAX_TELEMETRY_SENSORS) {
telemetryItems[item].clear();
}
}
#endif #endif
} }
#if defined(CPUARM)
if (CFN_PARAM(cfn)>=FUNC_RESET_PARAM_FIRST_TELEM) {
uint8_t item = CFN_PARAM(cfn)-FUNC_RESET_PARAM_FIRST_TELEM;
if (item < MAX_TELEMETRY_SENSORS) {
telemetryItems[item].clear();
}
}
#endif
break; break;
#if defined(CPUARM) #if defined(CPUARM)