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

luaRegister function removed

This commit is contained in:
Bertrand Songis 2016-02-28 19:55:20 +01:00
parent acb7f1e17f
commit fe901dabdf

View file

@ -326,27 +326,20 @@ bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags)
return false; // not found return false; // not found
} }
static int luaTelemetryRegister(lua_State *L) static int luaTelemetryPop(lua_State *L)
{ {
if (!luaTelemetryFifo) { if (!luaTelemetryFifo) {
luaTelemetryFifo = new Fifo<LuaTelemetryValue, 16>(); luaTelemetryFifo = new Fifo<LuaTelemetryValue, 16>();
if (!luaTelemetryFifo) { if (!luaTelemetryFifo) {
return -1; return 0;
} }
} }
return 0; LuaTelemetryValue value;
} if (luaTelemetryFifo->pop(value)) {
lua_pushnumber(L, value.id);
static int luaTelemetryPop(lua_State *L) lua_pushunsigned(L, value.value);
{ return 2;
if (luaTelemetryFifo) {
LuaTelemetryValue value;
if (luaTelemetryFifo->pop(value)) {
lua_pushnumber(L, value.id);
lua_pushunsigned(L, value.value);
return 2;
}
} }
return 0; return 0;
@ -820,7 +813,6 @@ const luaL_Reg opentxLib[] = {
#if !defined(COLORLCD) #if !defined(COLORLCD)
{ "GREY", luaGrey }, { "GREY", luaGrey },
#endif #endif
{ "telemetryRegister", luaTelemetryRegister },
{ "telemetryPop", luaTelemetryPop }, { "telemetryPop", luaTelemetryPop },
{ NULL, NULL } /* sentinel */ { NULL, NULL } /* sentinel */
}; };