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

📄 targport.c

📁 在ARM7和UC/OSII的平台上实现了GPS自动报站的功能,涉及GPS模块LEA_4S的驱动,位置速寻算法,语音芯片ISD4004的录放音驱动,LED页面管理等等.从启动代码到操作系统的移植以及到业
💻 C
字号:
/* targport.c 

   Target board support routines for InterNiche TCP/IP.

   This one for Multitasking DOS system.
*/

#include "ipport.h"
#include "in_utils.h"
#include "q.h"
#include "netbuf.h"
#include "net.h"
#include "nvparms.h"
#include "nvfsio.h"
#include "arp.h"
#include "ip.h"


#ifdef DHCP_SERVER
extern int   dhcp_init(void);
#endif /* DHCP_SERVER */

extern int (*port_prep)(int);
extern int prep_win32(int ifaces_found);
#ifdef WIN2K
extern int wd_prep(int);            /* port iface prep routine to install */
#endif
#ifdef USE_PPP
extern int prep_ppp(int ifaces_found);
#endif
#ifdef USE_SLIP
extern int prep_slip(int ifaces_found);
#endif

#ifdef   MINI_IP

/* MINI_IP layer has no graceful shutdown code, but on Windows
 * it's fairly important feature. Do it here:
 */
extern void wd_close(int iface);
extern void ppp_ifclose(int iface);

void
exit_win32(int code)
{
   /* If we're using PPP the modem code will dissapear as the .exe exits
    * and the windows uart device will clean up bt itself; so all we need 
    * to do is exit.
    */

#ifdef INCLUDE_ARP
#ifdef WIN2K
   wd_close(0);      /* If using Ethernet, shut down packet.dll */
#endif /* WIN2K */
#endif   /* USP_PPP */

#undef exit
   exit(code);
}

void
exit_hook(int (*func)())
{
}
#endif   /* MINI_IP */


#ifndef SUPERLOOP
/* hardware setup called form main before anything else (e.g.
before tasks, printf, memory alloc, etc. 

Return NULL if OK, else error message
*/

char * 
pre_task_setup()
{
   return NULL;
}


/* more setup called after tasks are set up

Return NULL if OK, else brief error message
*/

extern int  wd_reg_type(unshort, NET);
extern int   http_init(void);
extern int   ftps_init(void);
extern int   tel_init(void);

char *
post_task_setup()
{
#ifdef MINI_IP
   clock_init();

   /* The mini version of IP has no reg_type() primitive (it assumes
    * the drivers know to support IP and ARP), so we must call the NDIS
    * driver reg_type() routine as part of the port.
    */
#ifndef USE_PPP
#ifdef  WIN2K
   wd_reg_type(ET_ARP, nets[0]);
   wd_reg_type(IP_TYPE, nets[0]);
#endif /* WIN2K */
#endif   /* USE_PPP */

#endif   /* MINI_IP */


   return NULL;
}

#endif /* ifndef SUPERLOOP */

int 
prep_win32(int ifaces_found)
{
#ifdef WIN2K
   ifaces_found = wd_prep(ifaces_found);
#endif

#ifdef USE_PPP
   ifaces_found = prep_ppp(ifaces_found);
#endif

#ifdef USE_SLIP
   ifaces_found = prep_slip(ifaces_found);
#endif

   return ifaces_found;
}

⌨️ 快捷键说明

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