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

Ignore time taken to update profile with stick commands

This commit is contained in:
Steve Evans 2022-01-05 21:09:30 +00:00
parent 2c5accb8ba
commit f5ee6cfd08
2 changed files with 4 additions and 1 deletions

View file

@ -816,6 +816,9 @@ void changePidProfileFromCellCount(uint8_t cellCount)
void changePidProfile(uint8_t pidProfileIndex) void changePidProfile(uint8_t pidProfileIndex)
{ {
// The config switch will cause a big enough delay in the current task to upset the scheduler
schedulerIgnoreTaskExecTime();
if (pidProfileIndex < PID_PROFILE_COUNT) { if (pidProfileIndex < PID_PROFILE_COUNT) {
systemConfigMutable()->pidProfileIndex = pidProfileIndex; systemConfigMutable()->pidProfileIndex = pidProfileIndex;
loadPidProfile(); loadPidProfile();

View file

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