Skip to content

Commit

Permalink
chore: Remove unused LS_FUNC_RANGE, TimersContext (#4267)
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz authored Nov 10, 2023
1 parent 6a4a101 commit 5e97d1d
Show file tree
Hide file tree
Showing 18 changed files with 4 additions and 44 deletions.
5 changes: 2 additions & 3 deletions companion/src/firmwares/rawswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ class RawSwitch {
LogicalSwitchesContext = 0x01,
SpecialFunctionsContext = 0x02,
GlobalFunctionsContext = 0x04,
TimersContext = 0x08,
MixesContext = 0x10,
MixesContext = 0x08,

AllModelContexts = SpecialFunctionsContext | LogicalSwitchesContext | TimersContext | MixesContext,
AllModelContexts = SpecialFunctionsContext | LogicalSwitchesContext | MixesContext,
AllSwitchContexts = AllModelContexts | GlobalFunctionsContext
};

Expand Down
2 changes: 1 addition & 1 deletion radio/src/gui/128x64/model_logical_switches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion radio/src/gui/212x64/model_logical_switches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion radio/src/gui/colorlcd/model_logical_switches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ class LogicalSwitchEditPage : public Page
SET_DIRTY();
updateLogicalSwitchOneWindow();
});
functionChoice->setAvailableHandler(isLogicalSwitchFunctionAvailable);

logicalSwitchOneWindow = new FormWindow(window, rect_t{});
updateLogicalSwitchOneWindow();
Expand Down
23 changes: 0 additions & 23 deletions radio/src/gui/gui_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions radio/src/gui/gui_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ enum SwitchContext
LogicalSwitchesContext,
ModelCustomFunctionsContext,
GeneralCustomFunctionsContext,
TimersContext,
MixesContext
};

