diff options
author | px4dev <px4@purgatory.org> | 2012-10-01 00:02:38 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-10-01 00:02:38 -0700 |
commit | 93c200d281e7488db95806840a6976b02d1afbe0 (patch) | |
tree | 606a24e6778f54c3d7fa9939f303d89f76161d4e /apps/gps | |
parent | 6005077d54e6b96a5284752eedbd026ef7952341 (diff) | |
download | px4-firmware-93c200d281e7488db95806840a6976b02d1afbe0.tar.gz px4-firmware-93c200d281e7488db95806840a6976b02d1afbe0.tar.bz2 px4-firmware-93c200d281e7488db95806840a6976b02d1afbe0.zip |
Add new 'task_spawn' interface for starting new tasks in the PX4 world
Diffstat (limited to 'apps/gps')
-rw-r--r-- | apps/gps/gps.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/gps/gps.c b/apps/gps/gps.c index 976beeaab..8304c72e1 100644 --- a/apps/gps/gps.c +++ b/apps/gps/gps.c @@ -57,6 +57,8 @@ #include <v1.0/common/mavlink.h> #include <mavlink/mavlink_log.h> +#include <systemlib/systemlib.h> + static bool thread_should_exit; /**< Deamon status flag */ static bool thread_running = false; /**< Deamon status flag */ static int deamon_task; /**< Handle of deamon task / thread */ @@ -140,7 +142,12 @@ int gps_main(int argc, char *argv[]) } thread_should_exit = false; - deamon_task = task_create("gps", SCHED_PRIORITY_DEFAULT, 4096, gps_thread_main, (argv) ? (const char **)&argv[2] : (const char **)NULL); + deamon_task = task_spawn("gps", + SCHED_RR, + SCHED_PRIORITY_DEFAULT, + 4096, + gps_thread_main, + (argv) ? (const char **)&argv[2] : (const char **)NULL); thread_running = true; exit(0); } |