mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 06:23:34 +08:00
Use OS independent API for task creation/deletion
Calls to task_delete and task_spawn_cmd are now px4_task_delete and px4_task_spawn_cmd respectively. The px4_tasks.h header was added to the affected files and incusions of nuttx/config.h were removed. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
* @author Johan Jansen <jnsn.johan@gmail.com>
|
||||
*/
|
||||
|
||||
#include <px4_tasks.h> //usleep
|
||||
#include <unistd.h> //usleep
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -95,7 +96,7 @@ static void land_detector_stop()
|
||||
|
||||
/* if we have given up, kill it */
|
||||
if (++i > 50) {
|
||||
task_delete(_landDetectorTaskID);
|
||||
px4_task_delete(_landDetectorTaskID);
|
||||
break;
|
||||
}
|
||||
} while (land_detector_task->isRunning());
|
||||
@@ -136,7 +137,7 @@ static int land_detector_start(const char *mode)
|
||||
}
|
||||
|
||||
//Start new thread task
|
||||
_landDetectorTaskID = task_spawn_cmd("land_detector",
|
||||
_landDetectorTaskID = px4_task_spawn_cmd("land_detector",
|
||||
SCHED_DEFAULT,
|
||||
SCHED_PRIORITY_DEFAULT,
|
||||
1000,
|
||||
|
||||
Reference in New Issue
Block a user