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:
parent
8cf59887f7
commit
5a317d7ba8
2 changed files with 11 additions and 1 deletions
|
@ -536,6 +536,15 @@ bool isPxx2IsrmChannelsCountAllowed(int channels)
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
bool isModuleUsingSport(uint8_t moduleBay, uint8_t moduleType)
|
||||||
{
|
{
|
||||||
switch (moduleType) {
|
switch (moduleType) {
|
||||||
|
@ -647,7 +656,7 @@ bool isExternalModuleAvailable(int moduleType)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HARDWARE_INTERNAL_MODULE)
|
#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;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ bool isSwitchAvailableInTimers(int swtch);
|
||||||
bool isR9MModeAvailable(int mode);
|
bool isR9MModeAvailable(int mode);
|
||||||
bool isPxx2IsrmChannelsCountAllowed(int channels);
|
bool isPxx2IsrmChannelsCountAllowed(int channels);
|
||||||
bool isModuleUsingSport(uint8_t moduleBay, uint8_t moduleType);
|
bool isModuleUsingSport(uint8_t moduleBay, uint8_t moduleType);
|
||||||
|
bool isTrainerUsingModuleBay();
|
||||||
bool isExternalModuleAvailable(int moduleType);
|
bool isExternalModuleAvailable(int moduleType);
|
||||||
bool isInternalModuleAvailable(int moduleType);
|
bool isInternalModuleAvailable(int moduleType);
|
||||||
bool isRfProtocolAvailable(int protocol);
|
bool isRfProtocolAvailable(int protocol);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue