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

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

?? port.c

?? MCS-51的一個Free小型操作系統,在KeilC中下編譯工作
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
	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.
	***************************************************************************
*/

/*-----------------------------------------------------------
 * Implementation of functions defined in portable.h for the Cygnal port.
 *----------------------------------------------------------*/

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

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

/* Constants required to setup timer 2 to produce the RTOS tick. */
#define portCLOCK_DIVISOR				( ( unsigned portLONG ) 12 )
#define portMAX_TIMER_VALUE				( ( unsigned portLONG ) 0xffff )
#define portENABLE_TIMER				( ( unsigned portCHAR ) 0x04 )
#define portTIMER_2_INTERRUPT_ENABLE	( ( unsigned portCHAR ) 0x20 )

/* The value used in the IE register when a task first starts. */
#define portGLOBAL_INTERRUPT_BIT	( ( portSTACK_TYPE ) 0x80 )

/* The value used in the PSW register when a task first starts. */
#define portINITIAL_PSW				( ( portSTACK_TYPE ) 0x00 )

/* Macro to clear the timer 2 interrupt flag. */
#define portCLEAR_INTERRUPT_FLAG()	TMR2CN &= ~0x80;

/* Used during a context switch to store the size of the stack being copied
to or from XRAM. */
data static unsigned portCHAR ucStackBytes;

/* Used during a context switch to point to the next byte in XRAM from/to which
a RAM byte is to be copied. */
xdata static portSTACK_TYPE * data pxXRAMStack;

/* Used during a context switch to point to the next byte in RAM from/to which
an XRAM byte is to be copied. */
data static portSTACK_TYPE * data pxRAMStack;

/* We require the address of the pxCurrentTCB variable, but don't want to know
any details of its type. */
typedef void tskTCB;
extern volatile tskTCB * volatile pxCurrentTCB;

/*
 * Setup the hardware to generate an interrupt off timer 2 at the required 
 * frequency.
 */
static void prvSetupTimerInterrupt( void );

/*-----------------------------------------------------------*/
/*
 * Macro that copies the current stack from internal RAM to XRAM.  This is 
 * required as the 8051 only contains enough internal RAM for a single stack, 
 * but we have a stack for every task.
 */
#define portCOPY_STACK_TO_XRAM()																\
{																								\
	/* pxCurrentTCB points to a TCB which itself points to the location into					\
	which the first	stack byte should be copied.  Set pxXRAMStack to point						\
	to the location into which the first stack byte is to be copied. */							\
	pxXRAMStack = ( xdata portSTACK_TYPE * ) *( ( xdata portSTACK_TYPE ** ) pxCurrentTCB );		\
																								\
	/* Set pxRAMStack to point to the first byte to be coped from the stack. */					\
	pxRAMStack = ( data portSTACK_TYPE * data ) configSTACK_START;								\
																								\
	/* Calculate the size of the stack we are about to copy from the current					\
	stack pointer value. */																		\
	ucStackBytes = SP - ( configSTACK_START - 1 );												\
																								\
	/* Before starting to copy the stack, store the calculated stack size so					\
	the stack can be restored when the task is resumed. */										\
	*pxXRAMStack = ucStackBytes;																\
																								\
	/* Copy each stack byte in turn.  pxXRAMStack is incremented first as we					\
	have already stored the stack size into XRAM. */											\
	while( ucStackBytes )																		\
	{																							\
		pxXRAMStack++;																			\
		*pxXRAMStack = *pxRAMStack;																\
		pxRAMStack++;																			\
		ucStackBytes--;																			\
	}																							\
}
/*-----------------------------------------------------------*/

/*
 * Macro that copies the stack of the task being resumed from XRAM into 
 * internal RAM.
 */
#define portCOPY_XRAM_TO_STACK()																\
{																								\
	/* Setup the pointers as per portCOPY_STACK_TO_XRAM(), but this time to						\
	copy the data back out of XRAM and into the stack. */										\
	pxXRAMStack = ( xdata portSTACK_TYPE * ) *( ( xdata portSTACK_TYPE ** ) pxCurrentTCB );		\
	pxRAMStack = ( data portSTACK_TYPE * data ) ( configSTACK_START - 1 );						\
																								\
	/* The first value stored in XRAM was the size of the stack - i.e. the						\
	number of bytes we need to copy back. */													\
	ucStackBytes = pxXRAMStack[ 0 ];															\
																								\
	/* Copy the required number of bytes back into the stack. */								\
	do																							\
	{																							\
		pxXRAMStack++;																			\
		pxRAMStack++;																			\
		*pxRAMStack = *pxXRAMStack;																\
		ucStackBytes--;																			\
	} while( ucStackBytes );																	\
																								\
	/* Restore the stack pointer ready to use the restored stack. */							\
	SP = ( unsigned portCHAR ) pxRAMStack;														\
}
/*-----------------------------------------------------------*/

/*
 * Macro to push the current execution context onto the stack, before the stack 
 * is moved to XRAM. 
 */
#define portSAVE_CONTEXT()																		\
{																								\
	_asm																						\
		/* Push ACC first, as when restoring the context it must be restored					\
		last (it is used to set the IE register). */											\
		push	ACC																				\
		/* Store the IE register then disable interrupts. */									\
		push	IE																				\
		clr		_EA																				\
		push	DPL																				\
		push	DPH																				\
		push	b																				\
		push	ar2																				\
		push	ar3																				\
		push	ar4																				\
		push	ar5																				\
		push	ar6																				\
		push	ar7																				\
		push	ar0																				\
		push	ar1																				\
		push	PSW																				\
	_endasm;																					\
		PSW = 0;																				\
	_asm																						\
		push	_bp																				\
	_endasm;																					\
}
/*-----------------------------------------------------------*/

/*
 * Macro that restores the execution context from the stack.  The execution 
 * context was saved into the stack before the stack was copied into XRAM.
 */
#define portRESTORE_CONTEXT()																	\
{																								\
	_asm																						\
		pop		_bp																				\
		pop		PSW																				\
		pop		ar1																				\
		pop		ar0																				\
		pop		ar7																				\
		pop		ar6																				\
		pop		ar5																				\
		pop		ar4																				\
		pop		ar3																				\
		pop		ar2																				\
		pop		b																				\
		pop		DPH																				\
		pop		DPL																				\
		/* The next byte of the stack is the IE register.  Only the global						\
		enable bit forms part of the task context.  Pop off the IE then set						\
		the global enable bit to match that of the stored IE register. */						\
		pop		ACC																				\
		JB		ACC.7,0098$																		\
		CLR		IE.7																			\
		LJMP	0099$																			\
	0098$:																						\
		SETB	IE.7																			\
	0099$:																						\
		/* Finally pop off the ACC, which was the first register saved. */						\
		pop		ACC																				\
		reti																					\
	_endasm;																					\
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕亚洲电影| 日本最新不卡在线| 国产成人免费在线视频| 欧美成人一区二区三区在线观看| 亚洲图片自拍偷拍| 色哟哟亚洲精品| 国产精品人妖ts系列视频| 国产一区二区影院| 最新欧美精品一区二区三区| 欧洲精品中文字幕| 美日韩一区二区三区| 91精品国产综合久久久久| 亚洲1区2区3区4区| 精品久久一二三区| 成人午夜大片免费观看| 一区二区三区四区不卡在线| 欧美亚洲国产怡红院影院| 日本欧美大码aⅴ在线播放| 久久综合久久综合亚洲| 色呦呦国产精品| 经典三级视频一区| 国产精品网站在线播放| 91片在线免费观看| 久久99蜜桃精品| 成人免费视频在线观看| 欧美日韩一区二区在线观看| 激情综合网激情| 午夜久久久影院| 国产女人18毛片水真多成人如厕| 91亚洲精品久久久蜜桃网站| 日本亚洲最大的色成网站www| 中文字幕成人在线观看| 欧美精品乱人伦久久久久久| 成人黄色大片在线观看| 免费在线观看视频一区| 亚洲一区二区三区四区在线免费观看 | 国产a久久麻豆| 久久99精品国产.久久久久久| 亚洲福利视频三区| 国产精品电影一区二区| 精品sm在线观看| 日韩欧美国产麻豆| 日韩精品资源二区在线| 欧美xxxx老人做受| 久久久不卡影院| 国产亚洲欧美在线| 亚洲色图在线播放| 亚洲老司机在线| 亚洲国产精品综合小说图片区| 亚洲综合久久av| 亚洲成人在线免费| 久久电影网站中文字幕| 国产一区二区精品久久| 国产精品一卡二卡在线观看| eeuss鲁片一区二区三区| 成人激情综合网站| 成人性生交大片免费看中文| 国产综合成人久久大片91| 蜜桃一区二区三区在线观看| 日韩国产高清在线| 久久9热精品视频| 亚洲国产美女搞黄色| 午夜精品成人在线视频| 日本麻豆一区二区三区视频| 久久精品国内一区二区三区| 亚洲精品福利视频网站| 亚洲gay无套男同| 成人网男人的天堂| 在线观看网站黄不卡| 91麻豆精品国产91久久久更新时间| 69堂亚洲精品首页| 欧美大片免费久久精品三p| 国产精品三级视频| 视频在线观看一区二区三区| 国产在线视频精品一区| 99re成人精品视频| 91在线视频播放| 日韩免费成人网| 久久久久久久久久看片| 一区二区三区在线视频观看58| 亚洲一区在线看| 国产高清在线精品| 不卡的看片网站| 欧美肥大bbwbbw高潮| 日本一区二区三区在线观看| 舔着乳尖日韩一区| 99久久亚洲一区二区三区青草| 99在线热播精品免费| 26uuu久久天堂性欧美| 悠悠色在线精品| 成人性生交大合| 精品久久久久一区| 蜜桃视频在线一区| 在线观看一区二区视频| 亚洲天堂网中文字| 国产成人免费视频精品含羞草妖精| 在线观看视频一区| 亚洲精品免费一二三区| av成人免费在线| 中文字幕高清不卡| 亚洲一区二区三区在线| 色丁香久综合在线久综合在线观看| 国产欧美日韩麻豆91| 极品少妇一区二区三区精品视频| 欧美午夜影院一区| 性欧美疯狂xxxxbbbb| 在线精品国精品国产尤物884a | 国产精品另类一区| 国产成人精品三级| 国产精品美女久久久久久久| 国产乱子伦一区二区三区国色天香| 777精品伊人久久久久大香线蕉| 亚洲欧美成人一区二区三区| 一本大道久久a久久精品综合| 国产精品毛片无遮挡高清| www.日韩大片| 亚洲欧洲日韩一区二区三区| 色综合久久中文字幕综合网| 亚洲精品成a人| 欧美一级精品在线| 国产aⅴ精品一区二区三区色成熟| 国产三级精品三级| 欧美影院精品一区| 人人精品人人爱| 久久精品欧美一区二区三区不卡| 不卡一二三区首页| 国产亚洲人成网站| 91免费国产在线| 亚洲最快最全在线视频| 欧美v国产在线一区二区三区| 粉嫩av一区二区三区在线播放 | 在线一区二区三区四区五区| 亚洲成av人**亚洲成av**| 日韩精品在线一区二区| 91一区二区在线观看| 黄页网站大全一区二区| 一区二区三国产精华液| 91精品国产乱| 日本道精品一区二区三区| 激情五月播播久久久精品| 亚洲一区二区三区四区五区中文 | 国产成人小视频| 久久99精品久久久久久动态图| 国产精品久久久久久久久快鸭 | 日韩国产一二三区| 亚洲品质自拍视频| 中文字幕免费一区| 宅男噜噜噜66一区二区66| 日本精品视频一区二区三区| 国产剧情av麻豆香蕉精品| 美女免费视频一区二区| 看片的网站亚洲| 美国十次综合导航| 另类小说欧美激情| 五月天激情综合网| 亚洲图片欧美色图| 亚洲动漫第一页| 国产日韩欧美麻豆| 中文字幕中文字幕一区| 国产精品免费网站在线观看| 精品99一区二区| 欧美激情综合五月色丁香小说| 欧美一区二区三区影视| 欧美一级日韩免费不卡| 884aa四虎影成人精品一区| 色婷婷国产精品| 欧美撒尿777hd撒尿| 91精品国产91综合久久蜜臀| 欧美mv日韩mv| 久久久国产精品不卡| 欧美国产一区在线| 日韩一区中文字幕| 日韩精品91亚洲二区在线观看 | 色悠久久久久综合欧美99| 成人高清在线视频| 在线91免费看| 亚洲国产精品高清| 日日摸夜夜添夜夜添国产精品| 久久精品国产亚洲一区二区三区| 国产美女精品一区二区三区| 欧美影院一区二区| 欧美激情一区二区在线| 日韩—二三区免费观看av| 成人av网站在线| 日韩美一区二区三区| 国产精品久99| 偷偷要91色婷婷| av在线一区二区三区| 久久奇米777| 狠狠色伊人亚洲综合成人| 欧美一区二区人人喊爽| 午夜电影一区二区| 欧美天天综合网| 亚洲国产精品视频| 欧美日韩精品一区二区三区| 亚洲资源中文字幕| 欧美日韩一区二区三区不卡| 亚洲最新在线观看| 欧美日韩三级一区| 天天影视色香欲综合网老头|