mirror of
https://github.com/opentx/opentx.git
synced 2025-07-14 20:10:08 +03:00
parent
6eb38bd048
commit
f7153ababb
1 changed files with 24 additions and 0 deletions
|
@ -375,6 +375,26 @@ bool luaFindFieldByName(const char * name, LuaField & field, unsigned int flags)
|
|||
return false; // not found
|
||||
}
|
||||
|
||||
/*luadoc
|
||||
@function getRotEncSpeed()
|
||||
|
||||
Return rotary encoder current speed
|
||||
|
||||
@retval number in list: ROTENC_LOWSPEED, ROTENC_MIDSPEED, ROTENC_HIGHSPEED
|
||||
return 0 on radio without rotary encoder
|
||||
|
||||
@status current Introduced in 2.3.10
|
||||
*/
|
||||
static int luGetRotEncSpeed(lua_State * L)
|
||||
{
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
lua_pushunsigned(L, rotencSpeed);
|
||||
#else
|
||||
lua_pushunsigned(L, 0);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*luadoc
|
||||
@function sportTelemetryPop()
|
||||
|
||||
|
@ -1680,6 +1700,7 @@ const luaL_Reg opentxLib[] = {
|
|||
{ "getVersion", luaGetVersion },
|
||||
{ "getGeneralSettings", luaGetGeneralSettings },
|
||||
{ "getGlobalTimer", luaGetGlobalTimer },
|
||||
{ "getRotEncSpeed", luGetRotEncSpeed },
|
||||
{ "getValue", luaGetValue },
|
||||
{ "getRAS", luaGetRAS },
|
||||
{ "getTxGPS", luaGetTxGPS },
|
||||
|
@ -1814,6 +1835,9 @@ const luaR_value_entry opentxConstants[] = {
|
|||
{ "EVT_VIRTUAL_NEXT", EVT_ROTARY_RIGHT },
|
||||
{ "EVT_VIRTUAL_DEC", EVT_ROTARY_LEFT },
|
||||
{ "EVT_VIRTUAL_INC", EVT_ROTARY_RIGHT },
|
||||
{ "ROTENC_LOWSPEED", ROTENC_LOWSPEED },
|
||||
{ "ROTENC_MIDSPEED", ROTENC_MIDSPEED },
|
||||
{ "ROTENC_HIGHSPEED", ROTENC_HIGHSPEED },
|
||||
#elif defined(PCBX9D) || defined(PCBX9DP) // key reverted between field nav and value change
|
||||
{ "EVT_VIRTUAL_PREV", EVT_KEY_FIRST(KEY_PLUS) },
|
||||
{ "EVT_VIRTUAL_PREV_REPT", EVT_KEY_REPT(KEY_PLUS) },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue