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

Fix BST // Sync motor to PID loop (less CPU)

This commit is contained in:
borisbstyle 2016-03-02 14:05:26 +01:00
parent 24b4d37d43
commit 795feddf71
4 changed files with 5 additions and 17 deletions

View file

@ -668,14 +668,6 @@ int main(void) {
rescheduleTask(TASK_GYROPID, targetLooptime);
setTaskEnabled(TASK_GYROPID, true);
setTaskEnabled(TASK_MOTOR, true);
if (feature(FEATURE_ONESHOT125)) {
rescheduleTask(TASK_MOTOR, constrain(lrintf((1.0f / masterConfig.motor_pwm_rate) * 1000000), 250, 3500));
} else {
rescheduleTask(TASK_MOTOR, 1000);
}
if(sensors(SENSOR_ACC)) {
setTaskEnabled(TASK_ACCEL, true);
switch(targetLooptime) { // Switch statement kept in place to change acc rates in the future
@ -732,6 +724,10 @@ int main(void) {
#ifdef TRANSPONDER
setTaskEnabled(TASK_TRANSPONDER, feature(FEATURE_TRANSPONDER));
#endif
#ifdef USE_BST
setTaskEnabled(TASK_BST_READ_WRITE, true);
setTaskEnabled(TASK_BST_MASTER_PROCESS, true);
#endif
while (1) {
scheduler();