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:
Mark Charlebois
2015-03-11 11:10:53 -07:00
parent 51a71d54c6
commit ddb32742eb
32 changed files with 94 additions and 88 deletions
+3 -3
View File
@@ -51,7 +51,7 @@
#include <math.h>
#include <unistd.h>
#include <fcntl.h>
#include <nuttx/config.h>
#include <px4_tasks.h>
#include <nuttx/arch.h>
#include <arch/board/board.h>
#include <drivers/drv_hrt.h>
@@ -213,7 +213,7 @@ GPS::~GPS()
/* well, kill it anyway, though this will probably crash */
if (_task != -1)
task_delete(_task);
px4_task_delete(_task);
g_dev = nullptr;
@@ -229,7 +229,7 @@ GPS::init()
goto out;
/* start the GPS driver worker task */
_task = task_spawn_cmd("gps", SCHED_DEFAULT,
_task = px4_task_spawn_cmd("gps", SCHED_DEFAULT,
SCHED_PRIORITY_SLOW_DRIVER, 1500, (main_t)&GPS::task_main_trampoline, nullptr);
if (_task < 0) {
+3 -3
View File
@@ -48,7 +48,7 @@
* driver. Use instead the normal FMU or IO driver.
*/
#include <nuttx/config.h>
#include <px4_tasks.h>
#include <sys/types.h>
#include <stdint.h>
@@ -188,7 +188,7 @@ HIL::~HIL()
/* if we have given up, kill it */
if (--i == 0) {
task_delete(_task);
px4_task_delete(_task);
break;
}
@@ -228,7 +228,7 @@ HIL::init()
// gpio_reset();
/* start the HIL interface task */
_task = task_spawn_cmd("fmuhil",
_task = px4_task_spawn_cmd("fmuhil",
SCHED_DEFAULT,
SCHED_PRIORITY_DEFAULT,
1200,
@@ -42,7 +42,7 @@
*/
#include <fcntl.h>
#include <nuttx/config.h>
#include <px4_tasks.h>
#include <poll.h>
#include <stdlib.h>
#include <stdio.h>
@@ -209,7 +209,7 @@ hott_sensors_main(int argc, char *argv[])
}
thread_should_exit = false;
deamon_task = task_spawn_cmd(daemon_name,
deamon_task = px4_task_spawn_cmd(daemon_name,
SCHED_DEFAULT,
SCHED_PRIORITY_DEFAULT,
1024,
@@ -44,7 +44,7 @@
*/
#include <fcntl.h>
#include <nuttx/config.h>
#include <px4_tasks.h>
#include <poll.h>
#include <stdlib.h>
#include <stdio.h>
@@ -235,7 +235,7 @@ hott_telemetry_main(int argc, char *argv[])
}
thread_should_exit = false;
deamon_task = task_spawn_cmd(daemon_name,
deamon_task = px4_task_spawn_cmd(daemon_name,
SCHED_DEFAULT,
SCHED_PRIORITY_DEFAULT,
2048,
+2 -2
View File
@@ -44,7 +44,7 @@
*
*/
#include <nuttx/config.h>
#include <px4_tasks.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -110,7 +110,7 @@ int md25_main(int argc, char *argv[])
}
thread_should_exit = false;
deamon_task = task_spawn_cmd("md25",
deamon_task = px4_task_spawn_cmd("md25",
SCHED_DEFAULT,
SCHED_PRIORITY_MAX - 10,
2048,
+3 -3
View File
@@ -41,7 +41,7 @@
*
*/
#include <nuttx/config.h>
#include <px4_tasks.h>
#include <drivers/device/i2c.h>
#include <systemlib/param/param.h>
@@ -258,7 +258,7 @@ MK::~MK()
/* if we have given up, kill it */
if (--i == 0) {
task_delete(_task);
px4_task_delete(_task);
break;
}
@@ -302,7 +302,7 @@ MK::init(unsigned motors)
}
/* start the IO interface task */
_task = task_spawn_cmd("mkblctrl",
_task = px4_task_spawn_cmd("mkblctrl",
SCHED_DEFAULT,
SCHED_PRIORITY_MAX - 20,
1500,
+3 -3
View File
@@ -37,7 +37,7 @@
* Driver/configurator for the PX4 FMU multi-purpose port on v1 and v2 boards.
*/
#include <nuttx/config.h>
#include <px4_tasks.h>
#include <sys/types.h>
#include <stdint.h>
@@ -302,7 +302,7 @@ PX4FMU::~PX4FMU()
/* if we have given up, kill it */
if (--i == 0) {
task_delete(_task);
px4_task_delete(_task);
break;
}
@@ -341,7 +341,7 @@ PX4FMU::init()
gpio_reset();
/* start the IO interface task */
_task = task_spawn_cmd("fmuservo",
_task = px4_task_spawn_cmd("fmuservo",
SCHED_DEFAULT,
SCHED_PRIORITY_DEFAULT,
1600,
+3 -3
View File
@@ -38,7 +38,7 @@
* PX4IO is connected via I2C or DMA enabled high-speed UART.
*/
#include <nuttx/config.h>
#include <px4_tasks.h>
#include <sys/types.h>
#include <stdint.h>
@@ -550,7 +550,7 @@ PX4IO::~PX4IO()
/* well, kill it anyway, though this will probably crash */
if (_task != -1)
task_delete(_task);
px4_task_delete(_task);
if (_interface != nullptr)
delete _interface;
@@ -841,7 +841,7 @@ PX4IO::init()
}
/* start the IO interface task */
_task = task_spawn_cmd("px4io",
_task = px4_task_spawn_cmd("px4io",
SCHED_DEFAULT,
SCHED_PRIORITY_ACTUATOR_OUTPUTS,
1800,
+2 -2
View File
@@ -43,7 +43,7 @@
*
*/
#include <nuttx/config.h>
#include <px4_tasks.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -105,7 +105,7 @@ int roboclaw_main(int argc, char *argv[])
}
thread_should_exit = false;
deamon_task = task_spawn_cmd("roboclaw",
deamon_task = px4_task_spawn_cmd("roboclaw",
SCHED_DEFAULT,
SCHED_PRIORITY_MAX - 10,
2048,