chore: Remove unused LS_FUNC_RANGE, TimersContext (#4267)

This commit is contained in:
philmoz
2023-11-10 16:35:00 +10:00
committed by GitHub
parent 6a4a101ef0
commit 5e97d1d59b
18 changed files with 4 additions and 44 deletions
@@ -81,7 +81,7 @@ void menuModelLogicalSwitchOne(event_t event)
lcdDrawTextAlignedLeft(y, STR_FUNC);
lcdDrawTextAtIndex(CSWONE_2ND_COLUMN, y, STR_VCSWFUNC, cs->func, attr);
if (attr) {
cs->func = checkIncDec(event, cs->func, 0, LS_FUNC_MAX, EE_MODEL, isLogicalSwitchFunctionAvailable);
cs->func = checkIncDec(event, cs->func, 0, LS_FUNC_MAX, EE_MODEL);
uint8_t new_cstate = lswFamily(cs->func);
if (cstate != new_cstate) {
if (new_cstate == LS_FAMILY_TIMER) {
@@ -207,7 +207,7 @@ void menuModelLogicalSwitches(event_t event)
switch (horz) {
case LS_FIELD_FUNCTION:
{
cs->func = checkIncDec(event, cs->func, 0, LS_FUNC_MAX, EE_MODEL, isLogicalSwitchFunctionAvailable);
cs->func = checkIncDec(event, cs->func, 0, LS_FUNC_MAX, EE_MODEL);
uint8_t new_cstate = lswFamily(cs->func);
if (cstate != new_cstate) {
unsigned int save_func = cs->func;
@@ -263,7 +263,6 @@ class LogicalSwitchEditPage : public Page
SET_DIRTY();
updateLogicalSwitchOneWindow();
});
functionChoice->setAvailableHandler(isLogicalSwitchFunctionAvailable);
logicalSwitchOneWindow = new FormWindow(window, rect_t{});
updateLogicalSwitchOneWindow();
-23
View File
@@ -522,24 +522,6 @@ bool isSwitch2POSWarningStateAvailable(int state)
}
#endif // #if defined(COLORLCD)
//bool isSwitchAvailableInTimers(int swtch)
//{
// if (swtch >= 0) {
// if (swtch < TMRMODE_COUNT)
// return true;
// else
// swtch -= TMRMODE_COUNT-1;
// }
// else {
// if (swtch > -TMRMODE_COUNT)
// return false;
// else
// swtch += TMRMODE_COUNT-1;
// }
//
// return isSwitchAvailable(swtch, TimersContext);
//}
bool isThrottleSourceAvailable(int src)
{
#if !defined(LIBOPENUI)
@@ -551,11 +533,6 @@ bool isThrottleSourceAvailable(int src)
((src >= MIXSRC_FIRST_CH) && (src <= MIXSRC_LAST_CH)));
}
bool isLogicalSwitchFunctionAvailable(int function)
{
return function != LS_FUNC_RANGE;
}
bool isAssignableFunctionAvailable(int function, CustomFunctionData * functions)
{
#if defined(OVERRIDE_CHANNEL_FUNCTION) || defined(GVARS)
-3
View File
@@ -64,7 +64,6 @@ enum SwitchContext
LogicalSwitchesContext,
ModelCustomFunctionsContext,
GeneralCustomFunctionsContext,
TimersContext,
MixesContext
};
@@ -74,7 +73,6 @@ int getFirstAvailable(int min, int max, IsValueAvailable isValueAvailable);
bool isInputAvailable(int input);
bool isSourceAvailableInInputs(int source);
bool isThrottleSourceAvailable(int source);
bool isLogicalSwitchFunctionAvailable(int function);
bool isLogicalSwitchAvailable(int index);
bool isAssignableFunctionAvailable(int function);
bool isSourceAvailable(int source);
@@ -89,7 +87,6 @@ int hasSerialMode(int mode);
bool isSwitchAvailableInLogicalSwitches(int swtch);
bool isSwitchAvailableInCustomFunctions(int swtch);
bool isSwitchAvailableInMixes(int swtch);
bool isSwitchAvailableInTimers(int swtch);
bool isPxx2IsrmChannelsCountAllowed(int channels);
bool isModuleUsingSport(uint8_t moduleBay, uint8_t moduleType);
bool isTrainerUsingModuleBay();