mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Applied 'USE_ACC' consistently.
This commit is contained in:
parent
59ea4becb3
commit
b5908f5bab
29 changed files with 250 additions and 155 deletions
|
@ -250,12 +250,13 @@ void fcTasksInit(void)
|
|||
setTaskEnabled(TASK_GYROPID, true);
|
||||
}
|
||||
|
||||
#if defined(USE_ACC)
|
||||
if (sensors(SENSOR_ACC)) {
|
||||
setTaskEnabled(TASK_ACCEL, true);
|
||||
rescheduleTask(TASK_ACCEL, acc.accSamplingInterval);
|
||||
setTaskEnabled(TASK_ATTITUDE, true);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef USE_RANGEFINDER
|
||||
if (sensors(SENSOR_RANGEFINDER)) {
|
||||
|
@ -393,8 +394,8 @@ cfTask_t cfTasks[TASK_COUNT] = {
|
|||
[TASK_GYROPID] = DEFINE_TASK("PID", "GYRO", NULL, taskMainPidLoop, TASK_GYROPID_DESIRED_PERIOD, TASK_PRIORITY_REALTIME),
|
||||
#ifdef USE_ACC
|
||||
[TASK_ACCEL] = DEFINE_TASK("ACC", NULL, NULL, taskUpdateAccelerometer, TASK_PERIOD_HZ(1000), TASK_PRIORITY_MEDIUM),
|
||||
#endif
|
||||
[TASK_ATTITUDE] = DEFINE_TASK("ATTITUDE", NULL, NULL, imuUpdateAttitude, TASK_PERIOD_HZ(100), TASK_PRIORITY_MEDIUM),
|
||||
#endif
|
||||
[TASK_RX] = DEFINE_TASK("RX", NULL, rxUpdateCheck, taskUpdateRxMain, TASK_PERIOD_HZ(33), TASK_PRIORITY_HIGH), // If event-based scheduling doesn't work, fallback to periodic scheduling
|
||||
[TASK_DISPATCH] = DEFINE_TASK("DISPATCH", NULL, NULL, dispatchProcess, TASK_PERIOD_HZ(1000), TASK_PRIORITY_HIGH),
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue