3djc/enhance companion get capability (#4243)
* Add info on switches/sliders/pots setup when delivered from factory (other calls return user installed max possible) * Fix * getCapability() : Refine actoryInstalledSwitches, add NumTrimSwitches, remove FactoryInstalledPots & FactoryInstalledSliders; GeneralSettings() initialization : Use `FactoryInstalledSwitches` count instead of `Switches` for default setup, and also set up correct number of sliders for X9E (4) and X7 (0). * Enum order cosmetics. [ci skip]
This commit is contained in:
@@ -1093,31 +1093,36 @@ GeneralSettings::GeneralSettings()
|
||||
calibSpanPos[i] = 0x180;
|
||||
}
|
||||
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(Switches); i++) {
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(FactoryInstalledSwitches); i++) {
|
||||
switchConfig[i] = GetCurrentFirmware()->getSwitch(i).type;
|
||||
}
|
||||
|
||||
BoardEnum board = GetEepromInterface()->getBoard();
|
||||
if (board == BOARD_HORUS) {
|
||||
if (IS_HORUS(board)) {
|
||||
potConfig[0] = POT_WITH_DETENT;
|
||||
potConfig[1] = POT_MULTIPOS_SWITCH;
|
||||
potConfig[2] = POT_WITH_DETENT;
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
potConfig[0] = POT_WITH_DETENT;
|
||||
potConfig[1] = POT_WITH_DETENT;
|
||||
}
|
||||
else {
|
||||
potConfig[0] = POT_WITHOUT_DETENT;
|
||||
potConfig[1] = POT_WITHOUT_DETENT;
|
||||
potConfig[2] = POT_WITHOUT_DETENT;
|
||||
}
|
||||
|
||||
if (IS_HORUS(board) || IS_TARANIS_X9E(board)) {
|
||||
sliderConfig[0] = SLIDER_WITH_DETENT;
|
||||
sliderConfig[1] = SLIDER_WITH_DETENT;
|
||||
sliderConfig[2] = SLIDER_WITH_DETENT;
|
||||
sliderConfig[3] = SLIDER_WITH_DETENT;
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
potConfig[0] = POT_WITH_DETENT;
|
||||
potConfig[1] = POT_WITH_DETENT;
|
||||
else if (IS_TARANIS(board) && !IS_TARANIS_X7(board)) {
|
||||
sliderConfig[0] = SLIDER_WITH_DETENT;
|
||||
sliderConfig[1] = SLIDER_WITH_DETENT;
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<3; i++) {
|
||||
potConfig[i] = POT_WITHOUT_DETENT;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
speakerVolume = 12;
|
||||
|
||||
Reference in New Issue
Block a user