mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Merge pull request #5905 from etracer65/rc_interp_task
Break out rc interpolation as a separate task and run before pid controller and motor update
This commit is contained in:
commit
a14302afe2
1 changed files with 7 additions and 2 deletions
|
@ -905,8 +905,6 @@ static NOINLINE void subTaskMainSubprocesses(timeUs_t currentTimeUs)
|
||||||
rcCommand[THROTTLE] += calculateThrottleAngleCorrection(throttleCorrectionConfig()->throttle_correction_value);
|
rcCommand[THROTTLE] += calculateThrottleAngleCorrection(throttleCorrectionConfig()->throttle_correction_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
processRcCommand();
|
|
||||||
|
|
||||||
#ifdef USE_SDCARD
|
#ifdef USE_SDCARD
|
||||||
afatfs_poll();
|
afatfs_poll();
|
||||||
#endif
|
#endif
|
||||||
|
@ -958,6 +956,12 @@ static void subTaskMotorUpdate(timeUs_t currentTimeUs)
|
||||||
DEBUG_SET(DEBUG_PIDLOOP, 2, micros() - startTime);
|
DEBUG_SET(DEBUG_PIDLOOP, 2, micros() - startTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void subTaskRcCommand(timeUs_t currentTimeUs)
|
||||||
|
{
|
||||||
|
processRcCommand();
|
||||||
|
UNUSED(currentTimeUs);
|
||||||
|
}
|
||||||
|
|
||||||
// Function for loop trigger
|
// Function for loop trigger
|
||||||
FAST_CODE void taskMainPidLoop(timeUs_t currentTimeUs)
|
FAST_CODE void taskMainPidLoop(timeUs_t currentTimeUs)
|
||||||
{
|
{
|
||||||
|
@ -976,6 +980,7 @@ FAST_CODE void taskMainPidLoop(timeUs_t currentTimeUs)
|
||||||
DEBUG_SET(DEBUG_PIDLOOP, 0, micros() - currentTimeUs);
|
DEBUG_SET(DEBUG_PIDLOOP, 0, micros() - currentTimeUs);
|
||||||
|
|
||||||
if (pidUpdateCounter++ % pidConfig()->pid_process_denom == 0) {
|
if (pidUpdateCounter++ % pidConfig()->pid_process_denom == 0) {
|
||||||
|
subTaskRcCommand(currentTimeUs);
|
||||||
subTaskPidController(currentTimeUs);
|
subTaskPidController(currentTimeUs);
|
||||||
subTaskMotorUpdate(currentTimeUs);
|
subTaskMotorUpdate(currentTimeUs);
|
||||||
subTaskMainSubprocesses(currentTimeUs);
|
subTaskMainSubprocesses(currentTimeUs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue