亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? uip_task.c

?? 最新版FreeRTOS, 包擴(kuò)多種開發(fā)平臺(tái)的移植
?? C
字號:
/*
 * Modified from an original work that is Copyright (c) 2001-2003, Adam Dunkels.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote
 *    products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This file is part of the uIP TCP/IP stack.
 *
 * $Id: main.c,v 1.10.2.4 2003/10/21 21:27:51 adam Exp $
 *
 */

/* Standard includes. */
#include <stdlib.h>
#include <stdio.h>

/* Scheduler includes. */
#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"

/* Demo app includes. */
#include "SAM7_EMAC.h"

/* uIP includes. */
#undef HTONS
#include "uip.h"
#include "uip_arp.h"
#include "tapdev.h"
#include "httpd.h"

/* The start of the uIP buffer, which will contain the frame headers. */
#define pucUIP_Buffer ( ( struct uip_eth_hdr * ) &uip_buf[ 0 ] )

/* uIP update frequencies. */
#define RT_CLOCK_SECOND		( configTICK_RATE_HZ  )
#define uipARP_FREQUENCY	( 20 )
#define uipMAX_BLOCK_TIME	( RT_CLOCK_SECOND / 4 )

/*-----------------------------------------------------------*/

void vuIP_TASK( void *pvParameters )
{
/* The semaphore used by the EMAC ISR to indicate that an Rx frame is ready
for processing. */
xSemaphoreHandle xSemaphore = NULL;
portBASE_TYPE xARPTimer;
unsigned portBASE_TYPE uxPriority;
static volatile portTickType xStartTime, xCurrentTime;

	/* Initialize the uIP TCP/IP stack. */
	uip_init();
	uip_arp_init();
	
	/* Initialize the HTTP server. */
	httpd_init();

	/* Initialise the local timers. */
	xStartTime = xTaskGetTickCount();
	xARPTimer = 0;

	/* Initialise the EMAC.  A semaphore will be returned when this is
	successful. This routine contains code that polls status bits.  If the
	Ethernet cable is not plugged in then this can take a considerable time.
	To prevent this starving lower priority tasks of processing time we
	lower our priority prior to the call, then raise it back again once the
	initialisation is complete. */
	uxPriority = uxTaskPriorityGet( NULL );
	vTaskPrioritySet( NULL, tskIDLE_PRIORITY );
	while( xSemaphore == NULL )
	{
		xSemaphore = xEMACInit();
	}
	vTaskPrioritySet( NULL, uxPriority );

	for( ;; )
	{
		/* Let the network device driver read an entire IP packet
		into the uip_buf. If it returns > 0, there is a packet in the
		uip_buf buffer. */
		uip_len = ulEMACPoll();

		/* Was a packet placed in the uIP buffer? */
		if( uip_len > 0 )
		{
			/* A packet is present in the uIP buffer. We call the
			appropriate ARP functions depending on what kind of packet we
			have received. If the packet is an IP packet, we should call
			uip_input() as well. */
			if( pucUIP_Buffer->type == htons( UIP_ETHTYPE_IP ) )
			{
				uip_arp_ipin();
				uip_input();

				/* If the above function invocation resulted in data that
				should be sent out on the network, the global variable
				uip_len is set to a value > 0. */
				if( uip_len > 0 )
				{
					uip_arp_out();
					lEMACSend();
				}
			}
			else if( pucUIP_Buffer->type == htons( UIP_ETHTYPE_ARP ) )
			{
				uip_arp_arpin();

				/* If the above function invocation resulted in data that
				should be sent out on the network, the global variable
				uip_len is set to a value > 0. */	
				if( uip_len > 0 )
				{	
					lEMACSend();
				}
			}
		}
		else
		{
			/* The poll function returned 0, so no packet was
			received. Instead we check if it is time that we do the
			periodic processing. */
			xCurrentTime = xTaskGetTickCount();

			if( ( xCurrentTime - xStartTime ) >= RT_CLOCK_SECOND )
			{
				portBASE_TYPE i;

				/* Reset the timer. */
				xStartTime = xCurrentTime;

				/* Periodic check of all connections. */
				for( i = 0; i < UIP_CONNS; i++ )
				{
					uip_periodic( i );

					/* If the above function invocation resulted in data that
					should be sent out on the network, the global variable
					uip_len is set to a value > 0. */					
					if( uip_len > 0 )
					{
						uip_arp_out();
						lEMACSend();
					}
				}

				#if UIP_UDP
					for( i = 0; i < UIP_UDP_CONNS; i++ )
					{
						uip_udp_periodic( i );

						/* If the above function invocation resulted in data that
						should be sent out on the network, the global variable
						uip_len is set to a value > 0. */
						if( uip_len > 0 )
						{
							uip_arp_out();
							tapdev_send();
						}
					}
				#endif /* UIP_UDP */

				/* Periodically call the ARP timer function. */
				if( ++xARPTimer == uipARP_FREQUENCY )
				{	
					uip_arp_timer();
					xARPTimer = 0;
				}
			}
			else
			{				
				/* We did not receive a packet, and there was no periodic
				processing to perform.  Block for a fixed period.  If a packet
				is received during this period we will be woken by the ISR
				giving us the Semaphore. */
				xSemaphoreTake( xSemaphore, uipMAX_BLOCK_TIME );
			}
		}
	}
}
/*-----------------------------------------------------------------------------------*/





