Exemplo n.º 1
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
	/* init board */
	rt_hw_board_init();

	/* show version */
	rt_show_version();

	/* init tick */
	rt_system_tick_init();

	/* init kernel object */
	rt_system_object_init();

	/* init timer system */
	rt_system_timer_init();

#ifdef RT_USING_HEAP
#if STM32_EXT_SRAM
	rt_system_heap_init((void*)STM32_EXT_SRAM_BEGIN, (void*)STM32_EXT_SRAM_END);
#else
	#ifdef __CC_ARM
		rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)STM32_SRAM_END);
	#elif __ICCARM__
	    rt_system_heap_init(__segment_end("HEAP"), (void*)STM32_SRAM_END);
	#else
		/* init memory system */
		rt_system_heap_init((void*)&__bss_end, (void*)STM32_SRAM_END);
	#endif
#endif
#endif

	/* init scheduler system */
	rt_system_scheduler_init();

#ifdef RT_USING_DFS
	/* init sdcard driver */
#if STM32_USE_SDIO
	rt_hw_sdcard_init();
#else
	rt_hw_msd_init();
#endif
#endif

	rt_hw_rtc_init();

	/* init application */
	rt_application_init();

#ifdef RT_USING_FINSH
	/* init finsh */
	finsh_system_init();
	finsh_set_device("uart1");
#endif

    /* init timer thread */
    rt_system_timer_thread_init();

	/* init idle thread */
	rt_thread_idle_init();

	/* start scheduler */
	rt_system_scheduler_start();

	/* never reach here */
	return ;
}
Exemplo n.º 2
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
	/* init board */
	rt_hw_board_init(); 
	

          //------------------------------------------
      #if 0    
       rt_kprintf("\n\r   starting...--------->>>>>>\r\n ");   

	//WatchDogInit();    
		 while(1)
	   	{      
	   	/* Insert 40 ms delay */
              DF_delay_us(1000);
		//IWDG_ReloadCounter();  
		}
     #endif     	


     #if  0
      rt_kprintf("\n\r   starting...\r\n ");   
	 


  while (1)
  {
     DF_delay_us(1000);
    /* Reload IWDG counter */
    //IWDG_ReloadCounter();  
  }
	 
 
	 
    #endif 	 
   rt_kprintf("\n\r   天津广通公司 北斗车载终端 GGHYPT  TW703-BD--14-9-17   Version 1.5 双Module  客运+货运    \r\n ");       
	/* show version */
	rt_show_version(); 

	/* init tick */
	rt_system_tick_init();

	/* init kernel object */
	rt_system_object_init();

	/* init timer system */
	rt_system_timer_init();

      rt_system_heap_init((void*)STM32_SRAM_BEGIN, (void*)STM32_SRAM_END);

	/* init scheduler system */
	rt_system_scheduler_init();

	/* init all device */
	rt_device_init_all();   

//------------------- Device  thread ----------------------------------
       


#ifdef RT_USING_FINSH
	/* init finsh */
	finsh_system_init();
	finsh_set_device( FINSH_DEVICE_NAME ); // mount on
#endif

    
     //---------------App Thread	 -----------------------	     
     Init_lcdkey(); //  提前初始化LCD  pins	
     delay_ms(1000); // 屏rst 拉低    维持一段时间 
     lcd_init();
// #ifdef  GSM_UART
		_gsm_startup();
 //#endif

 // #ifdef APP808
        Protocol_app_init();   
 // #endif
 
 // #ifdef _485_DEVICE
      _485_startup();
 // #endif

 // #ifdef GPS_UART
	  // gps_init();     
       mma8451_driver_init();      
 // #endif

     printer_driver_init();   

   //---  RTC  device Register--------------- 
    if( rt_hw_rtc_init()==1)
	{
	    RTC_Demo_init();   // Debug  Test  use  
	    rt_kprintf("\n\r   RTC -first conifg\r\n "); 
    }
  
	/* init application_ demo */
	rt_application_init();
  


// -------------------------------------------------------------------------

    /* init timer thread */
      rt_system_timer_thread_init(); 

	/* init idle thread */
	rt_thread_idle_init();

	/* start scheduler */
	rt_system_scheduler_start();

	/* never reach here */
	return ;
}
Exemplo n.º 3
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
	/* init board */
	rt_hw_board_init();

	/* show version */
	rt_show_version();

	/* init tick */
	rt_system_tick_init();

	/* init kernel object */
	rt_system_object_init();

	/* init timer system */
	rt_system_timer_init();

#ifdef RT_USING_HEAP
#ifdef __CC_ARM
	rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)LM3S_SRAM_END);
#elif __ICCARM__
	rt_system_heap_init(__segment_end("HEAP"), (void*)LM3S_SRAM_END);
#else
	/* init memory system */
	rt_system_heap_init((void*)&__bss_end, (void*)LM3S_SRAM_END);
#endif
#endif

#ifdef RT_USING_MODULE
	/* init module system */
	rt_system_module_init();
#endif

	/* init scheduler system */
	rt_system_scheduler_init();

#ifdef RT_USING_LWIP
	eth_system_device_init();

	/* register ethernetif device */
	rt_hw_luminaryif_init();
#endif

	/* init hardware serial device */
	rt_hw_serial_init();
#ifdef RT_USING_DFS
	/* init sd card device */
	rt_hw_sdcard_init();
#endif

	/* init application */
	rt_application_init();

#ifdef RT_USING_FINSH
	/* init finsh */
	finsh_system_init();
#ifdef RT_USING_DEVICE
	finsh_set_device("uart1");
#endif
#endif

	/* init idle thread */
	rt_thread_idle_init();

	/* start scheduler */
	rt_system_scheduler_start();

	/* never reach here */
	return ;
}
Exemplo n.º 4
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
	/* init hardware interrupt */
	rt_hw_interrupt_init();

	/* init board */
	rt_hw_board_init();
	
	rt_show_version();

	/* init tick */
	rt_system_tick_init();

	/* init kernel object */
	rt_system_object_init();

	/* init timer system */
	rt_system_timer_init();

#ifdef RT_USING_HEAP
#ifdef __CC_ARM
	rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)0x00210000);
#elif __ICCARM__
    rt_system_heap_init(__segment_end("HEAP"), (void*)0x00210000);
#else
	rt_system_heap_init(&__bss_end, 0x00210000);
#endif
#endif

	/* init scheduler system */
	rt_system_scheduler_init();

#ifdef RT_USING_HOOK /* if the hook is used */
	/* set idle thread hook */
	rt_thread_idle_sethook(led_flash);
#endif

#ifdef RT_USING_DEVICE
	/* init hardware serial device */
	rt_hw_serial_init();

#ifdef RT_USING_LWIP
	eth_system_device_init();

	/* register AT91 EMAC device */
	sam7xether_register("E0");
#endif

#ifdef RT_USING_DFS
	rt_hw_sdcard_init();
#endif

	/*init all registed devices*/
	rt_device_init_all();
#endif

	/* init application */
	rt_application_init();

#ifdef RT_USING_FINSH
	/* init finsh */
	finsh_system_init();
	finsh_set_device("uart1");
#endif

	/* init idle thread */
	rt_thread_idle_init();

	/* start scheduler */
	rt_system_scheduler_start();

	/* never reach here */
	return ;
}
Exemplo n.º 5
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
    /*// RM48 does not have cache implemented
     *rt_hw_cpu_icache_enable();
     *rt_hw_cpu_dcache_enable();
     */

	/* init hardware interrupt */
	rt_hw_interrupt_init();

	/* init board */
	rt_hw_board_init();

	/* init tick */
	rt_system_tick_init();

	/* init kernel object */
	rt_system_object_init();

	rt_show_version();

	/* init timer system */
	rt_system_timer_init();

	/* init memory system */
#ifdef RT_USING_HEAP
#ifdef __CC_ARM
	rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)MEMEND);
#elif defined(__GNUC__)
    rt_system_heap_init((void*)&__bss_end, (void*)MEMEND);
#elif defined(__TI_COMPILER_VERSION__)
    rt_system_heap_init((void*)&system_data_end, (void*)MEMEND);
#else
#error Unkown compiler
#endif
#endif

	/* init scheduler system */
	rt_system_scheduler_init();

	/* init application */
	rt_application_init();

#ifdef RT_USING_FINSH
	/* init finsh */
	finsh_system_init();
	finsh_set_device("sci2");
#endif

	/* init soft timer thread */
	rt_system_timer_thread_init();

	/* init idle thread */
	rt_thread_idle_init();

	/* start scheduler */
	rt_system_scheduler_start();

	/* never reach here */
	return ;
}
Exemplo n.º 6
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
	/* init board */
	rt_hw_board_init(); 
	

          //------------------------------------------
      #if 0    
       rt_kprintf("\n\r   starting...--------->>>>>>\r\n ");   

	//WatchDogInit();    
		 while(1)
	   	{      
	   	/* Insert 40 ms delay */
              DF_delay_us(1000);
		//IWDG_ReloadCounter();  
		}
     #endif     	


     #if  0
      rt_kprintf("\n\r   starting...\r\n ");   
	 


  while (1)
  {
     DF_delay_us(1000);
    /* Reload IWDG counter */
    //IWDG_ReloadCounter();  
  }
	 
 
	 
    #endif 	 
         rt_kprintf("\n\r   TCB 北斗车载终端 认证版本TW703-BD--13-1-24 - Version 1.0 !\r\n ");    
	/* show version */
	rt_show_version();

	/* init tick */
	rt_system_tick_init();

	/* init kernel object */
	rt_system_object_init();

	/* init timer system */
	rt_system_timer_init();

      rt_system_heap_init((void*)STM32_SRAM_BEGIN, (void*)STM32_SRAM_END);

	/* init scheduler system */
	rt_system_scheduler_init();

	/* init all device */
	rt_device_init_all();   

//------------------- Device  thread ----------------------------------
       


#ifdef RT_USING_FINSH
	/* init finsh */
	finsh_system_init();
	finsh_set_device( FINSH_DEVICE_NAME ); // mount on
#endif

 #ifdef  GSM_UART
      _gsm_startup();
#endif

  #ifdef _485_DEVICE
      //_485_app_init();
      //_485_set_device(_485_DEVICE); // mount  on
      _485_startup();
  #endif

  #ifdef GPS_UART
      // gps_app_init(); 
      // gps_set_device(GPS_DEVICE);  // mount on
	   gps_init();     
       mma8451_driver_init(); 
  #endif

     printer_driver_init();   

   //---  RTC  device Register---------------
  //
      if( rt_hw_rtc_init()==1)
	{
	    RTC_Demo_init();   // Debug  Test  use  
	    rt_kprintf("\n\r   RTC -first conifg\r\n ");  
    	}
  //---------------App Thread    ---------------------------
  #ifdef HMI
        HMI_app_init();  
  #endif
  

	  /* init application_ demo */
	  rt_application_init(); 

      #ifdef APP808
       Protocol_app_init();
      #endif

      // GB_19056 thread
	  GB_Drv_app_init();  
// -------------------------------------------------------------------------

    /* init timer thread */
      rt_system_timer_thread_init(); 

	/* init idle thread */
	rt_thread_idle_init();

	/* start scheduler */
	rt_system_scheduler_start();

	/* never reach here */
	return ;
}
Exemplo n.º 7
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
	char buf[128];
	char *psrc;
	char *pdst=RT_NULL;
	int i,linkno,infolen;


	/* init board */
	rt_hw_board_init();

	/* show version */
	rt_show_version();

	/* init tick */
	rt_system_tick_init();

	/* init kernel object */
	rt_system_object_init();

	/* init timer system */
	rt_system_timer_init();

    rt_system_heap_init((void*)STM32_SRAM_BEGIN, (void*)STM32_SRAM_END);

	/* init scheduler system */
	rt_system_scheduler_init();

	/* init all device */
	rt_device_init_all();


	rt_kprintf("\r\nrcc.csr=%08x",RCC->CSR);

/*
	sprintf(buf,"%s","%IPDATA:1,3,\"123\"");

	psrc=buf;
	pdst=buf;
	rt_kprintf("buf=%s\r\n",psrc);
	i = sscanf( psrc, "%%IPDATA:%d,%d,%s", &linkno, &infolen, pdst );
	rt_kprintf("\r\ni=%d,linkno=%d,infolen=%d,pdst=%s\r\n",i,linkno,infolen,pdst);
*/	
	/* init application */
	sst25_init(); /*在此初始化,gsm才能读取参数,放在app_thread中不会先执行*/
	rt_application_init();
	RS485_init();
	gps_init();
	gsm_init();
	hmi_init();
	jt808_init();
 	

#ifdef RT_USING_FINSH
	/* init finsh */
	finsh_system_init();
	finsh_set_device( FINSH_DEVICE_NAME );
#endif

    /* init timer thread */
    rt_system_timer_thread_init();

	/* init idle thread */
	rt_thread_idle_init();

	/* start scheduler */
	rt_system_scheduler_start();

	/* never reach here */
	return ;
}
Exemplo n.º 8
0
void rtthread_startup(void)
{
    /* init hardware interrupt */
    rt_hw_interrupt_init();

    /* init board */
    rt_hw_board_init();

    /* show version */
    rt_show_version();

    /* init tick */
    rt_system_tick_init();

    /* init kernel object */
    rt_system_object_init();

    /* init timer system */
    rt_system_timer_init();

#ifdef RT_USING_HEAP
    rt_system_heap_init((void*)&rtt_heap_start, (void*)&rtt_heap_end);
#endif

#ifdef RT_USING_MODULE
    /* init module system*/
    rt_system_module_init();
#endif

    /* init scheduler system */
    rt_system_scheduler_init();

#ifdef RT_USING_DEVICE
    /* register uart0 */
    rt_hw_serial_register(&uart0_device, "uart0",
        RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM,
        &uart0);

    rt_console_set_device("uart0");
#endif

    /* init application */
    rt_application_init();

#ifdef RT_USING_FINSH
    /* init finsh */
    extern void finsh_system_init(void);
    finsh_system_init();
    finsh_set_device("uart0");
#endif

    rt_system_timer_thread_init();

    /* init idle thread */
    rt_thread_idle_init();

    /* start scheduler */
    rt_system_scheduler_start();

    /* never reach here */
    return ;
}
Exemplo n.º 9
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
    /* init board */
    rt_hw_board_init();

    /* show version */
    rt_show_version();

    /* init tick */
    rt_system_tick_init();

    /* init kernel object */
    rt_system_object_init();

    /* init timer system */
    rt_system_timer_init();

#ifdef RT_USING_HEAP
#ifdef __CC_ARM
    rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)STM32_SRAM_END);
#elif __ICCARM__
    rt_system_heap_init(__segment_end("HEAP"), (void*)STM32_SRAM_END);
#else
    /* init memory system */
    rt_system_heap_init((void*)&__bss_end, (void*)STM32_SRAM_END);
#endif
#endif

    /* init scheduler system */
    rt_system_scheduler_init();

    /* initialize timer */
    rt_system_timer_init();

    /* init timer thread */
    rt_system_timer_thread_init();

    /* Add CPU usage to system */
    cpu_usage_init();

#ifdef RT_USING_COMPONENTS_INIT
    /* initialization RT-Thread Components */
    rt_components_init();
#endif

#ifdef  RT_USING_FINSH
    /* init finsh */
    finsh_system_init();
    finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif

#ifdef RT_USING_COMPONENTS_INIT
    /* initialization RT-Thread Components */
    rt_components_init();
#endif

    /* init application */
    rt_application_init();

    /* init idle thread */
    rt_thread_idle_init();

    /* start scheduler */
    rt_system_scheduler_start();

    /* never reach here */
    return;
}
Exemplo n.º 10
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
    /* init hardware interrupt */
    rt_hw_interrupt_init();

    /* init board */
    rt_hw_board_init();

    /* init tick */
    rt_system_tick_init();

    /* init kernel object */
    rt_system_object_init();

    rt_show_version();

    /* init timer system */
    rt_system_timer_init();

#ifdef RT_USING_HEAP
#ifdef __CC_ARM
    rt_system_heap_init((void*)&Image$$RW_IRAM1$$ZI$$Limit, (void*)0x40008000);
#else
    /* init memory system */
    rt_system_heap_init((void*)&__bss_end, (void*)0x40008000);
#endif
#endif

    /* init scheduler system */
    rt_system_scheduler_init();

#ifdef RT_USING_DEVICE
#ifdef RT_USING_DFS
    /* init sd card */
    rt_hw_sdcard_init();
#endif

#ifdef RT_USING_LWIP
    eth_system_device_init();
    /* init ethernetif device */
    rt_hw_dm9000_init();
#endif

    /* init hardware serial device */
    rt_hw_serial_init();
#endif

    /* init application */
    rt_application_init();

#ifdef RT_USING_FINSH
    /* init finsh */
    finsh_system_init();
    finsh_set_device("uart1");
#endif

    /* init idle thread */
    rt_thread_idle_init();

    /* start scheduler */
    rt_system_scheduler_start();

    /* never reach here */
    return ;
}
Exemplo n.º 11
0
/**
 * This function will startup RT-Thread RTOS.
 */
void rtthread_startup(void)
{
    extern void cpu_usage_init(void);

    /* init board */
    rt_hw_board_init();

    /* show version */
    rt_show_version();

    /* init tick */
    rt_system_tick_init();

    /* init kernel object */
    rt_system_object_init();

    /* init timer system */
    rt_system_timer_init();

#ifdef RT_USING_HEAP
	/* init memory system */
	rt_system_heap_init((void*)STM32_SRAM_BEGIN, (void*)STM32_SRAM_END);
#endif

    /* init scheduler system */
    rt_system_scheduler_init();

    /* initialize timer */
    rt_system_timer_init();

    /* init timer thread */
    rt_system_timer_thread_init();

    /* Add CPU usage to system */
    cpu_usage_init();

#ifdef RT_USING_COMPONENTS_INIT
    /* initialization RT-Thread Components */
    rt_components_init();
#endif

#ifdef  RT_USING_FINSH
    /* init finsh */
    finsh_system_init();
    finsh_set_device(RT_CONSOLE_DEVICE_NAME);
#endif

#ifdef RT_USING_COMPONENTS_INIT
    /* initialization RT-Thread Components */
    rt_components_init();
#endif

    /* init application */
    rt_application_init();

    /* init idle thread */
    rt_thread_idle_init();

    /* start scheduler */
    rt_system_scheduler_start();

    /* never reach here */
    return;
}