fix(cpn): custom switches in switch and function lists (#7100)

This commit is contained in:
Neil Horne
2026-02-16 11:25:58 +10:00
committed by GitHub
parent 5e51969fff
commit 142911f532
2 changed files with 3 additions and 2 deletions
@@ -254,7 +254,8 @@ bool CustomFunctionData::isFuncAvailable(const int index, const ModelData * mode
((index == FuncDisableAudioAmp && !Boards::getCapability(fw->getBoard(), Board::HasAudioMuteGPIO))) ||
((index == FuncRGBLed && !(Boards::getCapability(fw->getBoard(), Board::HasBlingLEDS) || Boards::getCapability(fw->getBoard(), Board::FunctionSwitchColors)))) ||
((index == FuncLCDtoVideo && !IS_FATFISH_F16(fw->getBoard()))) ||
((index >= FuncPushCustomSwitch1 && index <= FuncPushCustomSwitchLast) && !Boards::getCapability(fw->getBoard(), Board::FunctionSwitches))
((index >= FuncPushCustomSwitch1 && index <= FuncPushCustomSwitchLast) &&
!Boards::isSwitchFunc(Boards::getSwitchIndexForCFSOffset(index - FuncPushCustomSwitch1)))
);
return !ret;
}
+1 -1
View File
@@ -545,7 +545,7 @@ bool ModelData::isFunctionSwitchPositionAvailable(int swIndex, int swPos, const
if (fs == Board::SWITCH_GLOBAL)
return gs->switchConfig[swIndex].type != Board::SWITCH_NOT_AVAILABLE;
return true;
return fs != Board::SWITCH_NOT_AVAILABLE;
}
bool ModelData::isFunctionSwitchSourceAllowed(int index) const