feat(radio): refactor of switch handling to better support customisable switches (#6095)

Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
philmoz
2025-07-28 12:59:22 +10:00
committed by GitHub
co-authored by philmoz 3djc elecpower
parent 28833f42e6
commit 0c8c39b134
155 changed files with 4538 additions and 2306 deletions
@@ -170,6 +170,11 @@ bool GeneralSettings::isSwitchFlex(int index) const
return Boards::isSwitchFlex(index);
}
bool GeneralSettings::isSwitchFunc(int index) const
{
return Boards::isSwitchFunc(index);
}
bool GeneralSettings::unassignedInputFlexSwitches() const
{
Board::Type board = getCurrentBoard();
@@ -372,6 +377,10 @@ void GeneralSettings::setDefaultControlTypes(Board::Type board)
switchConfig[i].type = info.dflt;
switchConfig[i].inverted = info.inverted;
switchConfig[i].inputIdx = SWITCH_INPUTINDEX_NONE;
if (Boards::isSwitchFunc(i)) {
switchConfig[i].start = ModelData::FUNC_SWITCH_START_PREVIOUS;
switchConfig[i].onColor.setColor(255, 255, 255);
}
}
for (uint8_t i = 0; i < 4; i++) {