Issue #813 - S3 skipped when not available

This commit is contained in:
bsongis
2014-03-20 12:56:14 +01:00
parent 05e2c8bdf3
commit e3fb62b33e
5 changed files with 28 additions and 2 deletions
+1 -1
View File
@@ -1134,7 +1134,7 @@ void menuModelSetup(uint8_t event)
case ITEM_MODEL_THROTTLE_TRACE:
{
lcd_putsLeft(y, STR_TTRACE);
if (attr) CHECK_INCDEC_MODELVAR_ZERO(event, g_model.thrTraceSrc, NUM_POTS+NUM_CHNOUT);
if (attr) CHECK_INCDEC_MODELVAR_ZERO_CHECK(event, g_model.thrTraceSrc, NUM_POTS+NUM_CHNOUT, isThrottleSourceAvailable);
uint8_t idx = g_model.thrTraceSrc + MIXSRC_Thr;
if (idx > MIXSRC_Thr)
idx += 1;
+9
View File
@@ -1473,6 +1473,15 @@ bool isSwitchAvailable(int swtch)
return true;
}
bool isThrottleSourceAvailable(int source)
{
#if defined(PCBTARANIS)
if (source == THROTTLE_SOURCE_S3 && !IS_POT_AVAILABLE(POT3))
return false;
#endif
return true;
}
bool isLogicalSwitchFunctionAvailable(int function)
{
return function != LS_FUNC_RANGE;
+1
View File
@@ -202,6 +202,7 @@ int8_t checkIncDecGen(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max);
#endif
#if defined(CPUARM)
bool isThrottleSourceAvailable(int source);
bool isLogicalSwitchFunctionAvailable(int function);
bool isAssignableFunctionAvailable(int function);
bool isSwitchAvailable(int swtch);