1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-21 15:25:12 +03:00

Prevent conflict with trainer on external module (#6846)

Prevent conflict with trainer on external module
This commit is contained in:
3djc 2019-10-01 15:01:21 +02:00 committed by Bertrand Songis
parent 8cf59887f7
commit 5a317d7ba8
2 changed files with 11 additions and 1 deletions

View file

@ -536,6 +536,15 @@ bool isPxx2IsrmChannelsCountAllowed(int channels)
}
#endif
bool isTrainerUsingModuleBay()
{
#if defined(PCBTARANIS)
if (TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE <= g_model.trainerData.mode && g_model.trainerData.mode <= TRAINER_MODE_MASTER_BATTERY_COMPARTMENT)
return true;
#endif
return false;
}
bool isModuleUsingSport(uint8_t moduleBay, uint8_t moduleType)
{
switch (moduleType) {
@ -647,7 +656,7 @@ bool isExternalModuleAvailable(int moduleType)
#endif
#if defined(HARDWARE_INTERNAL_MODULE)
if (isModuleUsingSport(EXTERNAL_MODULE, moduleType) && isModuleUsingSport(INTERNAL_MODULE, g_model.moduleData[INTERNAL_MODULE].type))
if ((isModuleUsingSport(EXTERNAL_MODULE, moduleType) || isTrainerUsingModuleBay()) && isModuleUsingSport(INTERNAL_MODULE, g_model.moduleData[INTERNAL_MODULE].type))
return false;
#endif

View file

@ -62,6 +62,7 @@ bool isSwitchAvailableInTimers(int swtch);
bool isR9MModeAvailable(int mode);
bool isPxx2IsrmChannelsCountAllowed(int channels);
bool isModuleUsingSport(uint8_t moduleBay, uint8_t moduleType);
bool isTrainerUsingModuleBay();
bool isExternalModuleAvailable(int moduleType);
bool isInternalModuleAvailable(int moduleType);
bool isRfProtocolAvailable(int protocol);