Пример #1
0
void lcd1602_FileNameRollStart()
{
    lcd_thread_filename = rt_thread_create("lcdFN", lcd1602_FileNameRoll, (void *)0, 1024, 7, 20);

    if (lcd_thread_filename != RT_NULL)
    {
        rt_thread_startup(lcd_thread_filename);
    }
}
Пример #2
0
int rt_application_init()
{
    rt_thread_t init_thread;
    rt_err_t result;
    
	result = rt_sem_init(&sem, "sem", 0, RT_IPC_FLAG_FIFO);
	if (result != RT_EOK)
	{
        rt_kprintf("error, init sem failed!\n");
		return 0;
	}
    
#if (RT_THREAD_PRIORITY_MAX == 32)
    init_thread = rt_thread_create("init",
                                   rt_init_thread_entry, RT_NULL,
                                   2048, 8, 20);
#else
    init_thread = rt_thread_create("init",
                                   rt_init_thread_entry, RT_NULL,
                                   2048, 80, 20);
#endif

    if (init_thread != RT_NULL)
        rt_thread_startup(init_thread);

    //------- init thread1
    rt_thread_init(&thread1,
                   "keyp", //producer
                   rt_thread_entry1,
                   RT_NULL,
                   &thread1_stack[0],
                   sizeof(thread1_stack),11,25);
    rt_thread_startup(&thread1);
    
    //------- init thread2
    rt_thread_init(&thread2,
                   "keyc", //consumer
                   rt_thread_entry2,
                   RT_NULL,
                   &thread2_stack[0],
                   sizeof(thread2_stack),11,24);
    rt_thread_startup(&thread2);
    return 0;
}
/// Create a thread and add it to Active Threads and set it to state READY
osThreadId osThreadCreate(osThreadDef_t *thread_def, void *argument)
{
	osThreadId thread;
	
	thread = rt_thread_create(thread_def->name, thread_def->entry, argument, thread_def->stack_size, thread_def->priority, thread_def->tick);	
	if (thread != RT_NULL)
        rt_thread_startup(thread); 	

	return thread;
}
Пример #4
0
int rt_application_init(void)
{
    rt_thread_t tid;
    tid = rt_thread_create("init",
                           rt_init_thread_entry, RT_NULL,
                           2048, RT_THREAD_PRIORITY_MAX / 3, 20);
    if (tid != RT_NULL) rt_thread_startup(tid);

    return 0;
}
Пример #5
0
int rt_application_init(void)
{
    rt_thread_t init_thread = NULL;
    rt_thread_init(&thread_sys_monitor,
                   "sys_monitor",
                   thread_entry_sys_monitor,
                   RT_NULL,
                   thread_sys_monitor_stack,
                   sizeof(thread_sys_monitor_stack),
                   thread_sys_monitor_prio, 5);
    rt_thread_startup(&thread_sys_monitor);

    init_thread = rt_thread_create("sys init", sys_init_thread,
            NULL, 512, 10, 10);
    if (init_thread != NULL) {
        rt_thread_startup(init_thread);
    }
    return 0;
}
Пример #6
0
void info_init()
{
    rt_thread_t tid;

    tid = rt_thread_create("info",
        info_entry, RT_NULL,
        2048, 25, 10);

    if (tid != RT_NULL) rt_thread_startup(tid);
}
Пример #7
0
int rt_application_init(void)
{
    rt_thread_t init_thread;

    rt_err_t result;

#if (RT_THREAD_PRIORITY_MAX == 32)
    init_thread = rt_thread_create("init",
                                   rt_init_thread_entry, RT_NULL,
                                   2048, 8, 20);
#else
    init_thread = rt_thread_create("init",
                                   rt_init_thread_entry, RT_NULL,
                                   2048, 80, 20);
#endif

    if (init_thread != RT_NULL)
        rt_thread_startup(init_thread);


    /* init led thread */
    result = rt_thread_init(&adc_thread,
                            "adc",
                            adc_thread_entry,
                            RT_NULL,
                            (rt_uint8_t*)&adc_stack[0],
                            sizeof(adc_stack),
                            10,5);
     rt_thread_startup(&adc_thread);			

    /* init main thread */
    result = rt_thread_init(&main_thread,
                            "main",
                            main_thread_entry,
                            RT_NULL,
                            (rt_uint8_t*)&main_stack[0],
                            sizeof(main_stack),
                            2,1);
     rt_thread_startup(&main_thread);								


    return 0;
}
Пример #8
0
void libc_sem()
{
	rt_thread_t tid;

	tid = rt_thread_create("semtest", test_thread, RT_NULL,
						   2048, 20, 5);
	if (tid != RT_NULL) {
		rt_thread_startup(tid);
	}
}
Пример #9
0
void webnet_init(void)
{
	rt_thread_t tid;

	tid = rt_thread_create(WEBNET_THREAD_NAME,
		webnet_thread, RT_NULL,
		WEBNET_THREAD_STACKSIZE, WEBNET_PRIORITY, 5);

	if (tid != RT_NULL) rt_thread_startup(tid);
}
Пример #10
0
//gps log initialization
void thread_slow_log_init(void)
{
	rt_thread_init(&thread_slow_log_handle,
                   "log slow",
                   entry_thread_slow_log,
                   RT_NULL,
                   &thread_slow_log_stack[0],
                   sizeof(thread_slow_log_stack),25,1);
    rt_thread_startup(&thread_slow_log_handle);
}
Пример #11
0
int rt_application_init()
{
    rt_thread_t tid;

    tid = rt_thread_create("init", init_thread, RT_NULL, 
        1024, RT_THREAD_PRIORITY_MAX/3, 10);
    if (tid != RT_NULL) rt_thread_startup(tid);

    return 0;
}
Пример #12
0
void today_init()
{
    rt_thread_t tid;

    tid = rt_thread_create("today",
        today_entry, RT_NULL,
        2048, 25, 10);

    if (tid != RT_NULL) rt_thread_startup(tid);
}
Пример #13
0
void chargen_init(void)
{
    rt_thread_t chargen;

    chargen = rt_thread_create(CHARGEN_THREAD_NAME,
                               chargen_thread, RT_NULL,
                               CHARGEN_THREAD_STACKSIZE,
                               CHARGEN_PRIORITY, 5);
    if (chargen != RT_NULL) rt_thread_startup(chargen);
}
Пример #14
0
void window(void)
{
	rt_thread_t tid;
	static rt_uint32_t no = 0;

	tid = rt_thread_create("win", window_entry, (void*)no, 2048, 20, 5);
	if (tid != RT_NULL) rt_thread_startup(tid);

	no ++;
}
Пример #15
0
int apps_copter_init(void)
{
  rt_thread_t attitude_thread,data_transmit_thread,receiver_thread,attitude_outter_thread;
	
	//初始化IMU(惯性测量单元)
	IMU_Init();	
	
	//初始化飞行控制
	fc.Init();
	
	//初始化参数
	Params_Init();
	
	//初始化Transmiter
   cmd.Init("tcpserv");
	
	attitude_thread = rt_thread_create("attitude",attitude_thread_entry,RT_NULL,1024,12,5);
	if(attitude_thread != RT_NULL)
	{
		rt_thread_startup(attitude_thread);
	}
	
	attitude_outter_thread = rt_thread_create("att_outter",attitude_outter_thread_entry,RT_NULL,1024,11,5);
	if(attitude_thread != RT_NULL)
	{
		rt_thread_startup(attitude_outter_thread);
	}
	
	
	
	data_transmit_thread = rt_thread_create("transmit",data_transmit_thread_entry,RT_NULL,1024,13,5);
	if(data_transmit_thread != RT_NULL)
	{
		rt_thread_startup(data_transmit_thread);
	}
		receiver_thread = rt_thread_create("receiver",receiver_thread_entry,RT_NULL,1024,14,5);
	if(receiver_thread != RT_NULL)
	{
		rt_thread_startup(receiver_thread);
	}
	return 0;
}
Пример #16
0
int rt_application_init(void)
{
    rt_thread_t init_thread;

    rt_err_t result;


#if (RT_THREAD_PRIORITY_MAX == 32)
    init_thread = rt_thread_create("init",
                                   rt_init_thread_entry, RT_NULL,
                                   2048, 8, 20);
#else
    init_thread = rt_thread_create("init",
                                   rt_init_thread_entry, RT_NULL,
                                   2048, 80, 20);
#endif

    if (init_thread != RT_NULL)
        rt_thread_startup(init_thread);
	
	//------- can
    rt_thread_init(&thread_can_handle,
                   "can",
                   rt_entry_thread_can,
                   RT_NULL,
                   &thread_can_stack[0],
                   sizeof(thread_can_stack),3,1);
    rt_thread_startup(&thread_can_handle);
	
	//------- main
    rt_thread_init(&thread_main_handle,
                   "main",
                   rt_entry_thread_main,
                   RT_NULL,
                   &thread_main_stack[0],
                   sizeof(thread_main_stack),2,1);
   // rt_thread_startup(&thread_main_handle); //not start up until can bus have finished the initialization
	


    return 0;
}
Пример #17
0
int rt_application_init()
{
    rt_thread_t tid;

    tid = rt_thread_create("init",
                           rt_init_thread_entry, RT_NULL,
                           2048, 8, 20);
    if (tid != RT_NULL) rt_thread_startup(tid);

    return 0;
}
Пример #18
0
int rt_application_init(void)
{
	rt_thread_t init_thread;
	rt_thread_t led_thread;

	init_thread = rt_thread_create("init",
								rt_init_thread_entry, RT_NULL,
								RT_INIT_THREAD_STACK_SIZE, 8, 20);
	led_thread = rt_thread_create("led",
								rt_led_thread_entry, RT_NULL,
								512, 200, 20);

	if (init_thread != RT_NULL)
		rt_thread_startup(init_thread);

	if (led_thread != RT_NULL)
		rt_thread_startup(led_thread);
	
	return 0;
}
Пример #19
0
//gps log initialization
void thread_kml_log_init(void)
{
	//gps
	rt_thread_init(&thread_kml_log_handle,
                   "kml gps",
                   entry_thread_kml_log,
                   RT_NULL,
                   &thread_kml_log_stack[0],
                   sizeof(thread_kml_log_stack),26,1);
    rt_thread_startup(&thread_kml_log_handle);
}
Пример #20
0
int rt_can_app_init(void)
{
    rt_thread_t tid;

    tid = rt_thread_create("canapp1",
                           rt_can_thread_entry, &can_data[0],
                           512, RT_THREAD_PRIORITY_MAX /3 - 1, 20);
    if (tid != RT_NULL) rt_thread_startup(tid);

    return 0;
}
Пример #21
0
/* 创建hmc子线程 */
void thread_hmc_init(void)
{
	//mpu
	rt_thread_init(&thread_hmc_handle,
                   "hmc",
                   entry_thread_hmc,
                   RT_NULL,
                   &thread_hmc_stack[0],
                   sizeof(thread_hmc_stack),6,1);
    rt_thread_startup(&thread_hmc_handle);
}
Пример #22
0
/* 创建mpu子线程 */
void thread_mpu_init(void)
{
	//mpu
	rt_thread_init(&thread_mpu_handle,
                   "mpu",
                   entry_thread_mpu,
                   RT_NULL,
                   &thread_mpu_stack[0],
                   sizeof(thread_mpu_stack),6,1);
    rt_thread_startup(&thread_mpu_handle);
}
Пример #23
0
/* 创建AIR PRESS 子线程 */
void thread_air_press_init(void)
{
	//air_press
	rt_thread_init(&thread_air_press_handle,
                   "airpress",
                   entry_thread_air_press,
                   RT_NULL,
                   &thread_air_press_stack[0],
                   sizeof(thread_air_press_stack),7,1);
    rt_thread_startup(&thread_air_press_handle);
}
Пример #24
0
void usbh_init(void)
{

    rt_thread_init(&thread_usbmsc,
                   "usbmsc",
                   rt_thread_entry_usbmsc,
                   RT_NULL,
                   &thread_usbmsc_stack[0],
                   sizeof(thread_usbmsc_stack),19,5);
    rt_thread_startup(&thread_usbmsc);
}
Пример #25
0
void gprswatch(void)
{
  /* 创建gprswatch线程*/
  rt_thread_t thread = rt_thread_create("gprswatch",
  gprswatch_entry, RT_NULL,
  1024, 25, 7);
  
  /* 创建成功则启动线程*/
  if (thread != RT_NULL)
    rt_thread_startup(thread);
}
Пример #26
0
int rf1start(void)
{ 
    rt_thread_t tid;

    tid = rt_thread_create("rf1",
        rt_rf_thread_entry, RT_NULL,
        2048, RT_THREAD_PRIORITY_MAX-11, 10);
    if (tid != RT_NULL) rt_thread_startup(tid);

    return 0;
}
Пример #27
0
/***********************************************************
* Function:
* Description:
* Input:
* Input:
* Output:
* Return:
* Others:
***********************************************************/
void hmi_init( void )
{
    rt_thread_t tid;
    rt_thread_init( &thread_hmi,
                    "hmi",
                    rt_thread_entry_hmi,
                    RT_NULL,
                    &thread_hmi_stack[0],
                    sizeof( thread_hmi_stack ), 17, 5 );
    rt_thread_startup( &thread_hmi );
}
Пример #28
0
int picture_init(void)
{
	rt_thread_t tid;

    tid = rt_thread_create("PicViwer", picture_thread, RT_NULL,
        2048, 20, 20);
    if (tid != RT_NULL)
        rt_thread_startup(tid);

	return 0;
}
Пример #29
0
/*RS485设备初始化*/
void SD_test_init( void )
{
	//rt_sem_init( &sem_RS485, "sem_RS485", 0, 0 );
	rt_thread_init( &thread_sd_test,
	                "sd_test",
	                rt_thread_entry_sd_test,
	                RT_NULL,
	                &thread_sd_test_stack[0],
	                sizeof( thread_sd_test_stack ), 9, 5 );
	rt_thread_startup( &thread_sd_test );
}
Пример #30
0
int rt_application_init()
{
    rt_thread_t init_thread;

    init_thread = rt_thread_create("init",
                                   rt_init_thread_entry, RT_NULL,
                                   2048, RT_THREAD_PRIORITY_MAX/3, 20);
    if (init_thread != RT_NULL)
        rt_thread_startup(init_thread);

    //------- init led1 thread
    rt_thread_init(&thread_led1,
                   "led_demo",
                   rt_thread_entry_led1,
                   RT_NULL,
                   &thread_led1_stack[0],
                   sizeof(thread_led1_stack),11,5);
    rt_thread_startup(&thread_led1);

    return 0;
}