Skip to content

Commit

Permalink
fix(radio): trim values scaled incorrectly when displayed via Lua (#5674
Browse files Browse the repository at this point in the history
)
  • Loading branch information
philmoz authored Nov 24, 2024
1 parent 4bea3af commit b35baec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions radio/src/mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,7 @@ getvalue_t _getValue(mixsrc_t i, bool* valid)
else if (trimDown(tidx + 1)) return RESX;
return 0;
}
auto trim_value = getTrimValue(mixerCurrentFlightMode, i);
return calc1000toRESX((int16_t)8 * trim_value);
return 8 * getTrimValue(mixerCurrentFlightMode, i);
}
else if (i >= MIXSRC_FIRST_SWITCH && i <= MIXSRC_LAST_SWITCH) {
auto sw_idx = (uint8_t)(i - MIXSRC_FIRST_SWITCH);
Expand All @@ -428,7 +427,7 @@ getvalue_t _getValue(mixsrc_t i, bool* valid)
auto fct_idx = sw_idx - max_reg_switches;
auto max_fct_switches = switchGetMaxFctSwitches();
if (fct_idx < max_fct_switches) {
return _switch_2pos_lookup[getFSLogicalState(fct_idx)];
return _switch_2pos_lookup[getFSLogicalState(fct_idx)];
}
}
#endif
Expand Down

0 comments on commit b35baec

Please sign in to comment.