Skip to content

Commit

Permalink
Disable Backpack Telemetry lua item if backpack disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
CapnBry committed Oct 2, 2023
1 parent 0bc0fa3 commit ee91f3a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/lib/LUA/tx_devLUA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ static const char luastrDvrAux[] = "Off;" STR_LUA_ALLAUX_UPDOWN;
static const char luastrDvrDelay[] = "0s;5s;15s;30s;45s;1min;2min";
static const char luastrHeadTrackingEnable[] = "Off;On;" STR_LUA_ALLAUX_UPDOWN;
static const char luastrHeadTrackingStart[] = STR_LUA_ALLAUX;
static const char luastrOffOn[] = "Off;On";

static const char luastrDisabled[] = "Disabled";

Expand Down Expand Up @@ -104,7 +105,7 @@ static struct luaItem_selection luaSwitch = {
static struct luaItem_selection luaModelMatch = {
{"Model Match", CRSF_TEXT_SELECTION},
0, // value
"Off;On",
luastrOffOn,
modelMatchUnit
};

Expand Down Expand Up @@ -209,7 +210,7 @@ static struct luaItem_command luaVtxSend = {
struct luaItem_selection luaBluetoothTelem = {
{"BT Telemetry", CRSF_TEXT_SELECTION},
0, // value
"Off;On",
luastrOffOn,
STR_EMPTYSPACE
};
#endif
Expand All @@ -223,7 +224,7 @@ static struct luaItem_folder luaBackpackFolder = {
static struct luaItem_selection luaBackpackEnable = {
{"Backpack", CRSF_TEXT_SELECTION},
0, // value
"Off;On",
luastrOffOn,
STR_EMPTYSPACE};
#endif

Expand Down Expand Up @@ -260,7 +261,7 @@ static struct luaItem_selection luaHeadTrackingStartChannel = {
static struct luaItem_selection luaBackpackTelemetry = {
{"Telemetry", CRSF_TEXT_SELECTION},
0, // value
"Off;On",
luastrOffOn,
STR_EMPTYSPACE};

static struct luaItem_string luaBackpackVersion = {
Expand Down Expand Up @@ -347,6 +348,7 @@ static void luadevUpdateBackpackOpts()
luaDvrStopDelay.options = luastrDisabled;
luaHeadTrackingEnableChannel.options = luastrDisabled;
luaHeadTrackingStartChannel.options = luastrDisabled;
luaBackpackTelemetry.options = luastrDisabled;
}
else
{
Expand All @@ -355,6 +357,7 @@ static void luadevUpdateBackpackOpts()
luaDvrStopDelay.options = luastrDvrDelay;
luaHeadTrackingEnableChannel.options = luastrHeadTrackingEnable;
luaHeadTrackingStartChannel.options = luastrHeadTrackingStart;
luaBackpackTelemetry.options = luastrOffOn;
}
}

Expand Down

0 comments on commit ee91f3a

Please sign in to comment.