feat(v16): add CI1302 voice control (VGR/VFL, motion control, menu navigation) (#7501)
Co-authored-by: Peter Feerick <5500713+pfeerick@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Peter Feerick
Claude Sonnet 5
parent
f364c6ef63
commit
4aa9a258ee
@@ -135,7 +135,8 @@ void BoardJson::afterLoadFixups(Board::Type board, InputsTable * inputs, Switche
|
||||
}
|
||||
|
||||
// Flex switches are not listed in json file for these radios
|
||||
int count = IS_RADIOMASTER_TX16S(board) || IS_RADIOMASTER_MT12(board) ? 2 : 0;
|
||||
int count = IS_RADIOMASTER_TX16S(board) || IS_RADIOMASTER_MT12(board) ||
|
||||
IS_HELLORADIOSKY_V16(board) ? 2 : 0;
|
||||
|
||||
for (int i = 1; i <= count; i++) {
|
||||
QString tag = QString("FL%1").arg(i);
|
||||
@@ -146,6 +147,26 @@ void BoardJson::afterLoadFixups(Board::Type board, InputsTable * inputs, Switche
|
||||
switches->insert(switches->end(), defn);
|
||||
}
|
||||
}
|
||||
|
||||
// CI1302 voice control virtual switches are not listed in json file
|
||||
// They must follow the flex switches above: firmware indexes them at
|
||||
// switchGetMaxSwitches() + MAX_FLEX_SWITCHES
|
||||
// VGR (voice gear) is a 2POS switch, VFL (voice flap) is 3POS -- see
|
||||
// isTwoPosVoiceSwitch() in radio/src/drivers/CI1302.cpp
|
||||
if (IS_HELLORADIOSKY_V16(board)) {
|
||||
for (const auto &sw : {std::make_pair(QStringLiteral("VGR"), Board::SWITCH_2POS),
|
||||
std::make_pair(QStringLiteral("VFL"), Board::SWITCH_3POS)}) {
|
||||
const QString &tag = sw.first;
|
||||
if (getSwitchIndex(switches, tag, Board::LVT_TAG) < 0) {
|
||||
SwitchDefn defn;
|
||||
defn.tag = tag.toStdString();
|
||||
defn.name = defn.tag;
|
||||
defn.type = sw.second;
|
||||
defn.dflt = sw.second;
|
||||
switches->insert(switches->end(), defn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// called from Boards::getCapability if no capability match
|
||||
|
||||
Reference in New Issue
Block a user