diff --git a/src/main/config/config.c b/src/main/config/config.c index 4a9f96494a..071c6bd9f8 100644 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -816,6 +816,9 @@ void changePidProfileFromCellCount(uint8_t cellCount) 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) { systemConfigMutable()->pidProfileIndex = pidProfileIndex; loadPidProfile(); diff --git a/src/main/fc/tasks.c b/src/main/fc/tasks.c index 2de90bf05f..a8a41c945e 100644 --- a/src/main/fc/tasks.c +++ b/src/main/fc/tasks.c @@ -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 5 +#define RX_TASK_DECAY_SHIFT 7 // Add a margin to the task duration estimation #define RX_TASK_MARGIN 1