Companion support for EXT3 EXT4 and FlySky gimbals

This commit is contained in:
elecpower
2021-12-31 10:53:10 +01:00
committed by Raphael Coeffic
parent f6329895a8
commit 23c84633da
13 changed files with 51 additions and 22 deletions
+6 -2
View File
@@ -54,14 +54,18 @@ bool GeneralSettings::switchSourceAllowedTaranis(int index) const
bool GeneralSettings::isPotAvailable(int index) const
{
if (index < 0 || index > Boards::getCapability(getCurrentBoard(), Board::Pots))
int numPots = Boards::getCapability(getCurrentBoard(), Board::Pots);
if (getCurrentFirmware()->getCapability(HasFlySkyGimbals))
numPots -= 2;
if (index < 0 || index >= numPots)
return false;
return potConfig[index] != Board::POT_NONE;
}
bool GeneralSettings::isSliderAvailable(int index) const
{
if (index < 0 || index > Boards::getCapability(getCurrentBoard(), Board::Sliders))
if (index < 0 || index >= Boards::getCapability(getCurrentBoard(), Board::Sliders))
return false;
return sliderConfig[index] != Board::SLIDER_NONE;
}