3djc/2.4 add 2.3 pr (#8099)
This commit is contained in:
+49
-35
@@ -48,6 +48,11 @@ void checkTrainerSignalWarning()
|
||||
}
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
void stopTrainer()
|
||||
{
|
||||
stop_trainer_capture();
|
||||
}
|
||||
|
||||
void checkTrainerSettings()
|
||||
{
|
||||
uint8_t requiredTrainerMode = SLAVE_MODE();
|
||||
@@ -55,50 +60,59 @@ void checkTrainerSettings()
|
||||
if (requiredTrainerMode != currentTrainerMode) {
|
||||
currentTrainerMode = requiredTrainerMode;
|
||||
if (requiredTrainerMode)
|
||||
stop_trainer_capture();
|
||||
stopTrainer();
|
||||
else
|
||||
init_trainer_capture();
|
||||
}
|
||||
}
|
||||
#else
|
||||
void stopTrainer()
|
||||
{
|
||||
switch (currentTrainerMode) {
|
||||
case TRAINER_MODE_MASTER_TRAINER_JACK:
|
||||
stop_trainer_capture();
|
||||
break;
|
||||
|
||||
case TRAINER_MODE_SLAVE:
|
||||
stop_trainer_ppm();
|
||||
break;
|
||||
|
||||
#if defined(TRAINER_MODULE_CPPM)
|
||||
case TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE:
|
||||
stop_trainer_module_cppm();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(TRAINER_MODULE_SBUS)
|
||||
case TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE:
|
||||
stop_trainer_module_sbus();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(TRAINER_BATTERY_COMPARTMENT)
|
||||
case TRAINER_MODE_MASTER_BATTERY_COMPARTMENT:
|
||||
#if defined(AUX_SERIAL)
|
||||
if (g_eeGeneral.auxSerialMode == UART_MODE_SBUS_TRAINER)
|
||||
auxSerialStop();
|
||||
#endif
|
||||
#if defined(AUX2_SERIAL)
|
||||
if (g_eeGeneral.aux2SerialMode == UART_MODE_SBUS_TRAINER)
|
||||
aux2SerialStop();
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
currentTrainerMode = 0xFF;
|
||||
}
|
||||
|
||||
void checkTrainerSettings()
|
||||
{
|
||||
uint8_t requiredTrainerMode = g_model.trainerData.mode;
|
||||
|
||||
if (requiredTrainerMode != currentTrainerMode) {
|
||||
switch (currentTrainerMode) {
|
||||
case TRAINER_MODE_MASTER_TRAINER_JACK:
|
||||
stop_trainer_capture();
|
||||
break;
|
||||
|
||||
case TRAINER_MODE_SLAVE:
|
||||
stop_trainer_ppm();
|
||||
break;
|
||||
|
||||
#if defined(TRAINER_MODULE_CPPM)
|
||||
case TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE:
|
||||
stop_trainer_module_cppm();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(TRAINER_MODULE_SBUS)
|
||||
case TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE:
|
||||
stop_trainer_module_sbus();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_TRAINER_AUX_SERIAL)
|
||||
case TRAINER_MODE_MASTER_BATTERY_COMPARTMENT:
|
||||
#if defined(AUX_SERIAL)
|
||||
if (g_eeGeneral.auxSerialMode == UART_MODE_SBUS_TRAINER)
|
||||
auxSerialStop();
|
||||
#endif
|
||||
#if defined(AUX2_SERIAL)
|
||||
if (g_eeGeneral.aux2SerialMode == UART_MODE_SBUS_TRAINER)
|
||||
aux2SerialStop();
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
if (currentTrainerMode != 0xFF) {
|
||||
stopTrainer();
|
||||
}
|
||||
|
||||
currentTrainerMode = requiredTrainerMode;
|
||||
@@ -120,7 +134,7 @@ void checkTrainerSettings()
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_TRAINER_AUX_SERIAL)
|
||||
#if defined(TRAINER_BATTERY_COMPARTMENT)
|
||||
case TRAINER_MODE_MASTER_BATTERY_COMPARTMENT:
|
||||
#if defined(AUX_SERIAL)
|
||||
if (g_eeGeneral.auxSerialMode == UART_MODE_SBUS_TRAINER)
|
||||
|
||||
Reference in New Issue
Block a user