?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99国产精品成人| 一区二区三区在线观看视频 | 欧洲一区二区三区在线| 亚洲区小说区图片区qvod| 菠萝蜜视频在线观看一区| 亚洲欧美日本韩国| 欧美三日本三级三级在线播放| 亚洲午夜激情av| 日韩一区二区在线看| 国产成人欧美日韩在线电影| 亚洲欧洲另类国产综合| 色婷婷综合久久久久中文| 五月天激情综合| 精品国产伦一区二区三区观看方式 | 国产成人午夜片在线观看高清观看| 国产女人18毛片水真多成人如厕| 豆国产96在线|亚洲| 一区二区欧美精品| 91精品国产美女浴室洗澡无遮挡| 国内成人免费视频| 亚洲黄色尤物视频| 精品美女在线播放| 91视频www| 精品一区二区三区的国产在线播放 | 精品噜噜噜噜久久久久久久久试看| 国产精品亚洲综合一区在线观看| 国产精品国产三级国产aⅴ无密码| 91久久精品网| 久久99九九99精品| 亚洲欧美精品午睡沙发| 日韩欧美一级二级三级久久久| 国产成人av电影在线播放| 亚洲一区在线观看网站| 久久久久9999亚洲精品| 欧美三级中文字| 成人深夜福利app| 日韩精品91亚洲二区在线观看| 国产欧美一区二区在线观看| 欧美蜜桃一区二区三区| 成人高清视频在线| 免费欧美在线视频| 一区二区三区四区av| 久久综合久久99| 欧美日韩国产一级片| av亚洲精华国产精华精华| 美女www一区二区| 亚洲一区二区四区蜜桃| 亚洲国产成人一区二区三区| 欧美精品 日韩| 99久久综合精品| 国产福利不卡视频| 奇米一区二区三区| 亚洲午夜久久久久久久久电影院 | 国产精品久久久久永久免费观看| 777久久久精品| 色婷婷综合久久| 成人网男人的天堂| 国产在线视频一区二区| 日韩综合一区二区| 一区二区三区久久久| 欧美国产精品久久| 国产偷国产偷精品高清尤物| 欧美一区二区在线播放| 在线观看91精品国产入口| 成人深夜在线观看| 懂色av一区二区三区免费观看| 黄色资源网久久资源365| 日韩va欧美va亚洲va久久| 亚洲欧美日韩精品久久久久| 国产精品久久久久久久久晋中| 久久综合九色综合久久久精品综合| 欧美日韩不卡一区| 欧美日韩视频在线一区二区| 99久久久久免费精品国产| 不卡一区中文字幕| 波多野结衣中文一区| 国产99久久久精品| 国产91富婆露脸刺激对白| 国产精品亚洲综合一区在线观看| 国精品**一区二区三区在线蜜桃| 男人的天堂亚洲一区| 久久国产免费看| 精久久久久久久久久久| 精品一二三四在线| 国产成人福利片| 99久久国产综合精品麻豆| 91免费版pro下载短视频| 91无套直看片红桃| 在线观看免费亚洲| 911精品国产一区二区在线| 制服丝袜亚洲色图| 欧美精品一区二区三区视频| 久久久久久久久久看片| 国产精品久久久久久亚洲伦| 亚洲欧美偷拍三级| 午夜a成v人精品| 精品在线观看视频| 风间由美性色一区二区三区| 91免费版pro下载短视频| 欧美性色黄大片| 日韩亚洲欧美在线观看| 久久久精品影视| 怡红院av一区二区三区| 日韩不卡手机在线v区| 国内精品不卡在线| 一本久久精品一区二区 | 久久综合狠狠综合久久激情| 国产日韩欧美高清在线| 亚洲乱码一区二区三区在线观看| 偷偷要91色婷婷| 国产69精品久久久久毛片| 色婷婷久久久亚洲一区二区三区| 欧美伦理影视网| 国产视频一区二区在线观看| 亚洲嫩草精品久久| 美女视频第一区二区三区免费观看网站| 国产一区 二区| 欧美日精品一区视频| 日本一区二区三区在线不卡| 亚洲一区二区在线免费看| 精品一区二区三区不卡| 91久久精品国产91性色tv| 日韩片之四级片| 亚洲一区二区三区在线看| 国产乱码精品一区二区三区忘忧草 | 久久这里只有精品首页| 一区二区高清在线| 国产大片一区二区| 欧美日本精品一区二区三区| 国产婷婷色一区二区三区在线| 午夜婷婷国产麻豆精品| 成人av在线资源网站| 日韩午夜小视频| 亚洲小说春色综合另类电影| 懂色av中文一区二区三区| 91精品国产高清一区二区三区蜜臀| 国产精品色哟哟| 久久97超碰国产精品超碰| 欧美色图激情小说| 国产精品美女一区二区| 激情六月婷婷久久| 日韩一级视频免费观看在线| 亚洲精品国产精华液| 成人综合激情网| 欧美精品一区二区久久婷婷| 午夜精品久久久久久久久久久| 99久久99久久精品免费观看| 国产午夜精品一区二区| 久久成人麻豆午夜电影| 欧美人动与zoxxxx乱| 亚洲精品国产精华液| 91在线视频网址| 国产精品每日更新在线播放网址| 国内精品久久久久影院色| 日韩免费高清电影| 免费精品视频最新在线| 欧美日韩在线播放三区四区| 一区二区免费看| 91传媒视频在线播放| 亚洲欧美国产高清| 91看片淫黄大片一级在线观看| 欧美激情自拍偷拍| 国产精品一区三区| 国产亚洲一区字幕| 国产成人精品三级| 久久久久久麻豆| 国产.欧美.日韩| 欧美激情在线观看视频免费| 老鸭窝一区二区久久精品| 日韩午夜电影av| 久久国产精品一区二区| 欧美tickle裸体挠脚心vk| 激情成人午夜视频| 国产欧美精品一区二区色综合 | 99久免费精品视频在线观看| 18欧美乱大交hd1984| 色偷偷久久人人79超碰人人澡| 亚洲免费观看高清完整| 欧美色视频在线| 视频在线在亚洲| 精品福利二区三区| 国产激情视频一区二区三区欧美| 久久伊99综合婷婷久久伊| 国产白丝网站精品污在线入口| 国产精品久久久久影视| 一本高清dvd不卡在线观看| 亚洲成年人网站在线观看| 日韩一区二区精品葵司在线| 国产一区二区三区视频在线播放| 国产视频亚洲色图| 91福利视频久久久久| 日韩精品五月天| 26uuu另类欧美| 色综合久久久久综合| 日韩精品久久理论片| 欧美激情一区二区在线| 在线观看不卡一区| 国产老女人精品毛片久久| 一区二区三区日韩在线观看| 51久久夜色精品国产麻豆|