mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-23 00:05:13 +03:00
Prevent conflict with trainer on external module (#6846)
Prevent conflict with trainer on external module
This commit is contained in:
parent
7a0a6a9341
commit
ab385d1bdb
2 changed files with 11 additions and 1 deletions
|
@ -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) {
|
||||
|
@ -644,7 +653,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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue