⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ztpxtlinit_conf.c

📁 zilog的实时操作系统RZK,可以移植到多种处理器上
💻 C
字号:
/*
* File				:	XTLInit.c
*
* Description		:	This file contains initalization of XTL for ZTP
* 
* Copyright 2004 ZiLOG Inc.  ALL RIGHTS RESERVED.
*
* This file contains unpublished confidential and proprietary information
* of ZiLOG, Inc.
* NO PART OF THIS WORK MAY BE DUPLICATED, STORED, PUBLISHED OR DISCLOSED 
* IN ANY FORM WITHOUT THE PRIOR WRITTEN CONSENT OF ZiLOG, INC.
* This is not a license and no use of any kind of this work is authorized
* in the absence of a written license granted by ZiLOG, Inc. in ZiLOG's 
* sole discretion 
*/
#include "ZSysgen.h"
#include "ZTypes.h"
#include "ZThread.h"
#include "EtherMgr.h"
#include "Rtc.h"
#include "ZDevice.h"
//#include <ZTPConfig.h>
#include <ZTPTcp.h>


// extern functions
extern INT16 Init_Serial0_Device( void ) ;
extern INT16 Init_Serial1_Device( void ) ;
extern INT16 Init_RTC_Device( void ) ;
extern INT16 Init_EMAC_Device( void ) ;
extern INT16 Init_TTY_Device( void ) ;
extern INT16 Init_TCPUDP_Device( void ) ;
extern UINT16 nifDriverInit( void ) ;
extern INT16 DHCP_Init( void ) ;
extern INT16 CreateZTPAppThread( void ) ;
extern INT16 Init_Globals( void );
extern INT16 Init_DataPersistence( void );

// extern variables
extern UINT8      b_use_dhcp ;	


RZK_DEVICE_CB_t *	                                               SERIAL0;
RZK_DEVICE_CB_t *	                                               SERIAL1;
RZK_DEVICE_CB_t *	                                               TTY;
RZK_DEVICE_CB_t *                                                TCP;
RZK_DEVICE_CB_t *                                                UDP;
RZK_DEVICE_CB_t *                                                EMACDEV;
RZK_DEVICE_CB_t *                                                pRTCDev;


// main function for ZTP system
int main( int argc, void *argv[] )
{
	RZK_KernelInit() ;			// This function will call the RZKHwInitC 
								// function, but will not resume the idle thread.
	Init_DataPersistence() ; // Gets the data stored in FLASH such as IP addr, etc..
	Init_Serial0_Device() ;	// Initializes the serial0 port
	Init_Serial1_Device() ;	// Initializes the serial1 port
	Init_RTC_Device() ;		// initializes the RTC device
	Init_EMAC_Device() ;		// initializes the EMAC device
	Init_TTY_Device() ;		// initializes the TTY device

	Init_TCPUDP_Device() ;	// initializes the TCPUDP devices
	Init_Globals();

	nifDriverInit() ;			// initializes the interfaces specified in the table

	// check whether the DHCP should be used to get the IP address for the system
	if( b_use_dhcp == TRUE )
		{
		DHCP_Init() ;			// Initialize the DHCP and get IP address (Creating 
								// the DHCP thread)
		}
	else
		{
		CreateZTPAppThread() ;	// Creates the ZTP application thread
		}

	RZK_KernelStart() ;			// This function will call resume the threads 
								// created just before. Calling of these functions 
								// is a must and should be at the end of the main.
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -