1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 11:59:58 +03:00

Optimize in-flight adjustments to only process configured ranges

Previously the logic would process all possible ranges defined by MAX_ADJUSTMENT_RANGE_COUNT even if some (or even all) ranges were not configured.  This change first builds a list of configured ranges and only processes thos entries.

Reduces CPU load by skipping unnecessary processing and minimizes the impact of increasing the number of available ranges.
This commit is contained in:
Bruce Luckcuck 2018-09-18 10:31:58 -04:00
parent 27cbf0515d
commit 044648ca12
6 changed files with 59 additions and 21 deletions

View file

@ -1318,6 +1318,9 @@ static void cliAdjustmentRange(char *cmdline)
ar->adjustmentScale = val;
validArgumentCount++;
}
activeAdjustmentRangeReset();
cliDumpPrintLinef(0, false, format,
i,
ar->adjustmentIndex,