mirror of
https://github.com/opentx/opentx.git
synced 2025-07-13 11:29:51 +03:00
[MEGA2560/GRUVIN9X] Overflow in Custom Functions switch (no ON and One)
This commit is contained in:
parent
4c0515ab91
commit
01cd86f6f6
20 changed files with 58 additions and 149 deletions
|
@ -313,10 +313,6 @@ getvalue_t getValue(mixsrc_t i)
|
|||
#else
|
||||
else if (i==MIXSRC_3POS) return (getSwitch(SW_ID0-SW_BASE+1) ? -1024 : (getSwitch(SW_ID1-SW_BASE+1) ? 0 : 1024));
|
||||
// don't use switchState directly to give getSwitch possibility to hack values if needed for switch warning
|
||||
#if defined(EXTRA_3POS)
|
||||
else if (i==MIXSRC_3POS2) return (getSwitch(SW_ID3-SW_BASE+1) ? -1024 : (getSwitch(SW_ID4-SW_BASE+1) ? 0 : 1024));
|
||||
// don't use switchState directly to give getSwitch possibility to hack values if needed for switch warning
|
||||
#endif
|
||||
else if (i<MIXSRC_SW1) return getSwitch(SWSRC_THR+i-MIXSRC_THR) ? 1024 : -1024;
|
||||
#endif
|
||||
else if (i<=MIXSRC_LAST_LOGICAL_SWITCH) return getSwitch(SWSRC_FIRST_LOGICAL_SWITCH+i-MIXSRC_FIRST_LOGICAL_SWITCH) ? 1024 : -1024;
|
||||
|
@ -453,17 +449,6 @@ void evalInputs(uint8_t mode)
|
|||
v = -v;
|
||||
}
|
||||
|
||||
#if defined(EXTRA_3POS)
|
||||
if (i == POT1+EXTRA_3POS-1) {
|
||||
if (v < -RESX/2)
|
||||
v = -RESX;
|
||||
else if (v > +RESX/2)
|
||||
v = +RESX;
|
||||
else
|
||||
v = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
BeepANACenter mask = (BeepANACenter)1 << ch;
|
||||
|
||||
if (i < NUM_STICKS+NUM_POTS) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue