mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
Add USE_ACC conditionals
This commit is contained in:
parent
af84f9e99d
commit
cc0e689bb5
9 changed files with 31 additions and 2 deletions
|
@ -149,10 +149,12 @@ static void taskBatteryAlerts(timeUs_t currentTimeUs)
|
|||
batteryUpdateAlarms();
|
||||
}
|
||||
|
||||
#ifdef USE_ACC
|
||||
static void taskUpdateAccelerometer(timeUs_t currentTimeUs)
|
||||
{
|
||||
accUpdate(currentTimeUs, &accelerometerConfigMutable()->accelerometerTrims);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void taskUpdateRxMain(timeUs_t currentTimeUs)
|
||||
{
|
||||
|
@ -389,7 +391,9 @@ cfTask_t cfTasks[TASK_COUNT] = {
|
|||
#endif
|
||||
|
||||
[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),
|
||||
[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