mirror of
https://github.com/opentx/opentx.git
synced 2025-07-16 12:55:12 +03:00
Merge branch 'master' of https://github.com/tmrttmrt/opentx into tmrttmrt/Fixes#2750__Mega2560_ST7920_mixer_freq_too_slow
This commit is contained in:
commit
8e0adbe602
313 changed files with 24053 additions and 48662 deletions
|
@ -512,13 +512,16 @@ void evalInputs(uint8_t mode)
|
|||
}
|
||||
|
||||
#if defined(VIRTUALINPUTS)
|
||||
int getStickTrimValue(int stick, int value)
|
||||
int getStickTrimValue(int stick, int stickValue)
|
||||
{
|
||||
if (stick < 0)
|
||||
return 0;
|
||||
|
||||
int trim = trims[stick];
|
||||
if (stick == THR_STICK) {
|
||||
if (g_model.thrTrim) {
|
||||
int trimMin = g_model.extendedTrims ? 2*TRIM_EXTENDED_MIN : 2*TRIM_MIN;
|
||||
trim = ((g_model.throttleReversed ? (trim+trimMin) : (trim-trimMin)) * (RESX-value)) >> (RESX_SHIFT+1);
|
||||
trim = ((g_model.throttleReversed ? (trim+trimMin) : (trim-trimMin)) * (RESX-stickValue)) >> (RESX_SHIFT+1);
|
||||
}
|
||||
if (g_model.throttleReversed) {
|
||||
trim = -trim;
|
||||
|
@ -527,12 +530,12 @@ int getStickTrimValue(int stick, int value)
|
|||
return trim;
|
||||
}
|
||||
|
||||
int getSourceTrimValue(int source, int value=0)
|
||||
int getSourceTrimValue(int source, int stickValue=0)
|
||||
{
|
||||
if (source >= MIXSRC_Rud && source <= MIXSRC_Ail)
|
||||
return getStickTrimValue(source - MIXSRC_Rud, value);
|
||||
return getStickTrimValue(source - MIXSRC_Rud, stickValue);
|
||||
else if (source >= MIXSRC_FIRST_INPUT && source <= MIXSRC_LAST_INPUT)
|
||||
return getStickTrimValue(virtualInputsTrims[source - MIXSRC_FIRST_INPUT], value);
|
||||
return getStickTrimValue(virtualInputsTrims[source - MIXSRC_FIRST_INPUT], stickValue);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue