1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 09:15:38 +03:00

Allow neg value for telem comparison fonctions (#4667)

* Allow neg value for telem comparison fonctions

* Protect avr
This commit is contained in:
3djc 2017-03-22 21:57:45 +01:00 committed by Bertrand Songis
parent d68778ec81
commit d586b7cd2b

View file

@ -166,7 +166,11 @@ void menuModelLogicalSwitchOne(event_t event)
else if (cs->func == LS_FUNC_ADIFFEGREATER)
v2_min = 0;
else
#if defined(CPUARM)
v2_min = -v2_max;
#else
v2_min = minTelemValue(v1_val - MIXSRC_FIRST_TELEM + 1);
#endif
INCDEC_SET_FLAG(EE_MODEL | INCDEC_REP10 | NO_INCDEC_MARKS);
if (cs->v2 < v2_min || cs->v2 > v2_max) {
cs->v2 = 0;