mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-05 22:24:47 +08:00
Go back to the FIFO scheduler for now, as we don't have time to shake out the RR scheduler changeover just yet.
Make the "default" scheduler a centralized definition so that changes are easier in future.
This commit is contained in:
@@ -115,7 +115,7 @@ int ardrone_interface_main(int argc, char *argv[])
|
|||||||
|
|
||||||
thread_should_exit = false;
|
thread_should_exit = false;
|
||||||
ardrone_interface_task = task_spawn("ardrone_interface",
|
ardrone_interface_task = task_spawn("ardrone_interface",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_MAX - 15,
|
SCHED_PRIORITY_MAX - 15,
|
||||||
4096,
|
4096,
|
||||||
ardrone_interface_thread_main,
|
ardrone_interface_thread_main,
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ int attitude_estimator_ekf_main(int argc, char *argv[])
|
|||||||
|
|
||||||
thread_should_exit = false;
|
thread_should_exit = false;
|
||||||
attitude_estimator_ekf_task = task_spawn("attitude_estimator_ekf",
|
attitude_estimator_ekf_task = task_spawn("attitude_estimator_ekf",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_MAX - 5,
|
SCHED_PRIORITY_MAX - 5,
|
||||||
20000,
|
20000,
|
||||||
attitude_estimator_ekf_thread_main,
|
attitude_estimator_ekf_thread_main,
|
||||||
|
|||||||
@@ -950,7 +950,7 @@ int commander_main(int argc, char *argv[])
|
|||||||
|
|
||||||
thread_should_exit = false;
|
thread_should_exit = false;
|
||||||
deamon_task = task_spawn("commander",
|
deamon_task = task_spawn("commander",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_MAX - 50,
|
SCHED_PRIORITY_MAX - 50,
|
||||||
4096,
|
4096,
|
||||||
commander_thread_main,
|
commander_thread_main,
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ int px4_deamon_app_main(int argc, char *argv[])
|
|||||||
|
|
||||||
thread_should_exit = false;
|
thread_should_exit = false;
|
||||||
deamon_task = task_spawn("deamon",
|
deamon_task = task_spawn("deamon",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_DEFAULT,
|
SCHED_PRIORITY_DEFAULT,
|
||||||
4096,
|
4096,
|
||||||
px4_deamon_thread_main,
|
px4_deamon_thread_main,
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ int fixedwing_control_main(int argc, char *argv[])
|
|||||||
|
|
||||||
thread_should_exit = false;
|
thread_should_exit = false;
|
||||||
deamon_task = task_spawn("fixedwing_control",
|
deamon_task = task_spawn("fixedwing_control",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_MAX - 20,
|
SCHED_PRIORITY_MAX - 20,
|
||||||
4096,
|
4096,
|
||||||
fixedwing_control_thread_main,
|
fixedwing_control_thread_main,
|
||||||
|
|||||||
+1
-1
@@ -143,7 +143,7 @@ int gps_main(int argc, char *argv[])
|
|||||||
|
|
||||||
thread_should_exit = false;
|
thread_should_exit = false;
|
||||||
deamon_task = task_spawn("gps",
|
deamon_task = task_spawn("gps",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_DEFAULT,
|
SCHED_PRIORITY_DEFAULT,
|
||||||
4096,
|
4096,
|
||||||
gps_thread_main,
|
gps_thread_main,
|
||||||
|
|||||||
@@ -1872,7 +1872,7 @@ int mavlink_main(int argc, char *argv[])
|
|||||||
|
|
||||||
thread_should_exit = false;
|
thread_should_exit = false;
|
||||||
mavlink_task = task_spawn("mavlink",
|
mavlink_task = task_spawn("mavlink",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_DEFAULT,
|
SCHED_PRIORITY_DEFAULT,
|
||||||
6000,
|
6000,
|
||||||
mavlink_thread_main,
|
mavlink_thread_main,
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ int multirotor_att_control_main(int argc, char *argv[])
|
|||||||
|
|
||||||
thread_should_exit = false;
|
thread_should_exit = false;
|
||||||
mc_task = task_spawn("multirotor_att_control",
|
mc_task = task_spawn("multirotor_att_control",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_MAX - 15,
|
SCHED_PRIORITY_MAX - 15,
|
||||||
4096,
|
4096,
|
||||||
mc_thread_main,
|
mc_thread_main,
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ FMUServo::init()
|
|||||||
|
|
||||||
/* start the IO interface task */
|
/* start the IO interface task */
|
||||||
_task = task_spawn("fmuservo",
|
_task = task_spawn("fmuservo",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_DEFAULT,
|
SCHED_PRIORITY_DEFAULT,
|
||||||
1024,
|
1024,
|
||||||
(main_t)&FMUServo::task_main_trampoline,
|
(main_t)&FMUServo::task_main_trampoline,
|
||||||
|
|||||||
+2
-2
@@ -109,7 +109,7 @@ usage(const char *reason)
|
|||||||
* Makefile does only apply to this management task.
|
* Makefile does only apply to this management task.
|
||||||
*
|
*
|
||||||
* The actual stack size should be set in the call
|
* The actual stack size should be set in the call
|
||||||
* to task_create().
|
* to task_spawn().
|
||||||
*/
|
*/
|
||||||
int sdlog_main(int argc, char *argv[])
|
int sdlog_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -126,7 +126,7 @@ int sdlog_main(int argc, char *argv[])
|
|||||||
|
|
||||||
thread_should_exit = false;
|
thread_should_exit = false;
|
||||||
deamon_task = task_spawn("sdlog",
|
deamon_task = task_spawn("sdlog",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_DEFAULT - 30,
|
SCHED_PRIORITY_DEFAULT - 30,
|
||||||
4096,
|
4096,
|
||||||
sdlog_thread_main,
|
sdlog_thread_main,
|
||||||
|
|||||||
@@ -1174,7 +1174,7 @@ Sensors::start()
|
|||||||
|
|
||||||
/* start the task */
|
/* start the task */
|
||||||
_sensors_task = task_spawn("sensors_task",
|
_sensors_task = task_spawn("sensors_task",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_MAX - 5,
|
SCHED_PRIORITY_MAX - 5,
|
||||||
6000, /* XXX may be excesssive */
|
6000, /* XXX may be excesssive */
|
||||||
(main_t)&Sensors::task_main_trampoline,
|
(main_t)&Sensors::task_main_trampoline,
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ int led_main(int argc, char *argv[])
|
|||||||
|
|
||||||
thread_should_exit = false;
|
thread_should_exit = false;
|
||||||
led_task = task_spawn("led",
|
led_task = task_spawn("led",
|
||||||
SCHED_RR,
|
SCHED_DEFAULT,
|
||||||
SCHED_PRIORITY_MAX - 15,
|
SCHED_PRIORITY_MAX - 15,
|
||||||
4096,
|
4096,
|
||||||
led_thread_main,
|
led_thread_main,
|
||||||
|
|||||||
@@ -138,9 +138,8 @@ int task_spawn(const char *name, int scheduler, int priority, int stack_size, ma
|
|||||||
param.sched_priority = priority;
|
param.sched_priority = priority;
|
||||||
sched_setscheduler(pid, scheduler, ¶m);
|
sched_setscheduler(pid, scheduler, ¶m);
|
||||||
|
|
||||||
/* XXX do any other private task accounting here */
|
/* XXX do any other private task accounting here before the task starts */
|
||||||
}
|
}
|
||||||
|
|
||||||
sched_unlock();
|
sched_unlock();
|
||||||
|
|
||||||
return pid;
|
return pid;
|
||||||
|
|||||||
@@ -50,6 +50,13 @@ __EXPORT int reboot(void);
|
|||||||
/** Sends SIGUSR1 to all processes */
|
/** Sends SIGUSR1 to all processes */
|
||||||
__EXPORT void killall(void);
|
__EXPORT void killall(void);
|
||||||
|
|
||||||
|
/** Default scheduler type */
|
||||||
|
#if CONFIG_RR_INTERVAL > 0
|
||||||
|
# define SCHED_DEFAULT SCHED_RR
|
||||||
|
#else
|
||||||
|
# define SCHED_DEFAULT SCHED_FIFO
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Starts a task and performs any specific accounting, scheduler setup, etc. */
|
/** Starts a task and performs any specific accounting, scheduler setup, etc. */
|
||||||
__EXPORT int task_spawn(const char *name,
|
__EXPORT int task_spawn(const char *name,
|
||||||
int priority,
|
int priority,
|
||||||
|
|||||||
@@ -546,7 +546,7 @@ CONFIG_HAVE_CXXINITIALIZE=n
|
|||||||
CONFIG_MM_REGIONS=2
|
CONFIG_MM_REGIONS=2
|
||||||
CONFIG_ARCH_LOWPUTC=y
|
CONFIG_ARCH_LOWPUTC=y
|
||||||
CONFIG_MSEC_PER_TICK=1
|
CONFIG_MSEC_PER_TICK=1
|
||||||
CONFIG_RR_INTERVAL=1
|
CONFIG_RR_INTERVAL=0
|
||||||
CONFIG_SCHED_INSTRUMENTATION=y
|
CONFIG_SCHED_INSTRUMENTATION=y
|
||||||
CONFIG_TASK_NAME_SIZE=24
|
CONFIG_TASK_NAME_SIZE=24
|
||||||
CONFIG_START_YEAR=1970
|
CONFIG_START_YEAR=1970
|
||||||
|
|||||||
Reference in New Issue
Block a user