1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-23 08:15:13 +03:00

Companion UI support

This commit is contained in:
Andre Bernet 2015-03-28 11:42:45 +04:00
parent 19ff2d6f39
commit 930fd7443e
9 changed files with 37 additions and 27 deletions

View file

@ -995,14 +995,7 @@ void LimitData::clear()
GeneralSettings::SwitchInfo GeneralSettings::switchInfoFromSwitchPositionTaranis(unsigned int index)
{
if (index <= 3*5)
return SwitchInfo((index-1)/3, (index-1)%3);
else if (index <= 17)
return SwitchInfo(5, index==17 ? 2 : 0);
else if (index <= 20)
return SwitchInfo(6, index-18);
else
return SwitchInfo(7+(index-21)/2, 2*((index-21)%2));
return SwitchInfo((index-1)/3, (index-1)%3);
}
bool GeneralSettings::switchPositionAllowedTaranis(int index) const
@ -1015,7 +1008,12 @@ bool GeneralSettings::switchPositionAllowedTaranis(int index) const
else if (info.position == 1)
return switchConfig[info.index] == SWITCH_3POS;
else
return true;
return switchConfig[info.index] != SWITCH_NONE;
}
bool GeneralSettings::switchSourceAllowedTaranis(int index) const
{
return switchConfig[index] != SWITCH_NONE;
}
GeneralSettings::GeneralSettings()