Merge with latest 2.3

This commit is contained in:
Bertrand Songis
2020-03-05 10:43:01 +01:00
144 changed files with 3009 additions and 1035 deletions
+9 -1
View File
@@ -28,7 +28,7 @@
#if defined(PCBX12S)
#include "lua/lua_exports_x12s.inc" // this line must be after lua headers
#elif defined(RADIO_T16)
#elif defined(RADIO_FAMILY_T16)
#include "lua/lua_exports_t16.inc"
#elif defined(PCBX10)
#include "lua/lua_exports_x10.inc"
@@ -456,6 +456,10 @@ static int luaSportTelemetryPush(lua_State * L)
lua_pushboolean(L, outputTelemetryBuffer.isAvailable());
return 1;
}
else if (lua_gettop(L) > int(sizeof(SportTelemetryPacket))) {
lua_pushboolean(L, false);
return 1;
}
uint16_t dataId = luaL_checkunsigned(L, 3);
@@ -653,6 +657,10 @@ static int luaCrossfireTelemetryPush(lua_State * L)
if (lua_gettop(L) == 0) {
lua_pushboolean(L, outputTelemetryBuffer.isAvailable());
}
else if (lua_gettop(L) > TELEMETRY_OUTPUT_BUFFER_SIZE ) {
lua_pushboolean(L, false);
return 1;
}
else if (outputTelemetryBuffer.isAvailable()) {
uint8_t command = luaL_checkunsigned(L, 1);
luaL_checktype(L, 2, LUA_TTABLE);
+7 -4
View File
@@ -71,6 +71,8 @@ Draw a single pixel at (x,y) position
@param y (positive number) y position
@param flags (optional) lcdflags
@notice Taranis has an LCD display width of 212 pixels and height of 64 pixels.
Position (0,0) is at top left. Y axis is negative, top line is 0,
bottom line is 63. Drawing on an existing black pixel produces white pixel (TODO check this!)
@@ -82,7 +84,8 @@ static int luaLcdDrawPoint(lua_State *L)
if (!luaLcdAllowed) return 0;
int x = luaL_checkinteger(L, 1);
int y = luaL_checkinteger(L, 2);
lcdDrawPoint(x, y);
LcdFlags att = luaL_optunsigned(L, 3, 0);
lcdDrawPoint(x, y, att);
return 0;
}
@@ -95,14 +98,14 @@ Draw a straight line on LCD
@param x2,y2 (positive numbers) end coordinate
@param pattern TODO
@param pattern SOLID or DOTTED
@param flags TODO
@param flags lcdflags
@notice If the start or the end of the line is outside the LCD dimensions, then the
whole line will not be drawn (starting from OpenTX 2.1.5)
@status current Introduced in 2.0.0
@status current Introduced in 2.0.0, flags introduced in 2.3.6
*/
static int luaLcdDrawLine(lua_State *L)
{
+8 -2
View File
@@ -182,8 +182,9 @@ Get model timer parameters
* `countdownBeep` (number) countdown beep (0­ = silent, 1 =­ beeps, 2­ = voice)
* `minuteBeep` (boolean) minute beep
* `persistent` (number) persistent timer
* `name` (string) timer name
@status current Introduced in 2.0.0
@status current Introduced in 2.0.0, name added in 2.3.6
*/
static int luaModelGetTimer(lua_State *L)
{
@@ -197,6 +198,7 @@ static int luaModelGetTimer(lua_State *L)
lua_pushtableinteger(L, "countdownBeep", timer.countdownBeep);
lua_pushtableboolean(L, "minuteBeep", timer.minuteBeep);
lua_pushtableinteger(L, "persistent", timer.persistent);
lua_pushtablezstring(L, "name", timer.name);
}
else {
lua_pushnil(L);
@@ -216,7 +218,7 @@ Set model timer parameters
@notice If a parameter is missing from the value, then
that parameter remains unchanged.
@status current Introduced in 2.0.0
@status current Introduced in 2.0.0, name added in 2.3.6
*/
static int luaModelSetTimer(lua_State *L)
{
@@ -246,6 +248,10 @@ static int luaModelSetTimer(lua_State *L)
else if (!strcmp(key, "persistent")) {
timer.persistent = luaL_checkinteger(L, -1);
}
if (!strcmp(key, "name")) {
const char * name = luaL_checkstring(L, -1);
str2zchar(timer.name, name, sizeof(timer.name));
}
}
storageDirty(EE_MODEL);
}
+1 -1
View File
@@ -953,7 +953,7 @@ bool luaDoOneRunPermanentScript(event_t evt, int i, uint32_t scriptType)
TelemetryScriptData & script = g_model.screens[sid.reference-SCRIPT_TELEMETRY_FIRST].script;
filename = script.file;
#endif
if ((scriptType & RUN_TELEM_FG_SCRIPT) && (menuHandlers[0]==menuViewTelemetryFrsky && sid.reference==SCRIPT_TELEMETRY_FIRST+s_frsky_view)) {
if ((scriptType & RUN_TELEM_FG_SCRIPT) && (menuHandlers[0]==menuViewTelemetry && sid.reference==SCRIPT_TELEMETRY_FIRST+s_frsky_view)) {
lua_rawgeti(lsScripts, LUA_REGISTRYINDEX, sid.run);
lua_pushunsigned(lsScripts, evt);
inputsCount = 1;