From ddb32742ebd299e83e268c7ffa99c808bdaf4f8a Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Wed, 11 Mar 2015 11:10:53 -0700 Subject: [PATCH] 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 --- src/drivers/gps/gps.cpp | 6 +++--- src/drivers/hil/hil.cpp | 6 +++--- src/drivers/hott/hott_sensors/hott_sensors.cpp | 4 ++-- src/drivers/hott/hott_telemetry/hott_telemetry.cpp | 4 ++-- src/drivers/md25/md25_main.cpp | 4 ++-- src/drivers/mkblctrl/mkblctrl.cpp | 6 +++--- src/drivers/px4fmu/fmu.cpp | 6 +++--- src/drivers/px4io/px4io.cpp | 6 +++--- src/drivers/roboclaw/roboclaw_main.cpp | 4 ++-- src/examples/publisher/publisher_start_nuttx.cpp | 13 +++++++------ src/examples/rover_steering_control/main.cpp | 6 +++--- src/examples/subscriber/subscriber_start_nuttx.cpp | 13 +++++++------ .../attitude_estimator_ekf_main.cpp | 6 +++--- .../attitude_estimator_so3_main.cpp | 6 +++--- src/modules/bottle_drop/bottle_drop.cpp | 6 +++--- src/modules/commander/commander.cpp | 4 ++-- .../ekf_att_pos_estimator_main.cpp | 6 +++--- .../fixedwing_backside/fixedwing_backside_main.cpp | 4 ++-- src/modules/fw_att_control/fw_att_control_main.cpp | 6 +++--- .../fw_pos_control_l1/fw_pos_control_l1_main.cpp | 6 +++--- src/modules/land_detector/land_detector_main.cpp | 5 +++-- src/modules/mavlink/mavlink_main.cpp | 6 +++--- src/modules/mc_att_control/mc_att_control_main.cpp | 6 +++--- .../mc_att_control_start_nuttx.cpp | 3 ++- src/modules/mc_pos_control/mc_pos_control_main.cpp | 5 +++-- .../mc_pos_control_start_nuttx.cpp | 3 ++- src/modules/navigator/navigator_main.cpp | 6 +++--- src/modules/segway/segway_main.cpp | 4 ++-- src/modules/sensors/sensors.cpp | 6 +++--- src/modules/uORB/uORB.cpp | 4 ++-- src/modules/uavcan/uavcan_main.cpp | 6 +++--- .../vtol_att_control/vtol_att_control_main.cpp | 6 +++--- 32 files changed, 94 insertions(+), 88 deletions(-) diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index 714c80ded2..b727c55404 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include #include @@ -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) { diff --git a/src/drivers/hil/hil.cpp b/src/drivers/hil/hil.cpp index 961ec47246..a82dec8ac7 100644 --- a/src/drivers/hil/hil.cpp +++ b/src/drivers/hil/hil.cpp @@ -48,7 +48,7 @@ * driver. Use instead the normal FMU or IO driver. */ -#include +#include #include #include @@ -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, diff --git a/src/drivers/hott/hott_sensors/hott_sensors.cpp b/src/drivers/hott/hott_sensors/hott_sensors.cpp index 4ac7e4bdfb..e5bbc41d13 100644 --- a/src/drivers/hott/hott_sensors/hott_sensors.cpp +++ b/src/drivers/hott/hott_sensors/hott_sensors.cpp @@ -42,7 +42,7 @@ */ #include -#include +#include #include #include #include @@ -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, diff --git a/src/drivers/hott/hott_telemetry/hott_telemetry.cpp b/src/drivers/hott/hott_telemetry/hott_telemetry.cpp index 43df0cb8cc..841f3ed1a8 100644 --- a/src/drivers/hott/hott_telemetry/hott_telemetry.cpp +++ b/src/drivers/hott/hott_telemetry/hott_telemetry.cpp @@ -44,7 +44,7 @@ */ #include -#include +#include #include #include #include @@ -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, diff --git a/src/drivers/md25/md25_main.cpp b/src/drivers/md25/md25_main.cpp index d25d16fa15..7bcc1c9d68 100644 --- a/src/drivers/md25/md25_main.cpp +++ b/src/drivers/md25/md25_main.cpp @@ -44,7 +44,7 @@ * */ -#include +#include #include #include #include @@ -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, diff --git a/src/drivers/mkblctrl/mkblctrl.cpp b/src/drivers/mkblctrl/mkblctrl.cpp index 3b8c4ee777..bf017103cf 100644 --- a/src/drivers/mkblctrl/mkblctrl.cpp +++ b/src/drivers/mkblctrl/mkblctrl.cpp @@ -41,7 +41,7 @@ * */ -#include +#include #include #include @@ -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, diff --git a/src/drivers/px4fmu/fmu.cpp b/src/drivers/px4fmu/fmu.cpp index 92afc7cd74..f36a07b04a 100644 --- a/src/drivers/px4fmu/fmu.cpp +++ b/src/drivers/px4fmu/fmu.cpp @@ -37,7 +37,7 @@ * Driver/configurator for the PX4 FMU multi-purpose port on v1 and v2 boards. */ -#include +#include #include #include @@ -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, diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 33125699f5..9fe69113ba 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -38,7 +38,7 @@ * PX4IO is connected via I2C or DMA enabled high-speed UART. */ -#include +#include #include #include @@ -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, diff --git a/src/drivers/roboclaw/roboclaw_main.cpp b/src/drivers/roboclaw/roboclaw_main.cpp index ea7178076b..198e2f0c15 100644 --- a/src/drivers/roboclaw/roboclaw_main.cpp +++ b/src/drivers/roboclaw/roboclaw_main.cpp @@ -43,7 +43,7 @@ * */ -#include +#include #include #include #include @@ -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, diff --git a/src/examples/publisher/publisher_start_nuttx.cpp b/src/examples/publisher/publisher_start_nuttx.cpp index 4ff2cebfbc..2f12e298b2 100644 --- a/src/examples/publisher/publisher_start_nuttx.cpp +++ b/src/examples/publisher/publisher_start_nuttx.cpp @@ -36,6 +36,7 @@ * * @author Thomas Gubler */ +#include #include #include #include @@ -68,12 +69,12 @@ int publisher_main(int argc, char *argv[]) task_should_exit = false; - daemon_task = task_spawn_cmd("publisher", - SCHED_DEFAULT, - SCHED_PRIORITY_MAX - 5, - 2000, - main, - (argv) ? (char * const *)&argv[2] : (char * const *)NULL); + daemon_task = px4_task_spawn_cmd("publisher", + SCHED_DEFAULT, + SCHED_PRIORITY_MAX - 5, + 2000, + main, + (argv) ? (char* const*)&argv[2] : (char* const*)NULL); exit(0); } diff --git a/src/examples/rover_steering_control/main.cpp b/src/examples/rover_steering_control/main.cpp index 41df96775c..6fc4af4f4b 100644 --- a/src/examples/rover_steering_control/main.cpp +++ b/src/examples/rover_steering_control/main.cpp @@ -39,7 +39,7 @@ * @author Lorenz Meier */ -#include +#include #include #include #include @@ -408,7 +408,7 @@ usage(const char *reason) * Makefile does only apply to this management task. * * The actual stack size should be set in the call - * to task_spawn_cmd(). + * to px4_task_spawn_cmd(). */ int rover_steering_control_main(int argc, char *argv[]) { @@ -425,7 +425,7 @@ int rover_steering_control_main(int argc, char *argv[]) } thread_should_exit = false; - deamon_task = task_spawn_cmd("rover_steering_control", + deamon_task = px4_task_spawn_cmd("rover_steering_control", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 20, 2048, diff --git a/src/examples/subscriber/subscriber_start_nuttx.cpp b/src/examples/subscriber/subscriber_start_nuttx.cpp index 757e8ec521..091a15d2aa 100644 --- a/src/examples/subscriber/subscriber_start_nuttx.cpp +++ b/src/examples/subscriber/subscriber_start_nuttx.cpp @@ -36,6 +36,7 @@ * * @author Thomas Gubler */ +#include #include #include #include @@ -68,12 +69,12 @@ int subscriber_main(int argc, char *argv[]) task_should_exit = false; - daemon_task = task_spawn_cmd("subscriber", - SCHED_DEFAULT, - SCHED_PRIORITY_MAX - 5, - 2000, - main, - (argv) ? (char * const *)&argv[2] : (char * const *)NULL); + daemon_task = px4_task_spawn_cmd("subscriber", + SCHED_DEFAULT, + SCHED_PRIORITY_MAX - 5, + 2000, + main, + (argv) ? (char* const*)&argv[2] : (char* const*)NULL); exit(0); } diff --git a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp index b2a3572a7d..87a1b48762 100755 --- a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp +++ b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp @@ -41,7 +41,7 @@ * @author Thomas Gubler */ -#include +#include #include #include #include @@ -114,7 +114,7 @@ usage(const char *reason) * Makefile does only apply to this management task. * * The actual stack size should be set in the call - * to task_spawn_cmd(). + * to px4_task_spawn_cmd(). */ int attitude_estimator_ekf_main(int argc, char *argv[]) { @@ -131,7 +131,7 @@ int attitude_estimator_ekf_main(int argc, char *argv[]) } thread_should_exit = false; - attitude_estimator_ekf_task = task_spawn_cmd("attitude_estimator_ekf", + attitude_estimator_ekf_task = px4_task_spawn_cmd("attitude_estimator_ekf", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 5, 7700, diff --git a/src/modules/attitude_estimator_so3/attitude_estimator_so3_main.cpp b/src/modules/attitude_estimator_so3/attitude_estimator_so3_main.cpp index 82bcbc66ff..448f1c3913 100755 --- a/src/modules/attitude_estimator_so3/attitude_estimator_so3_main.cpp +++ b/src/modules/attitude_estimator_so3/attitude_estimator_so3_main.cpp @@ -50,7 +50,7 @@ * [2] Euston, M.; Coote, P.; Mahony, R.; Jonghyuk Kim; Hamel, T., "A complementary filter for attitude estimation of a fixed-wing UAV," Intelligent Robots and Systems, 2008. IROS 2008. IEEE/RSJ International Conference on , vol., no., pp.340,345, 22-26 Sept. 2008 */ -#include +#include #include #include #include @@ -132,7 +132,7 @@ usage(const char *reason) * Makefile does only apply to this management task. * * The actual stack size should be set in the call - * to task_spawn_cmd(). + * to px4_task_spawn_cmd(). */ int attitude_estimator_so3_main(int argc, char *argv[]) { @@ -149,7 +149,7 @@ int attitude_estimator_so3_main(int argc, char *argv[]) } thread_should_exit = false; - attitude_estimator_so3_task = task_spawn_cmd("attitude_estimator_so3", + attitude_estimator_so3_task = px4_task_spawn_cmd("attitude_estimator_so3", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 5, 14000, diff --git a/src/modules/bottle_drop/bottle_drop.cpp b/src/modules/bottle_drop/bottle_drop.cpp index b267209fe3..3681bdb515 100644 --- a/src/modules/bottle_drop/bottle_drop.cpp +++ b/src/modules/bottle_drop/bottle_drop.cpp @@ -40,7 +40,7 @@ * @author Julian Oes */ -#include +#include #include #include #include @@ -210,7 +210,7 @@ BottleDrop::~BottleDrop() /* if we have given up, kill it */ if (++i > 50) { - task_delete(_main_task); + px4_task_delete(_main_task); break; } } while (_main_task != -1); @@ -225,7 +225,7 @@ BottleDrop::start() ASSERT(_main_task == -1); /* start the task */ - _main_task = task_spawn_cmd("bottle_drop", + _main_task = px4_task_spawn_cmd("bottle_drop", SCHED_DEFAULT, SCHED_PRIORITY_DEFAULT + 15, 1500, diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index bb1ed7f5df..bc118538b2 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -42,7 +42,7 @@ * @author Anton Babushkin */ -#include +#include #include #include #include @@ -275,7 +275,7 @@ int commander_main(int argc, char *argv[]) } thread_should_exit = false; - daemon_task = task_spawn_cmd("commander", + daemon_task = px4_task_spawn_cmd("commander", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 40, 3400, diff --git a/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp b/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp index e0b4cb2a0d..db817e2bce 100644 --- a/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp +++ b/src/modules/ekf_att_pos_estimator/ekf_att_pos_estimator_main.cpp @@ -43,7 +43,7 @@ #include "AttitudePositionEstimatorEKF.h" #include "estimator_22states.h" -#include +#include #include #include #include @@ -281,7 +281,7 @@ AttitudePositionEstimatorEKF::~AttitudePositionEstimatorEKF() /* if we have given up, kill it */ if (++i > 50) { - task_delete(_estimator_task); + px4_task_delete(_estimator_task); break; } } while (_estimator_task != -1); @@ -1035,7 +1035,7 @@ int AttitudePositionEstimatorEKF::start() ASSERT(_estimator_task == -1); /* start the task */ - _estimator_task = task_spawn_cmd("ekf_att_pos_estimator", + _estimator_task = px4_task_spawn_cmd("ekf_att_pos_estimator", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 40, 7500, diff --git a/src/modules/fixedwing_backside/fixedwing_backside_main.cpp b/src/modules/fixedwing_backside/fixedwing_backside_main.cpp index bd14863247..4c0a7d36d3 100644 --- a/src/modules/fixedwing_backside/fixedwing_backside_main.cpp +++ b/src/modules/fixedwing_backside/fixedwing_backside_main.cpp @@ -39,7 +39,7 @@ * Fixedwing backside controller using control library */ -#include +#include #include #include #include @@ -111,7 +111,7 @@ int fixedwing_backside_main(int argc, char *argv[]) thread_should_exit = false; - deamon_task = task_spawn_cmd("fixedwing_backside", + deamon_task = px4_task_spawn_cmd("fixedwing_backside", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 10, 5120, diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp index 0a8d07fed9..43124db895 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -41,7 +41,7 @@ * */ -#include +#include #include #include #include @@ -424,7 +424,7 @@ FixedwingAttitudeControl::~FixedwingAttitudeControl() /* if we have given up, kill it */ if (++i > 50) { - task_delete(_control_task); + px4_task_delete(_control_task); break; } } while (_control_task != -1); @@ -1117,7 +1117,7 @@ FixedwingAttitudeControl::start() ASSERT(_control_task == -1); /* start the task */ - _control_task = task_spawn_cmd("fw_att_control", + _control_task = px4_task_spawn_cmd("fw_att_control", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 5, 1600, diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp index 34265d6a4e..76093a5f93 100644 --- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp +++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp @@ -51,7 +51,7 @@ * @author Thomas Gubler */ -#include +#include #include #include #include @@ -542,7 +542,7 @@ FixedwingPositionControl::~FixedwingPositionControl() /* if we have given up, kill it */ if (++i > 50) { - task_delete(_control_task); + px4_task_delete(_control_task); break; } } while (_control_task != -1); @@ -1621,7 +1621,7 @@ FixedwingPositionControl::start() ASSERT(_control_task == -1); /* start the task */ - _control_task = task_spawn_cmd("fw_pos_control_l1", + _control_task = px4_task_spawn_cmd("fw_pos_control_l1", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 5, 1600, diff --git a/src/modules/land_detector/land_detector_main.cpp b/src/modules/land_detector/land_detector_main.cpp index b4b7c33a20..e0402419ff 100644 --- a/src/modules/land_detector/land_detector_main.cpp +++ b/src/modules/land_detector/land_detector_main.cpp @@ -38,6 +38,7 @@ * @author Johan Jansen */ +#include //usleep #include //usleep #include #include @@ -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, diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index ba049bac40..4956bbb9db 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -39,7 +39,7 @@ * @author Anton Babushkin */ -#include +#include #include #include #include @@ -242,7 +242,7 @@ Mavlink::~Mavlink() /* if we have given up, kill it */ if (++i > 50) { //TODO store main task handle in Mavlink instance to allow killing task - //task_delete(_mavlink_task); + //px4_task_delete(_mavlink_task); break; } } while (_task_running); @@ -1618,7 +1618,7 @@ Mavlink::start(int argc, char *argv[]) // between the starting task and the spawned // task - start_helper() only returns // when the started task exits. - task_spawn_cmd(buf, + px4_task_spawn_cmd(buf, SCHED_DEFAULT, SCHED_PRIORITY_DEFAULT, 2400, diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index 3a0dfe4c3b..8898433c84 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -53,7 +53,7 @@ * If rotation matrix setpoint is invalid it will be generated from Euler angles for compatibility with old position controllers. */ -#include +#include #include #include #include @@ -404,7 +404,7 @@ MulticopterAttitudeControl::~MulticopterAttitudeControl() /* if we have given up, kill it */ if (++i > 50) { - task_delete(_control_task); + px4_task_delete(_control_task); break; } } while (_control_task != -1); @@ -905,7 +905,7 @@ MulticopterAttitudeControl::start() ASSERT(_control_task == -1); /* start the task */ - _control_task = task_spawn_cmd("mc_att_control", + _control_task = px4_task_spawn_cmd("mc_att_control", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 5, 1600, diff --git a/src/modules/mc_att_control_multiplatform/mc_att_control_start_nuttx.cpp b/src/modules/mc_att_control_multiplatform/mc_att_control_start_nuttx.cpp index dec1e1745d..6d16e0155d 100644 --- a/src/modules/mc_att_control_multiplatform/mc_att_control_start_nuttx.cpp +++ b/src/modules/mc_att_control_multiplatform/mc_att_control_start_nuttx.cpp @@ -36,6 +36,7 @@ * * @author Thomas Gubler */ +#include #include #include #include @@ -68,7 +69,7 @@ int mc_att_control_m_main(int argc, char *argv[]) task_should_exit = false; - daemon_task = task_spawn_cmd("mc_att_control_m", + daemon_task = px4_task_spawn_cmd("mc_att_control_m", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 5, 1900, diff --git a/src/modules/mc_pos_control/mc_pos_control_main.cpp b/src/modules/mc_pos_control/mc_pos_control_main.cpp index 5191a4de3b..867521cc27 100644 --- a/src/modules/mc_pos_control/mc_pos_control_main.cpp +++ b/src/modules/mc_pos_control/mc_pos_control_main.cpp @@ -50,6 +50,7 @@ */ #include +#include #include #include #include @@ -384,7 +385,7 @@ MulticopterPositionControl::~MulticopterPositionControl() /* if we have given up, kill it */ if (++i > 50) { - task_delete(_control_task); + px4_task_delete(_control_task); break; } } while (_control_task != -1); @@ -1423,7 +1424,7 @@ MulticopterPositionControl::start() ASSERT(_control_task == -1); /* start the task */ - _control_task = task_spawn_cmd("mc_pos_control", + _control_task = px4_task_spawn_cmd("mc_pos_control", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 5, 1600, diff --git a/src/modules/mc_pos_control_multiplatform/mc_pos_control_start_nuttx.cpp b/src/modules/mc_pos_control_multiplatform/mc_pos_control_start_nuttx.cpp index 0db67d83ff..bd67366cf6 100644 --- a/src/modules/mc_pos_control_multiplatform/mc_pos_control_start_nuttx.cpp +++ b/src/modules/mc_pos_control_multiplatform/mc_pos_control_start_nuttx.cpp @@ -36,6 +36,7 @@ * * @author Thomas Gubler */ +#include #include #include #include @@ -68,7 +69,7 @@ int mc_pos_control_m_main(int argc, char *argv[]) task_should_exit = false; - daemon_task = task_spawn_cmd("mc_pos_control_m", + daemon_task = px4_task_spawn_cmd("mc_pos_control_m", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 5, 2500, diff --git a/src/modules/navigator/navigator_main.cpp b/src/modules/navigator/navigator_main.cpp index 9691e26a8d..dd07892654 100644 --- a/src/modules/navigator/navigator_main.cpp +++ b/src/modules/navigator/navigator_main.cpp @@ -43,7 +43,7 @@ * @author Thomas Gubler */ -#include +#include #include #include @@ -174,7 +174,7 @@ Navigator::~Navigator() /* if we have given up, kill it */ if (++i > 50) { - task_delete(_navigator_task); + px4_task_delete(_navigator_task); break; } } while (_navigator_task != -1); @@ -515,7 +515,7 @@ Navigator::start() ASSERT(_navigator_task == -1); /* start the task */ - _navigator_task = task_spawn_cmd("navigator", + _navigator_task = px4_task_spawn_cmd("navigator", SCHED_DEFAULT, SCHED_PRIORITY_DEFAULT + 20, 1800, diff --git a/src/modules/segway/segway_main.cpp b/src/modules/segway/segway_main.cpp index b36d56d6d7..7a4c4bb6f6 100644 --- a/src/modules/segway/segway_main.cpp +++ b/src/modules/segway/segway_main.cpp @@ -39,7 +39,7 @@ * Segway controller using control library */ -#include +#include #include #include #include @@ -106,7 +106,7 @@ int segway_main(int argc, char *argv[]) thread_should_exit = false; - deamon_task = task_spawn_cmd("segway", + deamon_task = px4_task_spawn_cmd("segway", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 10, 5120, diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp index 3fc8627c15..7519153805 100644 --- a/src/modules/sensors/sensors.cpp +++ b/src/modules/sensors/sensors.cpp @@ -46,7 +46,7 @@ * @author Anton Babushkin */ -#include +#include #include #include @@ -640,7 +640,7 @@ Sensors::~Sensors() /* if we have given up, kill it */ if (++i > 50) { - task_delete(_sensors_task); + px4_task_delete(_sensors_task); break; } } while (_sensors_task != -1); @@ -2235,7 +2235,7 @@ Sensors::start() ASSERT(_sensors_task == -1); /* start the task */ - _sensors_task = task_spawn_cmd("sensors_task", + _sensors_task = px4_task_spawn_cmd("sensors_task", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 5, 2000, diff --git a/src/modules/uORB/uORB.cpp b/src/modules/uORB/uORB.cpp index b4f81d4293..0effddb2d4 100644 --- a/src/modules/uORB/uORB.cpp +++ b/src/modules/uORB/uORB.cpp @@ -36,7 +36,7 @@ * A lightweight object broker. */ -#include +#include #include @@ -965,7 +965,7 @@ latency_test(orb_id_t T, bool print) /* test pub / sub latency */ - int pubsub_task = task_spawn_cmd("uorb_latency", + int pubsub_task = px4_task_spawn_cmd("uorb_latency", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 5, 1500, diff --git a/src/modules/uavcan/uavcan_main.cpp b/src/modules/uavcan/uavcan_main.cpp index 2d5abf9591..21adcea8a4 100644 --- a/src/modules/uavcan/uavcan_main.cpp +++ b/src/modules/uavcan/uavcan_main.cpp @@ -31,7 +31,7 @@ * ****************************************************************************/ -#include +#include #include #include @@ -109,7 +109,7 @@ UavcanNode::~UavcanNode() /* if we have given up, kill it */ if (--i == 0) { - task_delete(_task); + px4_task_delete(_task); break; } @@ -194,7 +194,7 @@ int UavcanNode::start(uavcan::NodeID node_id, uint32_t bitrate) * Start the task. Normally it should never exit. */ static auto run_trampoline = [](int, char *[]) {return UavcanNode::_instance->run();}; - _instance->_task = task_spawn_cmd("uavcan", SCHED_DEFAULT, SCHED_PRIORITY_ACTUATOR_OUTPUTS, StackSize, + _instance->_task = px4_task_spawn_cmd("uavcan", SCHED_DEFAULT, SCHED_PRIORITY_ACTUATOR_OUTPUTS, StackSize, static_cast(run_trampoline), nullptr); if (_instance->_task < 0) { diff --git a/src/modules/vtol_att_control/vtol_att_control_main.cpp b/src/modules/vtol_att_control/vtol_att_control_main.cpp index defcff8e4a..20af0978a8 100644 --- a/src/modules/vtol_att_control/vtol_att_control_main.cpp +++ b/src/modules/vtol_att_control/vtol_att_control_main.cpp @@ -44,7 +44,7 @@ * */ -#include +#include #include #include #include @@ -298,7 +298,7 @@ VtolAttitudeControl::~VtolAttitudeControl() /* if we have given up, kill it */ if (++i > 50) { - task_delete(_control_task); + px4_task_delete(_control_task); break; } } while (_control_task != -1); @@ -859,7 +859,7 @@ VtolAttitudeControl::start() ASSERT(_control_task == -1); /* start the task */ - _control_task = task_spawn_cmd("vtol_att_control", + _control_task = px4_task_spawn_cmd("vtol_att_control", SCHED_DEFAULT, SCHED_PRIORITY_MAX - 10, 2048,