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:
Raphael Coeffic
2023-07-30 14:18:58 +10:00
committed by GitHub
parent 76423370cd
commit 574369aca4
13 changed files with 55 additions and 36 deletions
+2 -3
View File
@@ -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)
{