mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 13:55:18 +03:00
FC Core: Remove conditional pidUpdateCountDown
This commit is contained in:
parent
dc58ddebd6
commit
685dd05479
1 changed files with 1 additions and 10 deletions
|
@ -926,15 +926,6 @@ static void subTaskMotorUpdate(timeUs_t currentTimeUs)
|
||||||
DEBUG_SET(DEBUG_PIDLOOP, 2, micros() - startTime);
|
DEBUG_SET(DEBUG_PIDLOOP, 2, micros() - startTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t setPidUpdateCountDown(void)
|
|
||||||
{
|
|
||||||
if (gyroConfig()->gyro_soft_lpf_hz) {
|
|
||||||
return pidConfig()->pid_process_denom - 1;
|
|
||||||
} else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Function for loop trigger
|
// Function for loop trigger
|
||||||
void taskMainPidLoop(timeUs_t currentTimeUs)
|
void taskMainPidLoop(timeUs_t currentTimeUs)
|
||||||
{
|
{
|
||||||
|
@ -955,7 +946,7 @@ void taskMainPidLoop(timeUs_t currentTimeUs)
|
||||||
if (pidUpdateCountdown) {
|
if (pidUpdateCountdown) {
|
||||||
pidUpdateCountdown--;
|
pidUpdateCountdown--;
|
||||||
} else {
|
} else {
|
||||||
pidUpdateCountdown = setPidUpdateCountDown();
|
pidUpdateCountdown = pidConfig()->pid_process_denom - 1;
|
||||||
subTaskPidController(currentTimeUs);
|
subTaskPidController(currentTimeUs);
|
||||||
subTaskMotorUpdate(currentTimeUs);
|
subTaskMotorUpdate(currentTimeUs);
|
||||||
subTaskMainSubprocesses(currentTimeUs);
|
subTaskMainSubprocesses(currentTimeUs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue