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

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

?? serial.c

?? FreeRTOS V4.2.1,增加了AVR32 UC3 和 LPC2368 的支持
?? C
字號:
/*
	FreeRTOS.org V4.2.1 - Copyright (C) 2003-2007 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.

	Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
	with commercial development and support options.
	***************************************************************************
*/


/* 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一区二区三区免费野_久草精品视频
欧美性欧美巨大黑白大战| 日本色综合中文字幕| 国产欧美日韩三区| 亚洲精品一区二区三区香蕉| 欧美精品一二三| 欧美一区二区三区小说| 91精品国产综合久久小美女| 欧美精品xxxxbbbb| 日韩欧美国产一区二区在线播放| 91精品免费观看| 久久影视一区二区| 久久精品亚洲乱码伦伦中文| 亚洲国产高清在线| 一区在线中文字幕| 一个色在线综合| 日韩—二三区免费观看av| 理论电影国产精品| 风间由美中文字幕在线看视频国产欧美| 国产精品一区二区黑丝| 91亚洲大成网污www| 欧美日韩一区二区三区四区五区| 国产精品毛片久久久久久| 自拍偷自拍亚洲精品播放| 一区二区激情小说| 美女网站色91| 成人app网站| 7777精品伊人久久久大香线蕉完整版 | 99国内精品久久| 欧美在线999| 精品国产亚洲在线| 国产精品久久777777| 婷婷中文字幕一区三区| 久久电影网电视剧免费观看| av高清久久久| 欧美一区二区大片| ...av二区三区久久精品| 日本不卡视频在线| av电影在线观看一区| 欧美一区二区三区视频| 中文一区一区三区高中清不卡| 亚洲影院免费观看| 国产经典欧美精品| 欧美顶级少妇做爰| 国产精品麻豆一区二区| 美国欧美日韩国产在线播放| 色一情一乱一乱一91av| 久久九九影视网| 日日摸夜夜添夜夜添亚洲女人| 粉嫩一区二区三区在线看| 这里只有精品电影| 亚洲色图欧洲色图| 国产成人99久久亚洲综合精品| 欧美久久免费观看| 亚洲一区中文日韩| fc2成人免费人成在线观看播放 | 丝袜诱惑制服诱惑色一区在线观看 | 丁香另类激情小说| 日韩一区二区精品葵司在线| 亚洲欧美另类在线| 成人三级伦理片| 欧美精品一区二| 青青草国产成人av片免费| 色偷偷88欧美精品久久久| 日本一区二区三区电影| 久草这里只有精品视频| 91精品国产综合久久香蕉麻豆 | 欧美日韩国产综合一区二区| 中文字幕一区二区三中文字幕| 国产永久精品大片wwwapp | 精品亚洲欧美一区| 日韩三级精品电影久久久| 婷婷夜色潮精品综合在线| 欧美亚洲国产一区二区三区| 亚洲天天做日日做天天谢日日欢| 91免费在线视频观看| 2024国产精品视频| 精品一区二区三区蜜桃| 精品国产污污免费网站入口 | 亚洲视频一区二区免费在线观看| 国产黑丝在线一区二区三区| 2021中文字幕一区亚洲| 亚洲三级电影网站| 国产乱码精品一区二区三区忘忧草 | 91丝袜高跟美女视频| 中文字幕一区二区三中文字幕| 成人涩涩免费视频| 亚洲婷婷在线视频| 在线看国产一区| 日韩电影在线看| 2023国产精华国产精品| 国产精品18久久久久久久久久久久| 久久精子c满五个校花| 粉嫩av一区二区三区粉嫩| 中文字幕乱码亚洲精品一区| 99免费精品视频| 亚洲成人免费电影| 欧美一级午夜免费电影| 国产风韵犹存在线视精品| 国产精品卡一卡二卡三| 欧美在线一二三四区| 久久er99精品| 中文字幕一区日韩精品欧美| 欧美午夜不卡在线观看免费| 国产激情视频一区二区在线观看 | 国产精品天美传媒沈樵| 97久久超碰国产精品电影| 亚洲国产精品久久久久婷婷884 | 亚洲国产成人av网| 欧美xfplay| 99国产精品久| 久久av资源网| 一区二区高清视频在线观看| 日韩欧美电影一区| 色综合久久中文综合久久牛| 奇米影视一区二区三区小说| 欧美国产一区二区| 欧美一区二区三区免费大片| 成人avav在线| 经典三级在线一区| 亚洲一区影音先锋| 中文字幕av一区二区三区高| 欧美一区二区三区免费视频 | 日本人妖一区二区| 1024精品合集| 久久亚洲免费视频| 欧美精品xxxxbbbb| 91蜜桃在线观看| 国产v日产∨综合v精品视频| 日韩不卡一二三区| 亚洲一区av在线| 国产精品电影一区二区| 精品国精品自拍自在线| 欧美视频一区二区| 91在线观看成人| 国产精品996| 麻豆精品视频在线观看| 亚洲乱码精品一二三四区日韩在线 | 午夜伊人狠狠久久| 亚洲男人的天堂在线观看| 国产亚洲视频系列| 精品国产sm最大网站免费看| 日韩一区二区免费在线电影 | 91精品久久久久久久99蜜桃| 在线亚洲人成电影网站色www| 日本韩国精品一区二区在线观看| 国产一区二区三区| 毛片av一区二区| 麻豆精品视频在线观看视频| 男男gaygay亚洲| 日韩不卡一区二区三区| 日韩av成人高清| 日韩电影一二三区| 蜜臀av在线播放一区二区三区| 午夜精品爽啪视频| 亚州成人在线电影| 亚洲福利视频导航| 天涯成人国产亚洲精品一区av| 亚洲电影在线播放| 天堂av在线一区| 日韩国产精品大片| 麻豆久久一区二区| 国产麻豆成人精品| 粉嫩一区二区三区在线看| 国产福利一区二区三区视频在线| 国产高清成人在线| 99精品视频一区| 在线观看视频欧美| 欧美视频一区在线观看| 欧美一区二区三区系列电影| 亚洲精品在线一区二区| 国产视频亚洲色图| 亚洲视频中文字幕| 日日夜夜免费精品| 国产一区二区三区免费在线观看| 国产成人精品亚洲日本在线桃色| 国产成人亚洲综合a∨婷婷| av电影在线观看完整版一区二区| 91电影在线观看| 日韩你懂的在线播放| 欧美激情一区二区三区不卡 | 美女精品自拍一二三四| 国产·精品毛片| 欧美在线观看你懂的| 欧美大黄免费观看| 亚洲免费视频中文字幕| 日本视频一区二区| 成人97人人超碰人人99| 欧美丰满高潮xxxx喷水动漫| 亚洲精品一区二区三区香蕉| 亚洲最快最全在线视频| 国产麻豆成人精品| 91黄色在线观看| 精品欧美乱码久久久久久 | 欧美videofree性高清杂交| 国产精品久久久久久久久免费相片| 亚洲超丰满肉感bbw| 国产精品一区专区| 91.麻豆视频| 中文字幕一区在线| 国产精品影视网|