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

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

?? serialisr.c

?? MCS-51的一個Free小型操作系統(tǒng),在KeilC中下編譯工作
?? C
字號:
/*
	FreeRTOS.org V4.1.3 - Copyright (C) 2003-2006 Richard Barry.

	This file is part of the FreeRTOS.org distribution.

	FreeRTOS.org is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	FreeRTOS.org is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with FreeRTOS.org; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

	A special exception to the GPL can be applied should you wish to distribute
	a combined work that includes FreeRTOS.org, without being obliged to provide
	the source code for any proprietary components.  See the licensing section 
	of http://www.FreeRTOS.org for full details of how and when the exception
	can be applied.

	***************************************************************************
	See http://www.FreeRTOS.org for documentation, latest information, license 
	and contact details.  Please ensure to read the configuration and relevant 
	port sections of the online documentation.
	***************************************************************************
*/


/* 
	BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR UART0. 

	This file contains all the serial port components that must be compiled
	to ARM mode.  The components that can be compiled to either ARM or THUMB
	mode are contained in serial.c.

*/

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

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

/* Demo application includes. */
#include "serial.h"

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

/* Constant to access the VIC. */
#define serCLEAR_VIC_INTERRUPT			( ( unsigned portLONG ) 0 )

/* Constants to determine the ISR source. */
#define serSOURCE_THRE					( ( unsigned portCHAR ) 0x02 )
#define serSOURCE_RX_TIMEOUT			( ( unsigned portCHAR ) 0x0c )
#define serSOURCE_ERROR					( ( unsigned portCHAR ) 0x06 )
#define serSOURCE_RX					( ( unsigned portCHAR ) 0x04 )
#define serINTERRUPT_SOURCE_MASK		( ( unsigned portCHAR ) 0x0f )

/* Queues used to hold received characters, and characters waiting to be
transmitted. */
static xQueueHandle xRxedChars; 
static xQueueHandle xCharsForTx; 
static volatile portLONG lTHREEmpty;

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

/* 
 * The queues are created in serialISR.c as they are used from the ISR.
 * Obtain references to the queues and THRE Empty flag. 
 */
void vSerialISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, xQueueHandle *pxCharsForTx, portLONG volatile **pplTHREEmptyFlag );

/* UART0 interrupt service routine.  This can cause a context switch so MUST
be declared "naked". */
void vUART_ISR( void ) __attribute__ ((naked));

/*-----------------------------------------------------------*/
void vSerialISRCreateQueues(	unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxRxedChars, 
								xQueueHandle *pxCharsForTx, portLONG volatile **pplTHREEmptyFlag )
{
	/* Create the queues used to hold Rx and Tx characters. */
	xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
	xCharsForTx = xQueueCreate( uxQueueLength + 1, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );

	/* Pass back a reference to the queues so the serial API file can 
	post/receive characters. */
	*pxRxedChars = xRxedChars;
	*pxCharsForTx = xCharsForTx;

	/* Initialise the THRE empty flag - and pass back a reference. */
	lTHREEmpty = ( portLONG ) pdTRUE;
	*pplTHREEmptyFlag = &lTHREEmpty;
}
/*-----------------------------------------------------------*/

void vUART_ISR( void )
{
	/* This ISR can cause a context switch, so the first statement must be a
	call to the portENTER_SWITCHING_ISR() macro.  This must be BEFORE any
	variable declarations. */
	portENTER_SWITCHING_ISR();

	/* Now we can declare the local variables. */
	signed portCHAR cChar;
	portBASE_TYPE xTaskWokenByTx = pdFALSE, xTaskWokenByRx = pdFALSE;

	/* What caused the interrupt? */
	switch( UART0_IIR & serINTERRUPT_SOURCE_MASK )
	{
		case serSOURCE_ERROR :	/* Not handling this, but clear the interrupt. */
								cChar = UART0_LSR;
								break;

		case serSOURCE_THRE	:	/* The THRE is empty.  If there is another
								character in the Tx queue, send it now. */
								if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWokenByTx ) == pdTRUE )
								{
									UART0_THR = cChar;
								}
								else
								{
									/* There are no further characters 
									queued to send so we can indicate 
									that the THRE is available. */
									lTHREEmpty = pdTRUE;
								}
								break;

		case serSOURCE_RX_TIMEOUT :
		case serSOURCE_RX	:	/* A character was received.  Place it in 
								the queue of received characters. */
								cChar = UART0_RBR;
								if( xQueueSendFromISR( xRxedChars, &cChar, ( portBASE_TYPE ) pdFALSE ) ) 
								{
									xTaskWokenByRx = pdTRUE;
								}
								break;

		default				:	/* There is nothing to do, leave the ISR. */
								break;
	}

	/* Clear the ISR in the VIC. */
	VICVectAddr = serCLEAR_VIC_INTERRUPT;

	/* Exit the ISR.  If a task was woken by either a character being received
	or transmitted then a context switch will occur. */
	portEXIT_SWITCHING_ISR( ( xTaskWokenByTx || xTaskWokenByRx ) );
}
/*-----------------------------------------------------------*/





	

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品国产热久久91蜜凸| 日韩影院免费视频| 国产亚洲成aⅴ人片在线观看| 欧美日韩精品免费观看视频| 91视频在线看| 在线观看av一区二区| 在线观看日韩精品| 欧美日本在线播放| 日韩欧美二区三区| 日韩精品一区二区三区在线观看| 日韩欧美国产三级电影视频| 欧美成人女星排行榜| 久久久久久**毛片大全| 亚洲国产精品t66y| 国产精品福利影院| 亚洲成人自拍一区| 青青草国产精品亚洲专区无| 蜜臀av亚洲一区中文字幕| 国产自产v一区二区三区c| 国产不卡视频在线观看| 99精品桃花视频在线观看| 在线观看视频一区二区| 欧美日韩一区二区欧美激情| 欧美男生操女生| 日韩欧美激情在线| 一区在线观看免费| 亚洲国产毛片aaaaa无费看| 日本亚洲最大的色成网站www| 久99久精品视频免费观看| 成人高清在线视频| 欧美日韩精品一区二区天天拍小说 | 中文字幕成人av| 国产精品传媒视频| 午夜精品久久久久久久| 久久电影网站中文字幕| 97久久久精品综合88久久| 在线播放亚洲一区| 国产免费成人在线视频| 亚洲成人一二三| 国产高清无密码一区二区三区| 99re热视频这里只精品| 精品久久久久久最新网址| 亚洲天堂a在线| 国产一区二区三区电影在线观看| 91麻豆国产自产在线观看| 日韩一区二区三区四区五区六区| 久久久久久久久久久久久夜| 亚洲人成网站色在线观看| 久久国产生活片100| 欧美吻胸吃奶大尺度电影 | 26uuu欧美| 亚洲国产一二三| 91在线porny国产在线看| 久久免费精品国产久精品久久久久 | 风间由美一区二区三区在线观看| 欧美老人xxxx18| 亚洲免费在线视频一区 二区| 国产伦精一区二区三区| 91精品国产高清一区二区三区| 1区2区3区精品视频| 国产成人丝袜美腿| 亚洲精品一区二区三区在线观看 | 国产九色精品成人porny| 欧美在线播放高清精品| 国产精品高潮久久久久无| 国产大陆精品国产| 久久九九99视频| 韩国精品在线观看| 日韩欧美中文字幕公布| 日本亚洲欧美天堂免费| 欧美乱熟臀69xxxxxx| 亚洲午夜免费电影| 在线观看一区二区精品视频| 亚洲欧美在线aaa| 国产河南妇女毛片精品久久久| 日韩手机在线导航| 日本不卡高清视频| 日韩西西人体444www| 日日摸夜夜添夜夜添精品视频| 欧美色网站导航| 亚洲成精国产精品女| 欧美精品 日韩| 日韩1区2区日韩1区2区| 欧美久久久影院| 美女在线观看视频一区二区| 日韩免费视频线观看| 久久99日本精品| 欧美国产一区在线| 成人a免费在线看| 亚洲视频电影在线| 欧美精品久久一区二区三区| 久久99精品久久只有精品| 久久女同互慰一区二区三区| av激情亚洲男人天堂| 亚洲韩国精品一区| 日韩精品一区国产麻豆| 成人美女在线观看| 亚洲综合精品自拍| 日韩欧美色综合| av综合在线播放| 肉色丝袜一区二区| 中文字幕av在线一区二区三区| 色婷婷综合五月| 久久se这里有精品| 国产免费成人在线视频| 在线精品视频免费播放| 毛片不卡一区二区| 亚洲免费观看高清完整版在线 | 亚洲自拍偷拍欧美| 日韩欧美中文字幕公布| 成人a区在线观看| 免费三级欧美电影| 亚洲日本一区二区| 久久久精品影视| 欧美精品色综合| 成人av动漫在线| 免费人成精品欧美精品| 亚洲欧洲www| 久久综合色综合88| 欧美精品电影在线播放| 成人一区二区视频| 麻豆视频一区二区| 亚洲国产日韩a在线播放| 中文字幕欧美国产| 日韩久久免费av| 欧美视频一二三区| 色哟哟在线观看一区二区三区| 国产一区二区电影| 日本欧美在线观看| 一区二区免费在线播放| 国产精品网站在线观看| 欧美白人最猛性xxxxx69交| 欧美中文字幕一区二区三区 | 欧美日韩一区二区不卡| 成人一区二区三区| 韩国av一区二区三区四区 | 国产精品系列在线| 久久日韩精品一区二区五区| 欧美丰满少妇xxxxx高潮对白| 色噜噜狠狠色综合中国| 99国产精品久| 97久久超碰国产精品| 国产91清纯白嫩初高中在线观看 | 国产精品每日更新| 国产精品三级视频| 26uuu亚洲综合色| 精品国产第一区二区三区观看体验| 一本大道久久a久久综合| 福利91精品一区二区三区| 国产精品1区2区3区在线观看| 精品在线一区二区| 精品一区二区免费看| 国产一区二区网址| 国产成人免费xxxxxxxx| 国产成人在线观看| 成人免费视频视频在线观看免费 | av在线不卡网| 91网页版在线| 欧美熟乱第一页| 欧美一区二区日韩| 日韩精品一区二区三区在线| 精品久久久久99| 日本一区二区视频在线观看| 中文字幕av一区二区三区免费看| 国产精品区一区二区三区| 国产精品美女视频| 亚洲丝袜美腿综合| 午夜激情久久久| 精品一区二区三区的国产在线播放| 国产精品亚洲第一| 97se狠狠狠综合亚洲狠狠| 欧美视频中文一区二区三区在线观看| 欧美精品一卡两卡| 精品国产第一区二区三区观看体验| 国产日韩欧美亚洲| 亚洲男人的天堂网| 免费av网站大全久久| 成人精品国产免费网站| 色一区在线观看| 日韩美女一区二区三区| 亚洲欧洲精品一区二区三区| 日日骚欧美日韩| 风间由美一区二区av101| 欧美日韩亚洲综合一区| 久久精品人人爽人人爽| 亚洲大片精品永久免费| 成人亚洲一区二区一| 欧美性做爰猛烈叫床潮| 久久久99免费| 亚洲va韩国va欧美va精品| 国产精品系列在线观看| 精品视频资源站| 中文字幕精品在线不卡| 亚洲国产成人av好男人在线观看| 国产麻豆精品久久一二三| 欧美四级电影网| 中文字幕在线一区| 精品亚洲国产成人av制服丝袜| 色999日韩国产欧美一区二区| 久久综合色一综合色88|