[Taranis] Trainer master / slave toggled
This commit is contained in:
+18
-1
@@ -3590,6 +3590,23 @@ void perMain()
|
|||||||
telemetryWakeup();
|
telemetryWakeup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
uint8_t requiredTrainerMode = g_model.trainerMode;
|
||||||
|
if (requiredTrainerMode != currentTrainerMode) {
|
||||||
|
currentTrainerMode = requiredTrainerMode;
|
||||||
|
if (requiredTrainerMode) {
|
||||||
|
// slave
|
||||||
|
stop_trainer_capture();
|
||||||
|
init_trainer_ppm();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// master
|
||||||
|
stop_trainer_ppm();
|
||||||
|
init_trainer_capture();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
lcd_clear();
|
lcd_clear();
|
||||||
const char *warn = s_warning;
|
const char *warn = s_warning;
|
||||||
uint8_t menu = s_menu_count;
|
uint8_t menu = s_menu_count;
|
||||||
@@ -4163,7 +4180,7 @@ void mixerTask(void * pdata)
|
|||||||
uint8_t heartbeatCheck = HEART_TIMER_10MS;
|
uint8_t heartbeatCheck = HEART_TIMER_10MS;
|
||||||
#if defined(PCBTARANIS)
|
#if defined(PCBTARANIS)
|
||||||
if (g_model.moduleData[0].rfProtocol != RF_PROTO_OFF)
|
if (g_model.moduleData[0].rfProtocol != RF_PROTO_OFF)
|
||||||
heartbeatCheck |= HEART_TIMER_PULSES;
|
heartbeatCheck |= HEART_TIMER_PULSES << 0;
|
||||||
if (g_model.externalModule != MODULE_TYPE_NONE)
|
if (g_model.externalModule != MODULE_TYPE_NONE)
|
||||||
heartbeatCheck |= HEART_TIMER_PULSES << 1;
|
heartbeatCheck |= HEART_TIMER_PULSES << 1;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -183,4 +183,6 @@ void eeWriteBlockCmp(const void *pointer_ram, uint16_t pointer_eeprom, size_t si
|
|||||||
#endif
|
#endif
|
||||||
#define EEPROM_MASSSTORAGE() (usb_connected)
|
#define EEPROM_MASSSTORAGE() (usb_connected)
|
||||||
|
|
||||||
|
extern uint8_t currentTrainerMode;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ uint16_t TrainerPpmStream[20] =
|
|||||||
0,0,0,0,0,0,0,0,0,0,0
|
0,0,0,0,0,0,0,0,0,0,0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
uint8_t currentTrainerMode;
|
||||||
uint16_t * TrainerPulsePtr;
|
uint16_t * TrainerPulsePtr;
|
||||||
|
|
||||||
// TODO remove duplicated code
|
// TODO remove duplicated code
|
||||||
|
|||||||
Reference in New Issue
Block a user