Merge pull request #1821 from opentx/projectkk2glider/issue_1818_for_next
Fixes #1818: added Lua model.resetTimer() function
This commit is contained in:
@@ -654,6 +654,15 @@ static int luaModelSetTimer(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int luaModelResetTimer(lua_State *L)
|
||||||
|
{
|
||||||
|
int idx = luaL_checkunsigned(L, 1);
|
||||||
|
if (idx < MAX_TIMERS) {
|
||||||
|
timerReset(idx);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int getFirstInput(int chn)
|
static int getFirstInput(int chn)
|
||||||
{
|
{
|
||||||
for (int i=0; i<MAX_INPUTS; i++) {
|
for (int i=0; i<MAX_INPUTS; i++) {
|
||||||
@@ -1503,6 +1512,7 @@ const luaL_Reg modelLib[] = {
|
|||||||
{ "setInfo", luaModelSetInfo },
|
{ "setInfo", luaModelSetInfo },
|
||||||
{ "getTimer", luaModelGetTimer },
|
{ "getTimer", luaModelGetTimer },
|
||||||
{ "setTimer", luaModelSetTimer },
|
{ "setTimer", luaModelSetTimer },
|
||||||
|
{ "resetTimer", luaModelResetTimer },
|
||||||
{ "getInputsCount", luaModelGetInputsCount },
|
{ "getInputsCount", luaModelGetInputsCount },
|
||||||
{ "getInput", luaModelGetInput },
|
{ "getInput", luaModelGetInput },
|
||||||
{ "insertInput", luaModelInsertInput },
|
{ "insertInput", luaModelInsertInput },
|
||||||
|
|||||||
Reference in New Issue
Block a user