px4::init_once();
-
void init_once()
-
{
-
_shell_task_id = pthread_self(); //获取自生PID
-
//printf("[init] shell id: %lu\n", (unsigned long)_shell_task_id);
-
work_queues_init(); //工作队列初始化? 创建了一个高优先级和一个低优先级工作线程
-
hrt_work_queue_init(); //创建了一个最高优先级的工作队列?
-
hrt_init(); //初始化了hrt信号量?
-
param_init(); //初始化了param_sem和reader_lock_holders_lock信号量
-
-
#ifdef CONFIG_SHMEM
-
PX4_DEBUG("Syncing params to shared memory\n");
-
init_params();
-
#endif
-
}
px4::init(argc, argv, "px4");
画了一个px4。
-
void init(int argc, char *argv[], const char *app_name)
-
{
-
printf("\n");
-
printf("______ __ __ ___ \n");
-
printf("| ___ \\ \\ \\ / / / |\n");
-
printf("| |_/ / \\ V / / /| |\n");
-
printf("| __/ / \\ / /_| |\n");
-
printf("| | / /^\\ \\ \\___ |\n");
-
printf("\\_| \\/ \\/ |_/\n");
-
printf("\n");
-
printf("%s starting.\n", app_name);
-
printf("\n");
-
-
// set the threads name
-
#ifdef __PX4_DARWIN
-
(void)pthread_setname_np(app_name);
-
#else
-
(void)pthread_setname_np(pthread_self(), app_name);
-
#endif
-
}
阅读(647) | 评论(0) | 转发(0) |