47 #if defined(__PX4_NUTTX) 48 typedef int px4_task_t;
50 #include <sys/prctl.h> 51 #define px4_prctl prctl 54 #if CONFIG_RR_INTERVAL > 0 55 # define SCHED_DEFAULT SCHED_RR 57 # define SCHED_DEFAULT SCHED_FIFO 60 #define px4_task_exit(x) _exit(x) 62 #elif defined(__PX4_POSIX) || defined(__PX4_QURT) 68 #define SCHED_DEFAULT SCHED_FIFO 70 #if defined(__PX4_LINUX) || defined(__PX4_DARWIN) || defined(__PX4_CYGWIN) 72 #define SCHED_PRIORITY_MAX sched_get_priority_max(SCHED_FIFO) 73 #define SCHED_PRIORITY_MIN sched_get_priority_min(SCHED_FIFO) 74 #define SCHED_PRIORITY_DEFAULT (((sched_get_priority_max(SCHED_FIFO) - sched_get_priority_min(SCHED_FIFO)) / 2) + sched_get_priority_min(SCHED_FIFO)) 76 #elif defined(__PX4_QURT) 78 #define SCHED_PRIORITY_MAX 255 79 #define SCHED_PRIORITY_MIN 0 80 #define SCHED_PRIORITY_DEFAULT 20 83 #error "No target OS defined" 86 #if defined (__PX4_LINUX) 87 #include <sys/prctl.h> 92 typedef int px4_task_t;
100 #error "No target OS defined" 105 #define SCHED_PRIORITY_FAST_DRIVER (SCHED_PRIORITY_MAX - 0) 111 #define SCHED_PRIORITY_ATTITUDE_CONTROL (SCHED_PRIORITY_MAX - 4) 115 #define SCHED_PRIORITY_ACTUATOR_OUTPUTS (SCHED_PRIORITY_MAX - 3) 121 #define SCHED_PRIORITY_POSITION_CONTROL (SCHED_PRIORITY_MAX - 5) 128 #define SCHED_PRIORITY_ESTIMATOR (SCHED_PRIORITY_MAX - 5) 133 #define SCHED_PRIORITY_SENSOR_HUB (SCHED_PRIORITY_MAX - 6) 137 #define SCHED_PRIORITY_LOG_CAPTURE (SCHED_PRIORITY_MAX - 10) 141 #define SCHED_PRIORITY_SLOW_DRIVER (SCHED_PRIORITY_MAX - 35) 144 #define SCHED_PRIORITY_NAVIGATION (SCHED_PRIORITY_DEFAULT + 5) 146 #define SCHED_PRIORITY_LOG_WRITER (SCHED_PRIORITY_DEFAULT - 10) 147 #define SCHED_PRIORITY_PARAMS (SCHED_PRIORITY_DEFAULT - 15) 150 typedef int (*px4_main_t)(
int argc,
char *argv[]);
183 __EXPORT int px4_prctl(
int option,
const char *arg2, px4_task_t pid);
__EXPORT void px4_show_tasks(void)
Show a list of running tasks.
Definition: px4_posix_tasks.cpp:362
__EXPORT int px4_task_delete(px4_task_t pid)
Deletes a task - does not do resource cleanup.
Definition: px4_posix_tasks.cpp:283
__BEGIN_DECLS __EXPORT void px4_systemreset(bool to_bootloader) noreturn_function
Reboots the board (without waiting for clean shutdown).
Definition: px4_nuttx_tasks.c:58
__EXPORT const char * px4_get_taskname(void)
return the name of the current task
Definition: px4_nuttx_tasks.c:106
__EXPORT void px4_task_exit(int ret)
Exit current task with return value.
Definition: px4_posix_tasks.cpp:315
__EXPORT px4_task_t px4_task_spawn_cmd(const char *name, int scheduler, int priority, int stack_size, px4_main_t entry, char *const argv[])
Starts a task and performs any specific accounting, scheduler setup, etc.
Definition: px4_posix_tasks.cpp:121
__EXPORT bool px4_task_is_running(const char *taskname)
See if a task is running.
Definition: px4_posix_tasks.cpp:382
__EXPORT int px4_task_kill(px4_task_t pid, int sig)
Send a signal to a task.
Definition: px4_posix_tasks.cpp:341