示例#1
0
static int wm_infsl_init(void)
{
    tls_spi_init();
    tls_spifls_init();
    tls_fls_init();

    /*initialize flash layout parameter according to image type*/
    tls_fls_layout_init();

    return 0;
}
示例#2
0
/*****************************************************************************
 * Function Name        // task_start
 * Descriptor             // before create multi_task, we create a task_start task
 *                      	   // in this example, this task display the cpu usage
 * Input                
 * Output              
 * Return              
 ****************************************************************************/
void task_start (void *data)
{
    extern void CreateUserTask(void);
    extern void  RestoreParamToDefault(void);
    int err;
    u8 mac_addr[6];
    u8 tx_gain[12];
    u8 errstatus;

    tls_irq_init();

    /* initial os ticker */
    tls_os_timer_init(); 

#if OS_TASK_STAT_EN > 0
    /* Initialize uC/OS-II's statistics */
    OSStatInit();
#endif

    tls_spi_slave_sel(SPI_SLAVE_FLASH);	
    tls_spi_init();
    tls_fls_init();
    tls_fls_gd25qxx_drv_install();
	
	tls_restore_param_from_backup();	
	RestoreParamToDefault();
	//tls_param_to_default();

    err = tls_param_init(); 
    if (err) {
        TLS_DBGPRT_INFO("read spi param err\n"); 
    }
    tls_fwup_init();

    /* ¶ÁÈ¡efuseÖеÄmacµØÖ· */
   	tls_get_mac_addr(mac_addr);
	tls_get_tx_gain(tx_gain);
    
    TLS_DBGPRT_INFO("tx gain ");
    TLS_DBGPRT_DUMP(&tx_gain[0], 12);
    TLS_DBGPRT_INFO("mac addr ");
    TLS_DBGPRT_DUMP(&mac_addr[0], 6);

    if(tls_wl_init(tx_gain, &mac_addr[0]) == NULL){
        TLS_DBGPRT_INFO("wl driver initial failured\n");
    }
    if (wpa_supplicant_init(mac_addr)) {
        TLS_DBGPRT_INFO("supplicant initial failured\n");
    }

    tls_ethernet_init();

    tls_sys_init();

#if TLS_CONFIG_HOSTIF
    tls_hostif_init();
#endif
#if (TLS_CONFIG_HOSTIF && TLS_CONFIG_HS_SPI)
    tls_hspi_init();
#endif

#if (TLS_CONFIG_HOSTIF &&TLS_CONFIG_UART)
    tls_uart_init();
#endif

   	tls_sys_auto_mode_run(); 
	tls_netif_add_status_event(tls_main_net_status_changed);
	BLINKTIMER = OSTmrCreate(0, 10, 2, BlinkTimerProc, NULL, NULL, &errstatus);
	if (BLINKTIMER){
		OSTmrStart(BLINKTIMER, &errstatus);	
	}

	tls_wifi_one_shot_init();

    disp_version_info();
	/* User start here */
	CreateUserTask();
    for (;;)
    {
        tls_os_time_delay(0x10000000);
    }
}