From 85bd9d16eae5549ae8263d6bb7ee2189a8d81695 Mon Sep 17 00:00:00 2001 From: jfrickmann Date: Mon, 6 Dec 2021 14:29:27 -0500 Subject: [PATCH] Added Lua constants for logical switch and special/custom functions --- radio/src/lua/api_general.cpp | 47 ++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/radio/src/lua/api_general.cpp b/radio/src/lua/api_general.cpp index 69f143d88..bd6843aa4 100644 --- a/radio/src/lua/api_general.cpp +++ b/radio/src/lua/api_general.cpp @@ -2151,7 +2151,52 @@ const luaR_value_entry opentxConstants[] = { { "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH }, { "SWITCH_COUNT", SWSRC_COUNT }, { "MAX_SENSORS", MAX_TELEMETRY_SENSORS }, + + { "LS_FUNC_NONE", LS_FUNC_NONE }, + { "LS_FUNC_VEQUAL", LS_FUNC_VEQUAL }, + { "LS_FUNC_VALMOSTEQUAL", LS_FUNC_VALMOSTEQUAL }, + { "LS_FUNC_VPOS", LS_FUNC_VPOS }, + { "LS_FUNC_VNEG", LS_FUNC_VNEG }, + { "LS_FUNC_RANGE", LS_FUNC_RANGE }, + { "LS_FUNC_APOS", LS_FUNC_APOS }, + { "LS_FUNC_ANEG", LS_FUNC_ANEG }, + { "LS_FUNC_AND", LS_FUNC_AND }, + { "LS_FUNC_OR", LS_FUNC_OR }, + { "LS_FUNC_XOR", LS_FUNC_XOR }, + { "LS_FUNC_EDGE", LS_FUNC_EDGE }, + { "LS_FUNC_EQUAL", LS_FUNC_EQUAL }, + { "LS_FUNC_GREATER", LS_FUNC_GREATER }, + { "LS_FUNC_LESS", LS_FUNC_LESS }, + { "LS_FUNC_DIFFEGREATER", LS_FUNC_DIFFEGREATER }, + { "LS_FUNC_ADIFFEGREATER", LS_FUNC_ADIFFEGREATER }, + { "LS_FUNC_TIMER", LS_FUNC_TIMER }, + { "LS_FUNC_STICKY", LS_FUNC_STICKY }, + + { "FUNC_OVERRIDE_CHANNEL", FUNC_OVERRIDE_CHANNEL }, + { "FUNC_TRAINER", FUNC_TRAINER }, + { "FUNC_INSTANT_TRIM", FUNC_INSTANT_TRIM }, + { "FUNC_RESET", FUNC_RESET }, + { "FUNC_SET_TIMER", FUNC_SET_TIMER }, + { "FUNC_ADJUST_GVAR", FUNC_ADJUST_GVAR }, + { "FUNC_VOLUME", FUNC_VOLUME }, + { "FUNC_SET_FAILSAFE", FUNC_SET_FAILSAFE }, + { "FUNC_RANGECHECK", FUNC_RANGECHECK }, + { "FUNC_BIND", FUNC_BIND }, + { "FUNC_PLAY_SOUND", FUNC_PLAY_SOUND }, + { "FUNC_PLAY_TRACK", FUNC_PLAY_TRACK }, + { "FUNC_PLAY_VALUE", FUNC_PLAY_VALUE }, + { "FUNC_PLAY_SCRIPT", FUNC_PLAY_SCRIPT }, + { "FUNC_BACKGND_MUSIC", FUNC_BACKGND_MUSIC }, + { "FUNC_BACKGND_MUSIC_PAUSE", FUNC_BACKGND_MUSIC_PAUSE }, + { "FUNC_VARIO", FUNC_VARIO }, + { "FUNC_HAPTIC", FUNC_HAPTIC }, + { "FUNC_LOGS", FUNC_LOGS }, + { "FUNC_BACKLIGHT", FUNC_BACKLIGHT }, + { "FUNC_SCREENSHOT", FUNC_SCREENSHOT }, + { "FUNC_RACING_MODE", FUNC_RACING_MODE }, #if defined(COLORLCD) + { "FUNC_DISABLE_TOUCH", FUNC_DISABLE_TOUCH }, + { "SHADOWED", SHADOWED }, { "COLOR", ZoneOption::Color }, { "BOOL", ZoneOption::Bool }, @@ -2220,7 +2265,7 @@ const luaR_value_entry opentxConstants[] = { { "DARKBROWN", RGB2FLAGS(0x6A, 0x48, 0x10) }, { "BRIGHTGREEN", RGB2FLAGS(0x00, 0xB4, 0x3C) }, { "ORANGE", RGB2FLAGS(0xE5, 0x64, 0x1E) }, - + #else { "FIXEDWIDTH", FIXEDWIDTH }, #endif