It was possible to reset Timer3 in custom functions even if Timer3

unavailable
This commit is contained in:
bsongis
2015-07-09 22:17:55 +02:00
parent d0bee7d666
commit ef21053b3d
5 changed files with 24 additions and 11 deletions
+21
View File
@@ -343,6 +343,27 @@ bool isAssignableFunctionAvailable(int function)
}
}
bool isAvailableInResetSpecialFunction(int index)
{
if (index >= FUNC_RESET_PARAM_FIRST_TELEM) {
TelemetrySensor & telemetrySensor = g_model.telemetrySensors[index-FUNC_RESET_PARAM_FIRST_TELEM];
return telemetrySensor.isAvailable();
}
#if TIMERS < 3
else if (index == FUNC_RESET_TIMER3) {
return false;
}
#endif
#if TIMERS < 2
else if (index == FUNC_RESET_TIMER2) {
return false;
}
#endif
else {
return true;
}
}
bool isModuleAvailable(int module)
{
return true;