From fb371cf5b7df3310b941c33e2dcabbe6e1121b70 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 22 Oct 2015 20:18:55 +0200 Subject: [PATCH] =?UTF-8?q?[Horus]=C2=A0Continued=20...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- radio/src/lua_api.cpp | 18 +++++++++++++++--- radio/src/myeeprom.h | 11 ++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/radio/src/lua_api.cpp b/radio/src/lua_api.cpp index 61915ac71..6f6a70c9e 100644 --- a/radio/src/lua_api.cpp +++ b/radio/src/lua_api.cpp @@ -52,10 +52,12 @@ extern "C" { } #endif -#if defined(PCBFLAMENCO) - #include "lua_exports_flamenco.inc" // this line must be after lua headers +#if defined(PCBHORUS) + #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) - #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 #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; } +#if !defined(COLORLCD) static int luaGrey(lua_State *L) { int index = luaL_checkinteger(L, 1); lua_pushunsigned(L, GREY(index)); return 1; } +#endif static int luaGetGeneralSettings(lua_State *L) { @@ -1465,7 +1469,9 @@ const luaL_Reg opentxLib[] = { { "defaultStick", luaDefaultStick }, { "defaultChannel", luaDefaultChannel }, { "killEvents", luaKillEvents }, +#if !defined(COLORLCD) { "GREY", luaGrey }, +#endif { NULL, NULL } /* sentinel */ }; @@ -1525,8 +1531,10 @@ const luaR_value_entry opentxConstants[] = { { "MIXSRC_CH1", MIXSRC_CH1 }, { "SWSRC_LAST", SWSRC_LAST_LOGICAL_SWITCH }, { "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU) }, +#if !defined(PCBHORUS) { "EVT_PAGE_BREAK", EVT_KEY_BREAK(KEY_PAGE) }, { "EVT_PAGE_LONG", EVT_KEY_LONG(KEY_PAGE) }, +#endif { "EVT_ENTER_BREAK", EVT_KEY_BREAK(KEY_ENTER) }, { "EVT_ENTER_LONG", EVT_KEY_LONG(KEY_ENTER) }, { "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_PLUS_REPT", EVT_KEY_REPT(KEY_PLUS) }, { "EVT_MINUS_REPT", EVT_KEY_REPT(KEY_MINUS) }, +#if !defined(COLORLCD) { "FILL_WHITE", FILL_WHITE }, { "GREY_DEFAULT", GREY_DEFAULT }, +#endif { "SOLID", SOLID }, { "DOTTED", DOTTED }, { "FORCE", FORCE }, @@ -1874,7 +1884,9 @@ char lua_warning_info[LUA_WARNING_INFO_LEN+1]; void displayLuaError(const char * title) { +#if !defined(COLORLCD) displayBox(title); +#endif if (lua_warning_info[0]) { char * split = strstr(lua_warning_info, ": "); if (split) { diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index df9f5dea9..ab21f4a17 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -239,6 +239,7 @@ extern CurveInfo curveInfo(uint8_t idx); #define LEN_MODEL_NAME 12 #define LEN_TIMER_NAME 8 #define LEN_FLIGHT_MODE_NAME 10 + #define LEN_BITMAP_NAME 10 #define LEN_EXPOMIX_NAME 6 #define LEN_CHANNEL_NAME 6 #define LEN_INPUT_NAME 4 @@ -1934,7 +1935,15 @@ enum MixSources { MIXSRC_Ail, LUA_EXPORT("ail", "Aileron") 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_SLIDER1, LUA_EXPORT("ls", "Left slider") MIXSRC_SLIDER2, LUA_EXPORT("rs", "Right slider")