Fixes #2684: Lua model scripts outputs not working in a simulator

This commit is contained in:
Damjan Adamic
2015-08-15 12:59:35 +02:00
parent affda2d8fe
commit 4d83dd2c24
3 changed files with 24 additions and 11 deletions
+8
View File
@@ -1,3 +1,11 @@
<h2>Version 2.1.2 / <set date></h2>
<ul>
<li>Fixed: Lua model scripts outputs not working in a simulator (<a href=https://github.com/opentx/opentx/issues/2684>#2684</a>)</li>
</ul>
<h2>Version 2.1.1 / 2015-08-06</h2> <h2>Version 2.1.1 / 2015-08-06</h2>
<ul> <ul>
<li>Vario source and center silent options were not saved(<a href=https://github.com/opentx/opentx/issues/2476>#2476</a>)</li> <li>Vario source and center silent options were not saved(<a href=https://github.com/opentx/opentx/issues/2476>#2476</a>)</li>
@@ -46,6 +46,7 @@
#define VIRTUALINPUTS #define VIRTUALINPUTS
#define LUA #define LUA
#define LUA_MODEL_SCRIPTS #define LUA_MODEL_SCRIPTS
#define LUAINPUTS
#else #else
#define BUZZER #define BUZZER
#define TEMPLATES #define TEMPLATES
+4
View File
@@ -260,7 +260,11 @@ getvalue_t getValue(mixsrc_t i)
} }
#endif #endif
#if defined(LUAINPUTS)
else if (i<=MIXSRC_LAST_POT) return calibratedStick[i-MIXSRC_Rud]; else if (i<=MIXSRC_LAST_POT) return calibratedStick[i-MIXSRC_Rud];
#else
else if (i>=MIXSRC_FIRST_STICK && i<=MIXSRC_LAST_POT) return calibratedStick[i-MIXSRC_Rud];
#endif
#if defined(PCBGRUVIN9X) || defined(PCBMEGA2560) || defined(ROTARY_ENCODERS) #if defined(PCBGRUVIN9X) || defined(PCBMEGA2560) || defined(ROTARY_ENCODERS)
else if (i<=MIXSRC_LAST_ROTARY_ENCODER) return getRotaryEncoder(i-MIXSRC_REa); else if (i<=MIXSRC_LAST_ROTARY_ENCODER) return getRotaryEncoder(i-MIXSRC_REa);