mirror of
https://github.com/opentx/opentx.git
synced 2025-07-27 02:05:16 +03:00
[Horus] Continued ...
This commit is contained in:
parent
e18e6f9c41
commit
fb371cf5b7
2 changed files with 25 additions and 4 deletions
|
@ -52,10 +52,12 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PCBFLAMENCO)
|
#if defined(PCBHORUS)
|
||||||
#include "lua_exports_flamenco.inc" // this line must be after lua headers
|
#include "lua_exports_horus.inc" // this line must be after lua headers
|
||||||
|
#elif defined(PCBFLAMENCO)
|
||||||
|
#include "lua_exports_flamenco.inc" // this line must be after lua headers
|
||||||
#elif defined(PCBTARANIS)
|
#elif defined(PCBTARANIS)
|
||||||
#include "lua_exports_taranis.inc" // this line must be after lua headers
|
#include "lua_exports_taranis.inc" // this line must be after lua headers
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define lua_registernumber(L, n, i) (lua_pushnumber(L, (i)), lua_setglobal(L, (n)))
|
#define lua_registernumber(L, n, i) (lua_pushnumber(L, (i)), lua_setglobal(L, (n)))
|
||||||
|
@ -392,12 +394,14 @@ static int luaKillEvents(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(COLORLCD)
|
||||||
static int luaGrey(lua_State *L)
|
static int luaGrey(lua_State *L)
|
||||||
{
|
{
|
||||||
int index = luaL_checkinteger(L, 1);
|
int index = luaL_checkinteger(L, 1);
|
||||||
lua_pushunsigned(L, GREY(index));
|
lua_pushunsigned(L, GREY(index));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int luaGetGeneralSettings(lua_State *L)
|
static int luaGetGeneralSettings(lua_State *L)
|
||||||
{
|
{
|
||||||
|
@ -1465,7 +1469,9 @@ const luaL_Reg opentxLib[] = {
|
||||||
{ "defaultStick", luaDefaultStick },
|
{ "defaultStick", luaDefaultStick },
|
||||||
{ "defaultChannel", luaDefaultChannel },
|
{ "defaultChannel", luaDefaultChannel },
|
||||||
{ "killEvents", luaKillEvents },
|
{ "killEvents", luaKillEvents },
|
||||||
|
#if !defined(COLORLCD)
|
||||||
{ "GREY", luaGrey },
|
{ "GREY", luaGrey },
|
||||||
|
#endif
|
||||||
{ NULL, NULL } /* sentinel */
|
{ NULL, NULL } /* sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1525,8 +1531,10 @@ const luaR_value_entry opentxConstants[] = {
|
||||||
{ "MIXSRC_CH1", MIXSRC_CH1 },
|
{ "MIXSRC_CH1", MIXSRC_CH1 },
|
||||||
{ "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH },
|
{ "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH },
|
||||||
{ "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU) },
|
{ "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU) },
|
||||||
|
#if !defined(PCBHORUS)
|
||||||
{ "EVT_PAGE_BREAK", EVT_KEY_BREAK(KEY_PAGE) },
|
{ "EVT_PAGE_BREAK", EVT_KEY_BREAK(KEY_PAGE) },
|
||||||
{ "EVT_PAGE_LONG", EVT_KEY_LONG(KEY_PAGE) },
|
{ "EVT_PAGE_LONG", EVT_KEY_LONG(KEY_PAGE) },
|
||||||
|
#endif
|
||||||
{ "EVT_ENTER_BREAK", EVT_KEY_BREAK(KEY_ENTER) },
|
{ "EVT_ENTER_BREAK", EVT_KEY_BREAK(KEY_ENTER) },
|
||||||
{ "EVT_ENTER_LONG", EVT_KEY_LONG(KEY_ENTER) },
|
{ "EVT_ENTER_LONG", EVT_KEY_LONG(KEY_ENTER) },
|
||||||
{ "EVT_EXIT_BREAK", EVT_KEY_BREAK(KEY_EXIT) },
|
{ "EVT_EXIT_BREAK", EVT_KEY_BREAK(KEY_EXIT) },
|
||||||
|
@ -1536,8 +1544,10 @@ const luaR_value_entry opentxConstants[] = {
|
||||||
{ "EVT_MINUS_FIRST", EVT_KEY_FIRST(KEY_MINUS) },
|
{ "EVT_MINUS_FIRST", EVT_KEY_FIRST(KEY_MINUS) },
|
||||||
{ "EVT_PLUS_REPT", EVT_KEY_REPT(KEY_PLUS) },
|
{ "EVT_PLUS_REPT", EVT_KEY_REPT(KEY_PLUS) },
|
||||||
{ "EVT_MINUS_REPT", EVT_KEY_REPT(KEY_MINUS) },
|
{ "EVT_MINUS_REPT", EVT_KEY_REPT(KEY_MINUS) },
|
||||||
|
#if !defined(COLORLCD)
|
||||||
{ "FILL_WHITE", FILL_WHITE },
|
{ "FILL_WHITE", FILL_WHITE },
|
||||||
{ "GREY_DEFAULT", GREY_DEFAULT },
|
{ "GREY_DEFAULT", GREY_DEFAULT },
|
||||||
|
#endif
|
||||||
{ "SOLID", SOLID },
|
{ "SOLID", SOLID },
|
||||||
{ "DOTTED", DOTTED },
|
{ "DOTTED", DOTTED },
|
||||||
{ "FORCE", FORCE },
|
{ "FORCE", FORCE },
|
||||||
|
@ -1874,7 +1884,9 @@ char lua_warning_info[LUA_WARNING_INFO_LEN+1];
|
||||||
|
|
||||||
void displayLuaError(const char * title)
|
void displayLuaError(const char * title)
|
||||||
{
|
{
|
||||||
|
#if !defined(COLORLCD)
|
||||||
displayBox(title);
|
displayBox(title);
|
||||||
|
#endif
|
||||||
if (lua_warning_info[0]) {
|
if (lua_warning_info[0]) {
|
||||||
char * split = strstr(lua_warning_info, ": ");
|
char * split = strstr(lua_warning_info, ": ");
|
||||||
if (split) {
|
if (split) {
|
||||||
|
|
|
@ -239,6 +239,7 @@ extern CurveInfo curveInfo(uint8_t idx);
|
||||||
#define LEN_MODEL_NAME 12
|
#define LEN_MODEL_NAME 12
|
||||||
#define LEN_TIMER_NAME 8
|
#define LEN_TIMER_NAME 8
|
||||||
#define LEN_FLIGHT_MODE_NAME 10
|
#define LEN_FLIGHT_MODE_NAME 10
|
||||||
|
#define LEN_BITMAP_NAME 10
|
||||||
#define LEN_EXPOMIX_NAME 6
|
#define LEN_EXPOMIX_NAME 6
|
||||||
#define LEN_CHANNEL_NAME 6
|
#define LEN_CHANNEL_NAME 6
|
||||||
#define LEN_INPUT_NAME 4
|
#define LEN_INPUT_NAME 4
|
||||||
|
@ -1934,7 +1935,15 @@ enum MixSources {
|
||||||
MIXSRC_Ail, LUA_EXPORT("ail", "Aileron")
|
MIXSRC_Ail, LUA_EXPORT("ail", "Aileron")
|
||||||
|
|
||||||
MIXSRC_FIRST_POT,
|
MIXSRC_FIRST_POT,
|
||||||
#if defined(PCBFLAMENCO)
|
#if defined(PCBHORUS)
|
||||||
|
MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("s1", "Potentiometer 1")
|
||||||
|
MIXSRC_POT2, LUA_EXPORT("s2", "Potentiometer 2")
|
||||||
|
MIXSRC_POT3, LUA_EXPORT("s3", "Potentiometer 3")
|
||||||
|
MIXSRC_FIRST_SLIDER,
|
||||||
|
MIXSRC_SLIDER1 = MIXSRC_FIRST_SLIDER, LUA_EXPORT("ls", "Left slider")
|
||||||
|
MIXSRC_SLIDER2, LUA_EXPORT("rs", "Right slider")
|
||||||
|
MIXSRC_LAST_POT = MIXSRC_SLIDER2,
|
||||||
|
#elif defined(PCBFLAMENCO)
|
||||||
MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("sd", "Potentiometer D")
|
MIXSRC_POT1 = MIXSRC_FIRST_POT, LUA_EXPORT("sd", "Potentiometer D")
|
||||||
MIXSRC_SLIDER1, LUA_EXPORT("ls", "Left slider")
|
MIXSRC_SLIDER1, LUA_EXPORT("ls", "Left slider")
|
||||||
MIXSRC_SLIDER2, LUA_EXPORT("rs", "Right slider")
|
MIXSRC_SLIDER2, LUA_EXPORT("rs", "Right slider")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue