Prevent selection of impossible switch type in radio hardware (#8083)

* Prevent selection of impossible switch type in radio hardware
This commit is contained in:
3djc
2020-11-14 14:59:12 +01:00
committed by GitHub
parent 27e19552c6
commit d9d58d637b
3 changed files with 38 additions and 12 deletions
+17 -1
View File
@@ -231,7 +231,23 @@ SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
if (index < DIM(switches))
return switches[index];
}
else if (IS_HORUS_OR_TARANIS(board)) {
else if (IS_FAMILY_HORUS_OR_T16(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_3POS, "SC"},
{SWITCH_3POS, "SD"},
{SWITCH_3POS, "SE"},
{SWITCH_2POS, "SF"},
{SWITCH_3POS, "SG"},
{SWITCH_TOGGLE, "SH"},
{SWITCH_2POS, "SI"},
{SWITCH_2POS, "SJ"}
};
if (index < DIM(switches))
return switches[index];
}
else if (IS_TARANIS(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
{SWITCH_3POS, "SB"},