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

📄 main.c

📁 基于凌阳系列单片机的以太网驱动程序
💻 C
字号:
/*=========================================================================
*  The information contained herein is the exclusive property of Sunplus Technology Co. And shall not
*  be distributed, reproduced, or disclosed in whole in part without prior written permission.
*       (C) Copyright 2003 Sunplus Technology Co. All rights reserved.
*  The entire notice above must be reproduced on all authorized copies
*=========================================================================*/

/*=========================================================================
*  Project name:       
*  Function Description: A simple web server. 
*  Environment:       SUNPLUS u'nSP IDE 1.10.0, SPCE061A EV board
*  Library Dependency:clib100.lib, SacmV25.lib
*  File List:           
*  Author:            Gong Zhigang 
*  Date:              2003-08-10 
*  E-mail:            zhigang@sunnorth.com.cn
*              
*========================================================================*/


#define MAIN
#include "config.h"

struct netif *netif;
extern u16_t tcp_tmr_timeout(void);
extern err_t ethernetif_init(struct netif *netif);
void F_MonitorLoop();

/*-----------------------------------------------------------------------------------*/
int
main(int argc, char **argv)
{
  struct ip_addr ipaddr, netmask, gw,ip;

  char ipstr[] = "lg_2000@eyou.com";
  int i=0;
  int Ret=0;
  System_Initial();
  F_InitTcpTmr();
#ifdef STATS
  stats_init();
#endif /* STATS */

  mem_init();
  memp_init();
  pbuf_init(); 
  netif_init();
  ip_init();
  tcp_init();
 // udp_init();

 // Prompt("please input gateway ip address:\r\n", IP, &gw);
  IP4_ADDR(&gw, 172,20,10,254);
 // Prompt("please input host ip address:\r\n请输入本机ip地址", IP, &ipaddr);  
  IP4_ADDR(&ipaddr, 172,20,8,115);
 // Prompt("please input net mask:\r\n", IP, &netmask);  
 IP4_ADDR(&netmask, 255,255,0,0);
  netif = netif_add(&ipaddr, &netmask, &gw, NULL, ethernetif_init, ip_input);
  netif_set_default(netif);
  httpd_init();
  //dns_init();
//  resolv(&ip,ipstr);
  while(1) {
F_MonitorLoop();
  }

 return 0;
}


void F_MonitorLoop()
{
if (netif!=NULL)
{
u16_t iTemp = lwip_timeout();
Ethernet_poll(netif);
if(iTemp & TCP_TIMEOUT)  tcp_tmr();					
}
}







⌨️ 快捷键说明

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