Expand All @@ -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);
Expand All @@ -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();
Expand Down
1 change: 0 additions & 1 deletion radio/src/lua/api_general.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3038,7 +3038,6 @@ LROT_BEGIN(etxcst, NULL, 0)
LROT_NUMENTRY( LS_FUNC_VALMOSTEQUAL, LS_FUNC_VALMOSTEQUAL )
LROT_NUMENTRY( LS_FUNC_VPOS, LS_FUNC_VPOS )
LROT_NUMENTRY( LS_FUNC_VNEG, LS_FUNC_VNEG )
LROT_NUMENTRY( LS_FUNC_RANGE, LS_FUNC_RANGE )
LROT_NUMENTRY( LS_FUNC_APOS, LS_FUNC_APOS )
LROT_NUMENTRY( LS_FUNC_ANEG, LS_FUNC_ANEG )
LROT_NUMENTRY( LS_FUNC_AND, LS_FUNC_AND )
Expand Down
1 change: 0 additions & 1 deletion radio/src/myeeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ enum LogicalSwitchesFunctions {
LS_FUNC_VALMOSTEQUAL, // v~=offset
LS_FUNC_VPOS, // v>offset
LS_FUNC_VNEG, // v<offset
LS_FUNC_RANGE,
LS_FUNC_APOS, // |v|>offset
LS_FUNC_ANEG, // |v|<offset
LS_FUNC_AND,
Expand Down
1 change: 0 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_128x64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
{ LS_FUNC_VPOS, "FUNC_VPOS" },
{ LS_FUNC_VNEG, "FUNC_VNEG" },
{ LS_FUNC_RANGE, "FUNC_RANGE" },
{ LS_FUNC_APOS, "FUNC_APOS" },
{ LS_FUNC_ANEG, "FUNC_ANEG" },
{ LS_FUNC_AND, "FUNC_AND" },
Expand Down
1 change: 0 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_nv14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
{ LS_FUNC_VPOS, "FUNC_VPOS" },
{ LS_FUNC_VNEG, "FUNC_VNEG" },
{ LS_FUNC_RANGE, "FUNC_RANGE" },
{ LS_FUNC_APOS, "FUNC_APOS" },
{ LS_FUNC_ANEG, "FUNC_ANEG" },
{ LS_FUNC_AND, "FUNC_AND" },
Expand Down
1 change: 0 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_t20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
{ LS_FUNC_VPOS, "FUNC_VPOS" },
{ LS_FUNC_VNEG, "FUNC_VNEG" },
{ LS_FUNC_RANGE, "FUNC_RANGE" },
{ LS_FUNC_APOS, "FUNC_APOS" },
{ LS_FUNC_ANEG, "FUNC_ANEG" },
{ LS_FUNC_AND, "FUNC_AND" },
Expand Down
1 change: 0 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_tpro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
{ LS_FUNC_VPOS, "FUNC_VPOS" },
{ LS_FUNC_VNEG, "FUNC_VNEG" },
{ LS_FUNC_RANGE, "FUNC_RANGE" },
{ LS_FUNC_APOS, "FUNC_APOS" },
{ LS_FUNC_ANEG, "FUNC_ANEG" },
{ LS_FUNC_AND, "FUNC_AND" },
Expand Down
1 change: 0 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_x10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
{ LS_FUNC_VPOS, "FUNC_VPOS" },
{ LS_FUNC_VNEG, "FUNC_VNEG" },
{ LS_FUNC_RANGE, "FUNC_RANGE" },
{ LS_FUNC_APOS, "FUNC_APOS" },
{ LS_FUNC_ANEG, "FUNC_ANEG" },
{ LS_FUNC_AND, "FUNC_AND" },
Expand Down
1 change: 0 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_x12s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
{ LS_FUNC_VPOS, "FUNC_VPOS" },
{ LS_FUNC_VNEG, "FUNC_VNEG" },
{ LS_FUNC_RANGE, "FUNC_RANGE" },
{ LS_FUNC_APOS, "FUNC_APOS" },
{ LS_FUNC_ANEG, "FUNC_ANEG" },
{ LS_FUNC_AND, "FUNC_AND" },
Expand Down
1 change: 0 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_x9d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
{ LS_FUNC_VPOS, "FUNC_VPOS" },
{ LS_FUNC_VNEG, "FUNC_VNEG" },
{ LS_FUNC_RANGE, "FUNC_RANGE" },
{ LS_FUNC_APOS, "FUNC_APOS" },
{ LS_FUNC_ANEG, "FUNC_ANEG" },
{ LS_FUNC_AND, "FUNC_AND" },
Expand Down
1 change: 0 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_x9e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
{ LS_FUNC_VPOS, "FUNC_VPOS" },
{ LS_FUNC_VNEG, "FUNC_VNEG" },
{ LS_FUNC_RANGE, "FUNC_RANGE" },
{ LS_FUNC_APOS, "FUNC_APOS" },
{ LS_FUNC_ANEG, "FUNC_ANEG" },
{ LS_FUNC_AND, "FUNC_AND" },
Expand Down
1 change: 0 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_x9lite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
{ LS_FUNC_VPOS, "FUNC_VPOS" },
{ LS_FUNC_VNEG, "FUNC_VNEG" },
{ LS_FUNC_RANGE, "FUNC_RANGE" },
{ LS_FUNC_APOS, "FUNC_APOS" },
{ LS_FUNC_ANEG, "FUNC_ANEG" },
{ LS_FUNC_AND, "FUNC_AND" },
Expand Down
1 change: 0 additions & 1 deletion radio/src/storage/yaml/yaml_datastructs_xlites.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ const struct YamlIdStr enum_LogicalSwitchesFunctions[] = {
{ LS_FUNC_VALMOSTEQUAL, "FUNC_VALMOSTEQUAL" },
{ LS_FUNC_VPOS, "FUNC_VPOS" },
{ LS_FUNC_VNEG, "FUNC_VNEG" },
{ LS_FUNC_RANGE, "FUNC_RANGE" },
{ LS_FUNC_APOS, "FUNC_APOS" },
{ LS_FUNC_ANEG, "FUNC_ANEG" },
{ LS_FUNC_AND, "FUNC_AND" },
Expand Down

0 comments on commit 5e97d1d

Please sign in to comment.