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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? serial.c

?? MCS-51的一個Free小型操作系統,在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 port 1.

Note that this driver is written to test the RTOS port and is not intended
to represent an optimised solution. */

/* Processor Expert generated includes. */
#include "com0.h"

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

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

/* The queues used to communicate between the task code and the interrupt
service routines. */
static xQueueHandle xRxedChars; 
static xQueueHandle xCharsForTx; 

/* Interrupt identification bits. */
#define serOVERRUN_INTERRUPT		( 0x08 )
#define serRX_INTERRUPT				( 0x20 )
#define serTX_INTERRUPT				( 0x80 )

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


/*
 * Initialise port for interrupt driven communications.
 */
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
	/* Hardware setup is performed by the Processor Expert generated code.  
	This function just creates the queues used to communicate between the 
	interrupt code and the task code - then sets the required baud rate. */

	xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );
	xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed portCHAR ) );

	COM0_SetBaudRateMode( ( portCHAR ) ulWantedBaud );

	return NULL;
}
/*-----------------------------------------------------------*/

signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed portCHAR *pcRxedChar, portTickType xBlockTime )
{
	/* Get the next character from the buffer queue.  Return false if no characters
	are available, or arrive before xBlockTime expires. */
	if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
	{
		return pdTRUE;
	}
	else
	{
		return pdFALSE;
	}
}
/*-----------------------------------------------------------*/

signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed portCHAR cOutChar, portTickType xBlockTime )
{
	/* Place the character in the queue of characters to be transmitted. */
	if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
	{
		return pdFAIL;
	}

	/* Turn on the Tx interrupt so the ISR will remove the character from the
	queue and send it.   This does not need to be in a critical section as
	if the interrupt has already removed the character the next interrupt
	will simply turn off the Tx interrupt again. */
	SCI0CR2_SCTIE = 1;;

	return pdPASS;
}
/*-----------------------------------------------------------*/

void vSerialClose( xComPortHandle xPort )
{	
	/* Not supported. */
	( void ) xPort;
}
/*-----------------------------------------------------------*/


/* 
 * Interrupt service routine for the serial port.  Must be in non-banked
 * memory. 
 */

#pragma CODE_SEG __NEAR_SEG NON_BANKED

__interrupt void vCOM0_ISR( void )
{
volatile unsigned portCHAR ucByte, ucStatus;
portBASE_TYPE xTaskWokenByPost = pdFALSE, xTaskWokenByTx = pdFALSE;

	/* What caused the interrupt? */
	ucStatus = SCI0SR1;
	
	if( ucStatus & serOVERRUN_INTERRUPT )
	{
		/* The interrupt was caused by an overrun.  Clear the error by reading
		the data register. */
		ucByte = SCI0DRL;
	}

	if( ucStatus & serRX_INTERRUPT )
	{	
		/* The interrupt was caused by a character being received.
		Read the received byte. */
		ucByte = SCI0DRL;                      

		/* Post the character onto the queue of received characters - noting
		whether or not this wakes a task. */
		xTaskWokenByPost = xQueueSendFromISR( xRxedChars, ( void * ) &ucByte, pdFALSE );		
	}
	
	if( ( ucStatus & serTX_INTERRUPT ) && ( SCI0CR2_SCTIE ) )
	{	
		/* The interrupt was caused by a character being transmitted. */
		if( xQueueReceiveFromISR( xCharsForTx, ( void * ) &ucByte, &xTaskWokenByTx ) == pdTRUE )
		{
			/* Clear the SCRF bit. */
			SCI0DRL = ucByte;
		}
		else
		{
			/* Disable transmit interrupt */
			SCI0CR2_SCTIE = 0;                 
		}
	}

	if( ( xTaskWokenByPost ) || ( xTaskWokenByTx ) )
	{
		portYIELD();
	}
}

#pragma CODE_SEG DEFAULT

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品自拍偷拍动漫精品| av电影在线观看不卡| 一区二区成人在线| 中文字幕在线不卡一区二区三区| 欧美国产精品一区二区| 国产色产综合产在线视频| 国产欧美一区二区精品忘忧草 | 欧美日韩国产综合草草| 91蜜桃在线免费视频| 99久久99久久精品免费观看| 色噜噜狠狠成人网p站| 欧美人妖巨大在线| 欧美哺乳videos| 国产日韩亚洲欧美综合| 国产精品不卡一区| 国产精品第四页| 亚洲高清久久久| 九九精品一区二区| 成人av午夜电影| 欧美日本国产一区| 久久久精品一品道一区| 亚洲精品少妇30p| 免费观看一级欧美片| 成人精品鲁一区一区二区| 在线精品视频免费播放| 日韩欧美一区二区免费| 中文字幕精品三区| 亚洲国产精品久久不卡毛片| 久久狠狠亚洲综合| 成人av免费在线观看| 欧美日韩三级在线| 久久精品视频在线看| 亚洲一线二线三线视频| 国产精品亚洲一区二区三区在线| 91在线观看免费视频| 日韩免费一区二区| 亚洲手机成人高清视频| 捆绑调教美女网站视频一区| 成人久久久精品乱码一区二区三区| 欧美色倩网站大全免费| 久久九九久久九九| 天堂资源在线中文精品| av午夜一区麻豆| 日韩精品一区二区三区四区| 亚洲精品国产a| 国产成人啪午夜精品网站男同| 欧美美女激情18p| 亚洲日本一区二区三区| 国产成人精品综合在线观看| 欧美肥妇毛茸茸| **欧美大码日韩| 国产成人自拍网| 欧美变态口味重另类| 亚洲成人一区在线| 91黄色激情网站| 国产精品家庭影院| 国产成人免费高清| 久久久久久久久伊人| 国产一区二区三区久久久| 欧美综合天天夜夜久久| 中文字幕一区二区三区不卡| 国产黄人亚洲片| 日韩亚洲欧美高清| 蜜臀av亚洲一区中文字幕| 欧美日韩一级二级三级| 亚洲综合视频在线观看| 91久久国产最好的精华液| 国产精品福利一区二区三区| 成人午夜精品一区二区三区| 国产亚洲自拍一区| 国产精品白丝jk黑袜喷水| 欧美tk—视频vk| 久久99热这里只有精品| 精品国产网站在线观看| 精品中文字幕一区二区| 精品日韩欧美一区二区| 精品一区二区三区视频| 精品国产污污免费网站入口 | 91农村精品一区二区在线| 国产精品每日更新| 97久久精品人人爽人人爽蜜臀| 中文字幕在线观看不卡视频| 色综合久久88色综合天天| 亚洲女厕所小便bbb| 欧美色图激情小说| 蜜桃av一区二区三区| 久久毛片高清国产| av亚洲精华国产精华| 一区二区三区美女| 日韩欧美国产高清| 国产精品一区二区免费不卡| 日韩一区中文字幕| 欧洲亚洲国产日韩| 韩国av一区二区三区四区| 欧美国产精品一区| 欧美无砖专区一中文字| 免费成人在线播放| 国产精品久久99| 欧美日韩一卡二卡| 国产在线精品一区二区| 亚洲天堂av老司机| 日韩欧美国产午夜精品| aaa国产一区| 三级一区在线视频先锋 | 欧美日韩一卡二卡三卡| 经典一区二区三区| 国产精品久久久久久久久久免费看| 在线亚洲高清视频| 精品综合久久久久久8888| 亚洲欧美日韩电影| 久久久久久久久久久99999| 色婷婷一区二区| 极品少妇xxxx偷拍精品少妇| 亚洲天堂a在线| 久久久久国产精品麻豆| 欧美日韩亚洲综合一区 | 蜜臀av国产精品久久久久| 欧美国产欧美综合| 日韩精品中午字幕| 色美美综合视频| 国产69精品久久久久毛片| 天堂va蜜桃一区二区三区| 中文字幕一区二区三区在线观看 | 国内偷窥港台综合视频在线播放| 亚洲人成网站在线| 久久久久久久免费视频了| 制服丝袜亚洲播放| 在线观看视频一区二区欧美日韩| 国产精品一区在线| 日本不卡一区二区三区高清视频| 一区二区三区在线观看欧美| 国产欧美一区二区三区在线看蜜臀| 日韩一区二区免费在线观看| 欧美日韩视频在线第一区| 97久久精品人人做人人爽| 成人午夜激情片| 久久不见久久见免费视频1| 青青青伊人色综合久久| 午夜精品福利一区二区蜜股av| 亚洲女女做受ⅹxx高潮| 中文字幕一区日韩精品欧美| 国产片一区二区| 久久久99精品久久| 久久久高清一区二区三区| 2023国产精品| 久久亚洲精精品中文字幕早川悠里| 欧美一区二区三区小说| 欧美裸体bbwbbwbbw| 欧美日韩黄色一区二区| 欧美日韩和欧美的一区二区| 欧美精品乱人伦久久久久久| 欧美天天综合网| 欧美久久久久久蜜桃| 欧美丰满一区二区免费视频 | 一色屋精品亚洲香蕉网站| 中文字幕第一区综合| 国产精品传媒入口麻豆| 亚洲欧美一区二区三区国产精品| 亚洲三级在线播放| 亚洲综合图片区| 日韩精品每日更新| 极品美女销魂一区二区三区| 狠狠色狠狠色综合系列| 国产成人免费av在线| av成人老司机| 欧美日韩不卡一区| 久久综合九色综合久久久精品综合| 久久无码av三级| 国产精品国产自产拍高清av王其| 亚洲人成小说网站色在线| 丝袜美腿亚洲一区二区图片| 麻豆精品久久久| 成人av综合一区| 欧美日韩一区二区三区在线| 日韩精品资源二区在线| 亚洲人午夜精品天堂一二香蕉| 亚洲成av人片在线| 国产综合色精品一区二区三区| 国产a级毛片一区| 欧美三级日韩在线| 久久一日本道色综合| 玉米视频成人免费看| 日韩不卡免费视频| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 日本乱码高清不卡字幕| 3d动漫精品啪啪一区二区竹菊| 久久色成人在线| 亚洲亚洲精品在线观看| 精品一区二区免费| 91久久一区二区| 国产午夜精品一区二区三区嫩草| 亚洲日本青草视频在线怡红院 | 亚洲欧美日韩中文播放| 美女性感视频久久| 99在线精品视频| 精品播放一区二区| 婷婷亚洲久悠悠色悠在线播放| 国产精品自拍在线| 7777精品久久久大香线蕉| 中文字幕在线观看不卡视频|