Reinstate rangefinder task

This commit is contained in:
jflyper 2018-10-30 11:54:57 +09:00
parent 0e7a4d6e11
commit f788f062ea
1 changed files with 16 additions and 0 deletions

View File

@ -254,6 +254,13 @@ void fcTasksInit(void)
setTaskEnabled(TASK_ATTITUDE, true); setTaskEnabled(TASK_ATTITUDE, true);
} }
#ifdef USE_RANGEFINDER
if (sensors(SENSOR_RANGEFINDER)) {
setTaskEnabled(TASK_RANGEFINDER, featureIsEnabled(FEATURE_RANGEFINDER));
}
#endif
setTaskEnabled(TASK_RX, true); setTaskEnabled(TASK_RX, true);
setTaskEnabled(TASK_DISPATCH, dispatchIsEnabled()); setTaskEnabled(TASK_DISPATCH, dispatchIsEnabled());
@ -597,4 +604,13 @@ cfTask_t cfTasks[TASK_COUNT] = {
.staticPriority = TASK_PRIORITY_IDLE .staticPriority = TASK_PRIORITY_IDLE
}, },
#endif #endif
#ifdef USE_RANGEFINDER
[TASK_RANGEFINDER] = {
.taskName = "RANGEFINDER",
.taskFunc = rangefinderUpdate,
.desiredPeriod = TASK_PERIOD_HZ(10),
.staticPriority = TASK_PRIORITY_IDLE
},
#endif
}; };