fix(cpn): custom switches in switch and function lists (#7100)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user