1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 07:15:18 +03:00

Ignore duration of calcActiveAdjustmentRanges() and optimize RX_TASK_DECAY_SHIFT

This commit is contained in:
Steve Evans 2022-01-10 01:18:05 +00:00
parent 18ee33e7a8
commit 1526adfb44
3 changed files with 6 additions and 1 deletions

View file

@ -61,6 +61,8 @@
#include "rc_adjustments.h"
#include "scheduler/scheduler.h"
#define ADJUSTMENT_RANGE_COUNT_INVALID -1
PG_REGISTER_ARRAY(adjustmentRange_t, MAX_ADJUSTMENT_RANGE_COUNT, adjustmentRanges, PG_ADJUSTMENT_RANGE_CONFIG, 2);
@ -834,6 +836,8 @@ void processRcAdjustments(controlRateConfig_t *controlRateConfig)
// Recalculate the new active adjustments if required
if (stepwiseAdjustmentCount == ADJUSTMENT_RANGE_COUNT_INVALID) {
// This can take up to 30us and is only call when not armed so ignore this timing as it doesn't impact flight
schedulerIgnoreTaskExecTime();
calcActiveAdjustmentRanges();
}

View file

@ -115,7 +115,7 @@
// taskUpdateRxMain() has occasional peaks in execution time so normal moving average duration estimation doesn't work
// Decay the estimated max task duration by 1/(1 << RX_TASK_DECAY_SHIFT) on every invocation
#define RX_TASK_DECAY_SHIFT 7
#define RX_TASK_DECAY_SHIFT 6
// Add a margin to the task duration estimation
#define RX_TASK_MARGIN 1

View file

@ -656,4 +656,5 @@ void setLedProfile(uint8_t profile) { UNUSED(profile); }
uint8_t getLedProfile(void) { return 0; }
void compassStartCalibration(void) {}
void pinioBoxTaskControl(void) {}
void schedulerIgnoreTaskExecTime(void) {}
}