fix: Use keysGetMaxTrims() instead of MAX_TRIMS (#3860)
* fix: use keysGetMaxTrims() instead of MAX_TRIMS * feat: add support for virtual trims This is necessary for radios like X-lite where half of the trims are simulated
This commit is contained in:
+2
-3
@@ -464,18 +464,17 @@ getvalue_t getValue(mixsrc_t i, bool* valid)
|
||||
void evalTrims()
|
||||
{
|
||||
uint8_t phase = mixerCurrentFlightMode;
|
||||
for (uint8_t i=0; i<MAX_TRIMS; i++) {
|
||||
for (uint8_t i = 0; i < keysGetMaxTrims(); i++) {
|
||||
// do trim -> throttle trim if applicable
|
||||
int16_t trim = getTrimValue(phase, i);
|
||||
if (trimsCheckTimer > 0) {
|
||||
trim = 0;
|
||||
}
|
||||
|
||||
trims[i] = trim*2;
|
||||
trims[i] = trim * 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO: move to analogs.cpp
|
||||
void evalInputs(uint8_t mode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user