亚洲欧美第一页_禁久久精品乱码_粉嫩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.
	***************************************************************************
*/

/* 
Changes between V1.2.4 and V1.2.5

	+ Introduced portGLOBAL_INTERRUPT_FLAG definition to test the global 
	  interrupt flag setting.  Using the two bits defined within
	  portINITAL_INTERRUPT_STATE was causing the w register to get clobbered
	  before the test was performed.

Changes from V1.2.5

	+ Set the interrupt vector address to 0x08.  Previously it was at the
	  incorrect address for compatibility mode of 0x18.

Changes from V2.1.1

	+ PCLATU and PCLATH are now saved as part of the context.  This allows
	  function pointers to be used within tasks.  Thanks to Javier Espeche
	  for the enhancement. 

Changes from V2.3.1

	+ TABLAT is now saved as part of the task context.
	
Changes from V3.2.0

	+ TBLPTRU is now initialised to zero as the MPLAB compiler expects this
	  value and does not write to the register.
*/

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

/* MPLAB library include file. */
#include "timers.h"

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

/* Hardware setup for tick. */
#define portTIMER_FOSC_SCALE			( ( unsigned portLONG ) 4 )

/* Initial interrupt enable state for newly created tasks.  This value is
copied into INTCON when a task switches in for the first time. */
#define portINITAL_INTERRUPT_STATE			0xc0

/* Just the bit within INTCON for the global interrupt flag. */
#define portGLOBAL_INTERRUPT_FLAG			0x80

/* Constant used for context switch macro when we require the interrupt 
enable state to be unchanged when the interrupted task is switched back in. */
#define portINTERRUPTS_UNCHANGED			0x00

/* Some memory areas get saved as part of the task context.  These memory
area's get used by the compiler for temporary storage, especially when 
performing mathematical operations, or when using 32bit data types.  This
constant defines the size of memory area which must be saved. */
#define portCOMPILER_MANAGED_MEMORY_SIZE	( ( unsigned portCHAR ) 0x13 )

/* 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;

/* IO port constants. */
#define portBIT_SET		( ( unsigned portCHAR ) 1 )
#define portBIT_CLEAR	( ( unsigned portCHAR ) 0 )

/*
 * The serial port ISR's are defined in serial.c, but are called from portable
 * as they use the same vector as the tick ISR.
 */
void vSerialTxISR( void );
void vSerialRxISR( void );

/*
 * Perform hardware setup to enable ticks.
 */
static void prvSetupTimerInterrupt( void );

/* 
 * ISR to maintain the tick, and perform tick context switches if the
 * preemptive scheduler is being used.
 */
static void prvTickISR( void );

/*
 * ISR placed on the low priority vector.  This calls the appropriate ISR for
 * the actual interrupt.
 */
static void prvLowInterrupt( void );

/* 
 * Macro that pushes all the registers that make up the context of a task onto
 * the stack, then saves the new top of stack into the TCB.
 * 
 * If this is called from an ISR then the interrupt enable bits must have been 
 * set for the ISR to ever get called.  Therefore we want to save the INTCON
 * register with the enable bits forced to be set - and ucForcedInterruptFlags 
 * must contain these bit settings.  This means the interrupts will again be
 * enabled when the interrupted task is switched back in.
 *
 * If this is called from a manual context switch (i.e. from a call to yield),
 * then we want to save the INTCON so it is restored with its current state,
 * and ucForcedInterruptFlags must be 0.  This allows a yield from within
 * a critical section.
 *
 * The compiler uses some locations at the bottom of the memory for temporary
 * storage during math and other computations.  This is especially true if
 * 32bit data types are utilised (as they are by the scheduler).  The .tmpdata
 * and MATH_DATA sections have to be stored in there entirety as part of a task
 * context.  This macro stores from data address 0x00 to 
 * portCOMPILER_MANAGED_MEMORY_SIZE.  This is sufficient for the demo 
 * applications but you should check the map file for your project to ensure 
 * this is sufficient for your needs.  It is not clear whether this size is 
 * fixed for all compilations or has the potential to be program specific.
 */
#define	portSAVE_CONTEXT( ucForcedInterruptFlags )								\
{																				\
	_asm																		\
		/* Save the status and WREG registers first, as these will get modified	\
		by the operations below. */												\
		MOVFF	WREG, PREINC1													\
		MOVFF   STATUS, PREINC1													\
		/* Save the INTCON register with the appropriate bits forced if			\
		necessary - as described above. */										\
		MOVFF	INTCON, WREG													\
		IORLW	ucForcedInterruptFlags											\
		MOVFF	WREG, PREINC1													\
	_endasm																		\
																				\
	portDISABLE_INTERRUPTS();													\
																				\
	_asm																		\
		/* Store the necessary registers to the stack. */						\
		MOVFF	BSR, PREINC1													\
		MOVFF	FSR2L, PREINC1													\
		MOVFF	FSR2H, PREINC1													\
		MOVFF	FSR0L, PREINC1													\
		MOVFF	FSR0H, PREINC1													\
		MOVFF	TABLAT, PREINC1													\
		MOVFF	TBLPTRU, PREINC1												\
		MOVFF	TBLPTRH, PREINC1												\
		MOVFF	TBLPTRL, PREINC1												\
		MOVFF	PRODH, PREINC1													\
		MOVFF	PRODL, PREINC1													\
		MOVFF	PCLATU, PREINC1													\
		MOVFF	PCLATH, PREINC1													\
		/* Store the .tempdata and MATH_DATA areas as described above. */		\
		CLRF	FSR0L, 0														\
		CLRF	FSR0H, 0														\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	POSTINC0, PREINC1												\
		MOVFF	INDF0, PREINC1													\
		MOVFF	FSR0L, PREINC1													\
		MOVFF	FSR0H, PREINC1													\
		/* Store the hardware stack pointer in a temp register before we		\
		modify it. */															\
		MOVFF	STKPTR, FSR0L													\
	_endasm																		\
																				\
		/* Store each address from the hardware stack. */						\
		while( STKPTR > ( unsigned portCHAR ) 0 )								\
		{																		\
			_asm																\
				MOVFF	TOSL, PREINC1											\
				MOVFF	TOSH, PREINC1											\
				MOVFF	TOSU, PREINC1											\
				POP																\
			_endasm																\
		}																		\
																				\
	_asm																		\
		/* Store the number of addresses on the hardware stack (from the		\
		temporary register). */													\
		MOVFF	FSR0L, PREINC1													\
		MOVF	PREINC1, 1, 0													\
	_endasm																		\
																				\
	/* Save the new top of the software stack in the TCB. */					\
	_asm																		\
		MOVFF	pxCurrentTCB, FSR0L												\
		MOVFF	pxCurrentTCB + 1, FSR0H											\
		MOVFF	FSR1L, POSTINC0													\
		MOVFF	FSR1H, POSTINC0													\
	_endasm																		\
}
/*-----------------------------------------------------------*/

/*
 * This is the reverse of portSAVE_CONTEXT.  See portSAVE_CONTEXT for more
 * details.
 */
