示例#1
0
/*** This is the parent task entry ***/
void main_task (void)
{
#ifdef CYASSL_KEIL_TCP_NET
    init_TcpNet ();

    os_tsk_create (tcp_tick, 2);
    os_tsk_create (tcp_poll, 1);
#endif

#ifdef CYASSL_MDK_SHELL
#ifdef  HAVE_KEIL_RTX
    os_tsk_create_user(shell_main, 1, Shell_stack, SHELL_STACKSIZE) ;
#else
    shell_main() ;
#endif
#else

    /************************************/
    /*** USER APPLICATION HERE        ***/
    /************************************/
    printf("USER LOGIC STARTED\n") ;

#endif

#ifdef   HAVE_KEIL_RTX
    CYASSL_MSG("Terminating tcp_main\n") ;
    os_tsk_delete_self ();
#endif

}
示例#2
0
static void init () {
  /* Add System initialisation code here */

  init_io ();
  init_display ();
  init_TcpNet ();

  /* Setup and enable the SysTick timer for 10ms. */
  SystemCoreClockUpdate();
  SysTick->LOAD = (SystemCoreClock / 100) - 1;
  SysTick->CTRL = 0x05;
}
示例#3
0
__task void init (void) {
  /* Add System initialisation code here */ 

  init_io ();
  init_display ();
  init_TcpNet ();

  /* Initialize Tasks */
  os_tsk_prio_self (100);
  os_tsk_create (blink_led, 20);
  os_tsk_create (timer_task, 30);
  os_tsk_create_user (tcp_task, 0, &tcp_stack, sizeof(tcp_stack));
  os_tsk_delete_self();
}
示例#4
0
文件: shell.c 项目: Coderz333/cyassl
/*******  Invoke Background Job   *******************************/
static void bg_job_invoke(void *args) 
{
    void (*func)(void * ) ;
    BackGround = 1 ; 
    stack_fill(bg_job_stack, BG_JOB_STACK_SIZE) ;
    func = (void(*)(void *))((func_args *)args)->argv[0] ; 
    func(args) ;        /* invoke command */
    stack_check(bg_job_stack, BG_JOB_STACK_SIZE) ;
    #ifdef CYASSL_KEIL_NET
    init_TcpNet ();
    #endif
    BackGround = 0 ;
    os_tsk_delete_self() ; ;
}
示例#5
0
void Init (void) {
	SystemInit();

	// Setup and enable the SysTick timer for 100us.
  SysTick_Config((SystemCoreClock / 10000)); // 100us
	
	// Initialize all enabled drives.
  finit(NULL);
	
	// Init status leds
	Status_LEDs_Init();
		
	// UART Init
	UART_CONSOLE_Init();
	
	// Load settings
	SETTINGS_Load();

	// Save FIRMWARE Version to Device Settings file
	SETTINGS_DATA[FIRMWARE_VERSION] = malloc(strlen(SOFTWARE_VERSION));
	strcpy(SETTINGS_DATA[FIRMWARE_VERSION], SOFTWARE_VERSION);
	SETTINGS_Save();
	
	// Setup MAC Address
	Setup_MAC_Address();
	
	// Init TcpNet
  init_TcpNet();

	// Setup Settings
	Setup_Settings();

	// Reset button init
	Reset_Button_Init();
	
	// UDP Init
	UDP_Socket_Init();
	
	// TCP Users Init
	TCP_Users_Init(TCP_PORT);

	// Init LED CUBE
	LED_CUBE_Init();
	
	UART_CONSOLE_Send_String("Init\n");
}
示例#6
0
void Net_Init(void)
{
  Read_ETH_Mac_Para(); //读取mac参数

  Unselect_SPI_Device();
  SPI1_ENC28J60_Init();

  Trans_Mac_Para(own_hw_adr);

  //memcpy (own_hw_adr, (U8 *)mac_adr, 6);
  //memcpy (&localm[NETIF_ETH], (U8 *)&ip_config, sizeof(ip_config));
  init_TcpNet ();
  
  Trans_IP_Para(&localm[NETIF_ETH]);
  //memcpy (&localm[NETIF_ETH], (U8 *)&ip_config, sizeof(ip_config));
    
  Screen_Status.UDP_Soc = udp_get_socket (0, UDP_OPT_SEND_CS | UDP_OPT_CHK_CS, udp_callback);
  udp_open (Screen_Status.UDP_Soc, 8000);
}
示例#7
0
文件: app.c 项目: postgetme/crco
static bsp_init (void)
{
	rg_led_init ();

	g_led (0);

	#if FS_EN == 1
		fs_init ();
	#endif

	#if SHELL_EN == 1
 		shell_init ();
	#endif

	

	#if TCP_EN == 1
		init_TcpNet ();
	#endif
				
	#if KEY_EN == 1
 		key_init ();
	#endif
	
	#if RESET_KEY_EN == 1
		reset_key_init ();
	#endif

	#if GUI_EN == 1
		lcd_init (); 
		lcd_write_led (0);	  
		widget_init ();
	#endif

	I2CInit(0);

	#if RTC_EN == 1
		pcf8563_init ();
	#endif
}