1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 04:15:26 +03:00

[Crossfire] Cosmetics

This commit is contained in:
Bertrand Songis 2016-06-16 15:18:32 +02:00
parent e50aa21dd2
commit 900266be4a
5 changed files with 51 additions and 23 deletions

View file

@ -369,18 +369,18 @@ static int luaCrossfireTelemetryPop(lua_State * L)
static int luaCrossfireTelemetryPush(lua_State * L)
{
if (luaOutputTelemetryPacket.crossfire.command != 0) {
if (luaOutputTelemetryPacket.crossfire.command != 0x00) {
lua_pushboolean(L, false);
return 1;
}
luaOutputTelemetryPacket.crossfire.command = luaL_checkunsigned(L, 1);
luaL_checktype(L, 2, LUA_TTABLE);
luaOutputTelemetryPacket.crossfire.length = min<int>(sizeof(luaOutputTelemetryPacket.crossfire.data), luaL_len(L, 2));
for (int i=0; i<luaOutputTelemetryPacket.crossfire.length; i++) {
lua_rawgeti(L, 2, i+1);
luaOutputTelemetryPacket.crossfire.data[i] = luaL_checkunsigned(L, -1);
}
luaOutputTelemetryPacket.crossfire.command = luaL_checkunsigned(L, 1);
lua_pushboolean(L, true);
return 1;