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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
for (int i=0; i<MAX_INPUTS; i++) {
|
||||
@@ -1503,6 +1512,7 @@ const luaL_Reg modelLib[] = {
|
||||
{ "setInfo", luaModelSetInfo },
|
||||
{ "getTimer", luaModelGetTimer },
|
||||
{ "setTimer", luaModelSetTimer },
|
||||
{ "resetTimer", luaModelResetTimer },
|
||||
{ "getInputsCount", luaModelGetInputsCount },
|
||||
{ "getInput", luaModelGetInput },
|
||||
{ "insertInput", luaModelInsertInput },
|
||||
|
||||
Reference in New Issue
Block a user