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

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

?? port.c

?? FreeRTOSV3.2.0 經典嵌入式操作系統
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
	FreeRTOS V3.2.0 - Copyright (C) 2003 - 2005 Richard Barry.

	This file is part of the FreeRTOS distribution.

	FreeRTOS 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 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; 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, 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一区二区三区免费野_久草精品视频
欧美精品一卡二卡| 欧美在线综合视频| 麻豆成人免费电影| 亚洲v日本v欧美v久久精品| 亚洲精品国产成人久久av盗摄 | 日本一区二区三区视频视频| 日韩欧美在线观看一区二区三区| 欧美一区二区二区| 日韩欧美一区中文| 久久久久99精品一区| 国产精品私人影院| 亚洲靠逼com| 日韩国产欧美在线视频| 精品一区二区三区日韩| 成人免费视频一区| 91福利区一区二区三区| 91精品国产综合久久精品麻豆| 欧美精品久久一区二区三区| 日韩欧美亚洲一区二区| 久久综合色鬼综合色| 国产精品久久网站| 亚洲一区影音先锋| 激情综合网av| 91网页版在线| 日韩视频123| 成人免费在线观看入口| 日本伊人色综合网| 国产69精品久久久久777| 色综合久久久久综合| 欧美成人女星排行榜| 亚洲日本在线a| 秋霞午夜av一区二区三区| 成人免费看片app下载| 欧美三级视频在线| 精品乱码亚洲一区二区不卡| 亚洲视频免费观看| 国产综合色视频| 欧美午夜一区二区| 国产精品乱人伦| 日韩av一级片| 91美女片黄在线观看| 精品精品国产高清a毛片牛牛 | 91免费看片在线观看| 欧美精选午夜久久久乱码6080| 亚洲精品在线免费播放| 亚洲综合视频网| 国产成人三级在线观看| 欧美日韩国产中文| 中文字幕一区二区三区在线播放| 久久国产欧美日韩精品| 91久久一区二区| 国产精品理论在线观看| 美女视频网站久久| 99国产精品久久久| 久久久久久久综合| 蜜桃久久av一区| 欧美军同video69gay| 最新成人av在线| 成人国产亚洲欧美成人综合网| 日韩午夜激情电影| 日本午夜一本久久久综合| 日本高清无吗v一区| 国产精品久久久久久久久久免费看| 精品一区二区免费在线观看| 这里只有精品免费| 午夜伦理一区二区| 色天使色偷偷av一区二区| 中文字幕亚洲成人| 9久草视频在线视频精品| 国产亚洲一区二区三区| 精品一区二区日韩| 久久―日本道色综合久久| 精品一区二区三区久久| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 中文字幕精品在线不卡| 久久99日本精品| 欧美一区二区免费视频| 免费av网站大全久久| 欧美一级视频精品观看| 日本美女一区二区三区| 精品国产乱码久久久久久影片| 一区二区免费看| 欧美唯美清纯偷拍| 日韩成人免费电影| 欧美一区二区三区思思人| 蜜桃一区二区三区在线| 久久一日本道色综合| 国产成人综合视频| 亚洲国产精品传媒在线观看| 99久久综合精品| 亚洲最大的成人av| 91麻豆精品国产91久久久久久| 日韩av高清在线观看| 精品裸体舞一区二区三区| 国产在线播放一区| 亚洲色图欧洲色图婷婷| 欧美色综合网站| 久久成人免费日本黄色| 国产欧美日韩在线| 在线影院国内精品| 极品少妇xxxx精品少妇| 国产精品乱人伦中文| 欧美日韩在线播放三区| 久久99国产精品成人| 国产精品久久久久永久免费观看| 色婷婷亚洲综合| 九九视频精品免费| 国产精品免费av| 欧美伦理影视网| 国产成人自拍高清视频在线免费播放| 综合精品久久久| 欧美成人女星排名| 在线视频你懂得一区| 久久99精品国产91久久来源| 亚洲女与黑人做爰| 久久久久国产精品麻豆ai换脸| 日本高清无吗v一区| 国产一区91精品张津瑜| 亚洲第一成年网| 国产精品成人免费 | 韩国av一区二区三区| 亚洲欧美在线aaa| 精品美女一区二区| 欧美日韩黄色影视| www.性欧美| 国产成人精品午夜视频免费| 天堂精品中文字幕在线| 亚洲视频中文字幕| 久久久精品人体av艺术| 欧美一卡二卡在线| 欧美日韩亚洲综合在线| 99久久精品一区| 国产成人精品免费视频网站| 久久成人免费日本黄色| 午夜精品福利视频网站| 一区二区三区日韩精品| 中文字幕免费观看一区| 久久久久久9999| 日韩亚洲欧美成人一区| 91精品中文字幕一区二区三区| 91老师国产黑色丝袜在线| jlzzjlzz亚洲女人18| 国产激情一区二区三区| 国产精品羞羞答答xxdd| 国产主播一区二区三区| 精品一区免费av| 麻豆91在线播放免费| 久久精品国产精品青草| 免费观看成人鲁鲁鲁鲁鲁视频| 午夜精品福利在线| 性欧美疯狂xxxxbbbb| 亚洲小少妇裸体bbw| 亚洲国产一区二区三区青草影视 | 欧美精品国产精品| 欧美人与禽zozo性伦| 欧美日韩成人一区| 这里只有精品99re| 欧美xxxxxxxxx| xfplay精品久久| 国产亚洲综合av| 国产精品久久久99| 亚洲精品高清在线| 一区二区欧美在线观看| 亚洲成人1区2区| 久久精品国产99国产| 国产一区二区三区日韩| 国产成人小视频| 99精品偷自拍| 欧美美女网站色| 久久久亚洲欧洲日产国码αv| 久久久久久影视| 中文字幕亚洲欧美在线不卡| 一区二区三区小说| 日本在线不卡视频| 国产精品一二三四区| 一本色道a无线码一区v| 欧美日韩国产一二三| 欧美大胆人体bbbb| 中国av一区二区三区| 亚洲一区欧美一区| 精品一区二区三区视频| 99久久国产综合精品麻豆| 欧美日韩一区二区在线观看视频| 日韩欧美一卡二卡| 日韩一区欧美小说| 蜜桃精品在线观看| 91视频在线看| 欧美电影免费提供在线观看| 亚洲欧洲无码一区二区三区| 日本伊人午夜精品| 99精品国产热久久91蜜凸| 91精品欧美福利在线观看| 国产精品久久久久久久裸模 | 久久一日本道色综合| 亚洲精品一二三区| 国产高清亚洲一区| 欧美日韩电影在线播放| 国产精品国产三级国产aⅴ入口| 日韩国产成人精品| 一本色道久久综合狠狠躁的推荐|