@@ -372,7 +372,7 @@ bool menuRadioHardware(event_t event)
|
||||
#if defined(RADIO_TX16S)
|
||||
lcdDrawText(lcdNextPos, y, " (TTL)");
|
||||
#endif
|
||||
g_eeGeneral.auxSerialMode = editChoice(HW_SETTINGS_COLUMN2, y, STR_AUX_SERIAL_MODES, g_eeGeneral.auxSerialMode, 0, UART_MODE_MAX, attr, event);
|
||||
g_eeGeneral.auxSerialMode = editChoice(HW_SETTINGS_COLUMN2, y, STR_AUX_SERIAL_MODES, g_eeGeneral.auxSerialMode, 0, UART_MODE_MAX, attr, event, isAux1ModeAvailable);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
auxSerialInit(g_eeGeneral.auxSerialMode, modelTelemetryProtocol());
|
||||
}
|
||||
@@ -385,7 +385,7 @@ bool menuRadioHardware(event_t event)
|
||||
#if defined(RADIO_TX16S)
|
||||
lcdDrawText(lcdNextPos, y, " (TTL)");
|
||||
#endif
|
||||
g_eeGeneral.aux2SerialMode = editChoice(HW_SETTINGS_COLUMN2, y, STR_AUX_SERIAL_MODES, g_eeGeneral.aux2SerialMode, 0, UART_MODE_MAX, attr, event);
|
||||
g_eeGeneral.aux2SerialMode = editChoice(HW_SETTINGS_COLUMN2, y, STR_AUX_SERIAL_MODES, g_eeGeneral.aux2SerialMode, 0, UART_MODE_MAX, attr, event, isAux2ModeAvailable);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
aux2SerialInit(g_eeGeneral.aux2SerialMode, modelTelemetryProtocol());
|
||||
}
|
||||
|
||||
@@ -385,6 +385,24 @@ bool isSwitchAvailable(int swtch, SwitchContext context)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isAux1ModeAvailable(int mode)
|
||||
{
|
||||
#if defined(AUX2_SERIAL)
|
||||
if (mode == UART_MODE_SBUS_TRAINER)
|
||||
return g_eeGeneral.aux2SerialMode != UART_MODE_SBUS_TRAINER;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isAux2ModeAvailable(int mode)
|
||||
{
|
||||
#if defined(AUX_SERIAL)
|
||||
if (mode == UART_MODE_SBUS_TRAINER)
|
||||
return g_eeGeneral.auxSerialMode != UART_MODE_SBUS_TRAINER;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isSwitchAvailableInLogicalSwitches(int swtch)
|
||||
{
|
||||
return isSwitchAvailable(swtch, LogicalSwitchesContext);
|
||||
|
||||
@@ -70,6 +70,8 @@ bool isSourceAvailableInGlobalFunctions(int source);
|
||||
bool isSourceAvailableInCustomSwitches(int source);
|
||||
bool isSourceAvailableInResetSpecialFunction(int index);
|
||||
bool isSourceAvailableInGlobalResetSpecialFunction(int index);
|
||||
bool isAux1ModeAvailable(int mode);
|
||||
bool isAux2ModeAvailable(int mode);
|
||||
bool isSwitchAvailableInLogicalSwitches(int swtch);
|
||||
bool isSwitchAvailableInCustomFunctions(int swtch);
|
||||
bool isSwitchAvailableInMixes(int swtch);
|
||||
|
||||
Reference in New Issue
Block a user