1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Minor performance optimisations

This commit is contained in:
Martin Budden 2016-12-15 15:04:47 +00:00
parent 013312f90f
commit 0b6ff0de10
2 changed files with 10 additions and 7 deletions

View file

@ -290,7 +290,7 @@ void updateRcCommands(void)
tmp = 0;
}
rcCommand[axis] = tmp;
} else if (axis == YAW) {
} else {
if (tmp > rcControlsConfig()->yaw_deadband) {
tmp -= rcControlsConfig()->yaw_deadband;
} else {
@ -778,9 +778,11 @@ void subTaskMotorUpdate(void)
#ifdef USE_SERVOS
// motor outputs are used as sources for servo mixing, so motors must be calculated using mixTable() before servos.
servoTable();
filterServos();
writeServos();
if (isMixerUsingServos()) {
servoTable();
filterServos();
writeServos();
}
#endif
if (motorControlEnable) {

View file

@ -176,9 +176,10 @@ void setTaskEnabled(cfTaskId_e taskId, bool enabled)
uint32_t getTaskDeltaTime(cfTaskId_e taskId)
{
if (taskId == TASK_SELF || taskId < TASK_COUNT) {
cfTask_t *task = taskId == TASK_SELF ? currentTask : &cfTasks[taskId];
return task->taskLatestDeltaTime;
if (taskId == TASK_SELF) {
return currentTask->taskLatestDeltaTime;
} else if (taskId < TASK_COUNT) {
return cfTasks[taskId].taskLatestDeltaTime;
} else {
return 0;
}