#define portRESTORE_CONTEXT()													\
{																				\
	_asm																		\
		/* Set FSR0 to point to pxCurrentTCB->pxTopOfStack. */					\
		MOVFF	pxCurrentTCB, FSR0L												\
		MOVFF	pxCurrentTCB + 1, FSR0H											\
																				\
		/* De-reference FSR0 to set the address it holds into FSR1.				\
		(i.e. *( pxCurrentTCB->pxTopOfStack ) ). */								\
		MOVFF	POSTINC0, FSR1L													\
		MOVFF	POSTINC0, FSR1H													\
																				\
		/* How many return addresses are there on the hardware stack?  Discard	\
		the first byte as we are pointing to the next free space. */			\
		MOVFF	POSTDEC1, FSR0L													\
		MOVFF	POSTDEC1, FSR0L													\
	_endasm																		\
																				\
	/* Fill the hardware stack from our software stack. */						\
	STKPTR = 0;																	\
																				\
	while( STKPTR < FSR0L )														\
	{																			\
		_asm																	\
			PUSH																\
			MOVF	POSTDEC1, 0, 0												\
			MOVWF	TOSU, 0														\
			MOVF	POSTDEC1, 0, 0												\
			MOVWF	TOSH, 0														\
			MOVF	POSTDEC1, 0, 0												\
			MOVWF	TOSL, 0														\
		_endasm																	\
	}																			\
																				\
	_asm																		\
		/* Restore the .tmpdata and MATH_DATA memory. */						\
		MOVFF	POSTDEC1, FSR0H													\
		MOVFF	POSTDEC1, FSR0L													\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, POSTDEC0												\
		MOVFF	POSTDEC1, INDF0													\
		/* Restore the other registers forming the tasks context. */			\
		MOVFF	POSTDEC1, PCLATH												\
		MOVFF	POSTDEC1, PCLATU												\
		MOVFF	POSTDEC1, PRODL													\
		MOVFF	POSTDEC1, PRODH													\
		MOVFF	POSTDEC1, TBLPTRL												\
		MOVFF	POSTDEC1, TBLPTRH												\
		MOVFF	POSTDEC1, TBLPTRU												\
		MOVFF	POSTDEC1, TABLAT												\
		MOVFF	POSTDEC1, FSR0H													\
		MOVFF	POSTDEC1, FSR0L													\
		MOVFF	POSTDEC1, FSR2H													\
		MOVFF	POSTDEC1, FSR2L													\

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩成人一级片| 日韩高清不卡一区二区| 精品久久久久一区| 日韩一区二区在线看| 欧美日韩国产另类不卡| 欧美老女人在线| 538在线一区二区精品国产| 欧美性淫爽ww久久久久无| 欧美私人免费视频| 欧美一区二区成人| 欧美大片顶级少妇| 久久日一线二线三线suv| 精品国产区一区| 亚洲精品一区二区三区在线观看| 欧美一级黄色录像| 欧美变态tickle挠乳网站| 欧美一级在线免费| 日韩精品中午字幕| 国产精品热久久久久夜色精品三区| 91精品久久久久久久91蜜桃| 日韩不卡手机在线v区| 亚洲动漫第一页| 亚洲午夜久久久久中文字幕久| 亚洲人成网站精品片在线观看| 亚洲天堂2016| 亚洲尤物在线视频观看| 亚洲超碰97人人做人人爱| 五月婷婷另类国产| 亚洲午夜在线视频| 看国产成人h片视频| 国产黄色精品视频| 99国产精品一区| 欧美日韩www| 久久久精品综合| 亚洲天堂精品视频| 久久国产精品99精品国产| 国产成人在线视频网站| 青青青伊人色综合久久| 捆绑调教一区二区三区| 国产精品正在播放| 欧美日韩高清一区| 久久精品在线观看| 亚洲国产日韩一级| 国产在线精品一区在线观看麻豆| 成人免费观看视频| 日韩一区二区免费电影| 国产精品二三区| 奇米影视7777精品一区二区| 成人高清视频免费观看| 欧美日韩mp4| 亚洲美女精品一区| 国产麻豆精品在线| 91麻豆精品91久久久久同性| 亚洲精品一区二区三区在线观看| 伊人色综合久久天天人手人婷| 日本中文字幕不卡| 欧美亚洲另类激情小说| 欧美精品一区二区三区一线天视频 | 久久久国产综合精品女国产盗摄| 伊人色综合久久天天人手人婷| 国产主播一区二区| 欧美高清视频不卡网| 一区二区三区中文免费| 国产乱一区二区| 亚洲精品一区二区三区蜜桃下载| 亚洲高清视频中文字幕| 色成人在线视频| 亚洲日本va午夜在线影院| 日韩国产高清影视| www.久久久久久久久| 精品久久人人做人人爽| 日本不卡一区二区三区| 91高清视频免费看| 亚洲免费资源在线播放| www.av亚洲| 中文字幕中文字幕中文字幕亚洲无线 | 久久久精品免费网站| 久久精品久久综合| 精品少妇一区二区三区日产乱码| 亚洲丰满少妇videoshd| 欧美性猛片aaaaaaa做受| 亚洲制服丝袜av| 欧美视频在线观看一区二区| 亚洲主播在线观看| 欧美日韩黄视频| 亚洲综合色噜噜狠狠| 色诱视频网站一区| 亚洲午夜久久久久久久久电影院| 日本道免费精品一区二区三区| 亚洲人成亚洲人成在线观看图片| caoporm超碰国产精品| 国产精品乱码妇女bbbb| a级精品国产片在线观看| 亚洲天堂网中文字| 欧美中文字幕一区二区三区 | 欧美色中文字幕| 视频一区在线视频| 精品国产91九色蝌蚪| 国产ts人妖一区二区| 国产精品久久久久久久久果冻传媒| av在线这里只有精品| 亚洲自拍与偷拍| 日韩视频免费观看高清在线视频| 国产一区二区三区在线观看精品| 亚洲精品国产高清久久伦理二区| 色哟哟一区二区三区| 日韩av不卡一区二区| wwww国产精品欧美| 91麻豆自制传媒国产之光| 有码一区二区三区| 精品少妇一区二区三区日产乱码| 成人精品gif动图一区| 婷婷丁香激情综合| 欧美激情一区二区三区蜜桃视频 | 蜜臀精品一区二区三区在线观看 | 日韩欧美一级在线播放| 成人激情校园春色| 免费欧美高清视频| 亚洲欧美日韩一区二区三区在线观看| 一本大道久久a久久综合婷婷| 免费一级片91| 夜夜嗨av一区二区三区四季av | 91丝袜美腿高跟国产极品老师 | 日韩激情av在线| 国产日本欧美一区二区| 成人国产精品免费观看动漫| 亚洲超碰97人人做人人爱| 精品国产乱子伦一区| 欧美系列日韩一区| 高清在线成人网| 日韩vs国产vs欧美| 亚洲人成网站精品片在线观看| 欧美电影免费观看高清完整版在线 | 日韩电影免费在线看| 亚洲精品国产视频| 欧美国产精品专区| 欧美r级电影在线观看| 91极品视觉盛宴| a美女胸又www黄视频久久| 久久99精品一区二区三区三区| 国产高清视频一区| 亚洲婷婷在线视频| 亚洲裸体xxx| 欧美一区二区三区在| 亚洲成人午夜影院| 丝袜美腿高跟呻吟高潮一区| 人人爽香蕉精品| 国产盗摄女厕一区二区三区| www.av亚洲| 欧美人伦禁忌dvd放荡欲情| 精品免费99久久| 综合久久一区二区三区| 视频一区视频二区中文字幕| 国产剧情在线观看一区二区| 97se亚洲国产综合自在线不卡| 色婷婷综合五月| 日韩视频在线一区二区| 国产精品亲子乱子伦xxxx裸| 亚洲成精国产精品女| 精品亚洲成a人| 色噜噜狠狠一区二区三区果冻| 欧美精品一级二级| 久久精品视频网| 亚洲午夜激情av| 国产精品99久久久久久久女警| 色噜噜狠狠色综合中国| xnxx国产精品| 亚洲国产中文字幕| 成人免费观看男女羞羞视频| 91精品婷婷国产综合久久| 色哟哟国产精品| 精品国产乱码久久久久久免费| 亚洲男人电影天堂| 国内精品伊人久久久久av一坑| 欧美在线影院一区二区| 国产精品三级久久久久三级| 精品中文av资源站在线观看| 欧美午夜一区二区| 亚洲日本丝袜连裤袜办公室| 麻豆国产91在线播放| 欧美日韩午夜在线视频| 亚洲美女偷拍久久| 成人伦理片在线| 国产夜色精品一区二区av| 麻豆视频观看网址久久| 欧美日韩成人一区二区| 一区二区三区欧美亚洲| 成人爱爱电影网址| 日韩美女主播在线视频一区二区三区 | 91福利在线播放| 中文字幕一区二区三区av| 奇米影视一区二区三区| 日本丰满少妇一区二区三区| 日韩精品在线看片z| 亚洲人123区| 久久国产精品99久久人人澡| 国产在线播放一区| 欧美一区二区三区电影| 亚洲欧美日韩国产综合在线| 顶级嫩模精品视频在线看|