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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? portmacro.h

?? MCS-51的一個Free小型操作系統(tǒng),在KeilC中下編譯工作
?? H
字號:
/*
	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 from V3.0.0

Changes from V3.0.1
*/
#ifndef PORTMACRO_H
#define PORTMACRO_H

#if !defined(_SERIES) || _SERIES != 18
	#error "WizC supports FreeRTOS on the Microchip PIC18-series only"
#endif

#if !defined(QUICKCALL) || QUICKCALL != 1
	#error "QuickCall must be enabled (see ProjectOptions/Optimisations)"
#endif

#include <stddef.h>
#include <pic.h>

#define portCHAR		char
#define portFLOAT		float
#define portDOUBLE		portFLOAT
#define portLONG		long
#define portSHORT		short
#define portSTACK_TYPE	unsigned char
#define portBASE_TYPE	char

#if( configUSE_16_BIT_TICKS == 1 )
	typedef unsigned portSHORT portTickType;
	#define portMAX_DELAY ( portTickType )	( 0xFFFF )
#else
	typedef unsigned portLONG portTickType;
	#define portMAX_DELAY ( portTickType )	( 0xFFFFFFFF )
#endif

#define portBYTE_ALIGNMENT			1

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

/*
 * Constant used for context switch macro when we require the interrupt 
 * enable state to be forced when the interrupted task is switched back in.
 */
#define portINTERRUPTS_FORCED				(0x01)

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

/* Initial interrupt enable state for newly created tasks.  This value is
 * used when a task switches in for the first time.
 */
#define portINTERRUPTS_INITIAL_STATE		(portINTERRUPTS_FORCED)

/*
 * Macros to modify the global interrupt enable bit in INTCON.
 */
#define portDISABLE_INTERRUPTS()	\
	do								\
	{								\
		bGIE=0;						\
	} while(bGIE)	// MicroChip recommends this check!
	
#define portENABLE_INTERRUPTS()		\
	do								\
	{								\
		bGIE=1;						\
	} while(0)

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

/*
 * Critical section macros.
 */
extern unsigned portCHAR ucCriticalNesting;

#define portNO_CRITICAL_SECTION_NESTING		( ( unsigned portCHAR ) 0 )

#define portENTER_CRITICAL()										\
	do																\
	{																\
		portDISABLE_INTERRUPTS();									\
																	\
		/*															\
		 * Now interrupts are disabled ucCriticalNesting			\
		 * can be accessed directly. Increment						\
		 * ucCriticalNesting to keep a count of how					\
		 * many times portENTER_CRITICAL() has been called. 		\
		 */															\
		ucCriticalNesting++;										\
	} while(0)

#define portEXIT_CRITICAL()											\
	do																\
	{																\
		if(ucCriticalNesting > portNO_CRITICAL_SECTION_NESTING)		\
		{															\
			/*														\
			 * Decrement the nesting count as we are leaving a		\
			 * critical section.									\
			 */														\
			ucCriticalNesting--;									\
		}															\
																	\
		/*															\
		 * If the nesting level has reached zero then				\
		 * interrupts should be re-enabled.							\
		 */															\
		if( ucCriticalNesting == portNO_CRITICAL_SECTION_NESTING )	\
		{															\
			portENABLE_INTERRUPTS();								\
		}															\
	} while(0)

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

/*
 * The minimal stacksize is calculated on the first reference of
 * portMINIMAL_STACK_SIZE. Some input to this calculation is
 * compiletime determined, other input is port-defined (see port.c)
 */
extern unsigned portSHORT usPortCALCULATE_MINIMAL_STACK_SIZE( void );
extern unsigned portSHORT usCalcMinStackSize;

#define portMINIMAL_STACK_SIZE					\
	((usCalcMinStackSize == 0)					\
		? usPortCALCULATE_MINIMAL_STACK_SIZE()	\
		: usCalcMinStackSize )

/*
 * WizC uses a downgrowing stack
 */
#define portSTACK_GROWTH			( -1 )

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

/*
 * Macro's 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. TOSU and TBLPTRU
 * are only saved/restored on devices with more than 64kB (32k Words) ROM.
 * 
 * The stackpointer is helt by WizC in FSR2 and points to the first free byte.
 * WizC uses a "downgrowing" stack. There is no framepointer.
 *
 * We keep track of the interruptstatus using ucCriticalNesting. When this
 * value equals zero, interrupts have to be enabled upon exit from the
 * portRESTORE_CONTEXT macro.
 * 
 * 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
 * ucCriticalNesting with value zero. This means the interrupts will again be
 * re-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 keep the current value of ucCritialNesting so it is restored
 * with its current value. This allows a yield from within a critical section.
 *
 * The compiler uses some locations at the bottom of RAM for temporary
 * storage. The compiler may also have been instructed to optimize
 * function-parameters and local variables to global storage. The compiler
 * uses an area called LocOpt for this wizC feature.
 * The total overheadstorage has to be saved in it's entirety as part of
 * a task context. These macro's store/restore from data address 0x0000 to
 * (OVERHEADPAGE0-LOCOPTSIZE+MAXLOCOPTSIZE - 1).
 * OVERHEADPAGE0, LOCOPTSIZE and MAXLOCOPTSIZE are compiler-generated
 * assembler definitions.
 */

#define	portSAVE_CONTEXT( ucInterruptForced )						\
	do																\
	{																\
		portDISABLE_INTERRUPTS();									\
																	\
		_Pragma("asm")												\
			;														\
			; Push the relevant SFR's onto the task's stack			\
			;														\
			movff   STATUS,POSTDEC2									\
			movff	WREG,POSTDEC2									\
			movff	BSR,POSTDEC2									\
			movff	PRODH,POSTDEC2									\
			movff	PRODL,POSTDEC2									\
			movff	FSR0H,POSTDEC2									\
			movff	FSR0L,POSTDEC2									\
			movff	FSR1H,POSTDEC2									\
			movff	FSR1L,POSTDEC2									\
			movff	TABLAT,POSTDEC2									\
			if __ROMSIZE > 0x8000									\
				movff	TBLPTRU,POSTDEC2							\
			endif													\
			movff	TBLPTRH,POSTDEC2								\
			movff	TBLPTRL,POSTDEC2								\
			if __ROMSIZE > 0x8000									\
				movff	PCLATU,POSTDEC2								\
			endif													\
			movff	PCLATH,POSTDEC2									\
			;														\
			; Store the compiler-scratch-area as described above.	\
			;														\
			movlw	OVERHEADPAGE0-LOCOPTSIZE+MAXLOCOPTSIZE			\
			clrf	FSR0L,ACCESS									\
			clrf	FSR0H,ACCESS									\
		_rtos_S1:													\
			movff	POSTINC0,POSTDEC2								\
			decfsz	WREG,W,ACCESS									\
			SMARTJUMP _rtos_S1										\
			;														\
			; Save the pic call/return-stack belonging to the		\
			; current task by copying it to the task's software-	\
			; stack. We save the hardware stack pointer (which		\
			; is the number of addresses on the stack) in the		\
			; W-register first because we need it later and it		\
			; is modified in the save-loop by executing pop's.		\
			; After the loop the W-register is stored on the		\
			; stack, too.											\
			;														\
			movf	STKPTR,W,ACCESS									\
			bz		_rtos_s3										\
		_rtos_S2:													\
			if __ROMSIZE > 0x8000									\
				movff	TOSU,POSTDEC2								\
			endif													\
			movff	TOSH,POSTDEC2									\
			movff	TOSL,POSTDEC2									\
			pop														\
			tstfsz	STKPTR,ACCESS									\
			SMARTJUMP _rtos_S2										\
		_rtos_s3:													\
			movwf	POSTDEC2,ACCESS									\
			;														\
			; Next the value for ucCriticalNesting used by the		\
			; task is stored on the stack. When						\
			; (ucInterruptForced == portINTERRUPTS_FORCED), we save	\
			; it as 0 (portNO_CRITICAL_SECTION_NESTING).			\
			;														\
			if ucInterruptForced == portINTERRUPTS_FORCED			\
				clrf POSTDEC2,ACCESS								\
			else													\
				movff	ucCriticalNesting,POSTDEC2					\
			endif													\
			;														\
			; Save the new top of the software stack in the TCB.	\
			;														\
			movff	pxCurrentTCB,FSR0L								\
			movff	pxCurrentTCB+1,FSR0H							\
			movff	FSR2L,POSTINC0									\
			movff	FSR2H,POSTINC0									\
		_Pragma("asmend")											\
	} while(0)

/************************************************************/

/*
 * This is the reverse of portSAVE_CONTEXT.
 */
#define portRESTORE_CONTEXT()										\
	do																\
	{																\
		_Pragma("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	\
			; FSR2 (i.e. *( pxCurrentTCB->pxTopOfStack ) ). FSR2	\
			; is used by wizC as stackpointer.						\
			;														\
			movff	POSTINC0,FSR2L									\
			movff	POSTINC0,FSR2H									\
			;														\
			; Next, the value for ucCriticalNesting used by the		\
			; task is retrieved from the stack.						\
			;														\
			movff	PREINC2,ucCriticalNesting						\
			;														\
			; Rebuild the pic call/return-stack. The number of		\
			; return addresses is the next item on the task stack.	\
			; Save this number in PRODL. Then fetch the addresses	\
			; and store them on the hardwarestack.					\
			; The datasheets say we can't use movff here...			\
			;														\
			movff	PREINC2,PRODL	// Use PRODL as tempregister	\
			clrf	STKPTR,ACCESS									\
		_rtos_R1:													\
			push													\
			movf	PREINC2,W,ACCESS								\
			movwf	TOSL,ACCESS										\
			movf	PREINC2,W,ACCESS								\
			movwf	TOSH,ACCESS										\
			if __ROMSIZE > 0x8000									\
				movf	PREINC2,W,ACCESS							\
				movwf	TOSU,ACCESS									\
			else													\
				clrf	TOSU,ACCESS									\
			endif													\
			decfsz	PRODL,F,ACCESS									\
			SMARTJUMP _rtos_R1										\
			;														\
			; Restore the compiler's working storage area to page 0	\
			;														\
			movlw	OVERHEADPAGE0-LOCOPTSIZE+MAXLOCOPTSIZE			\
			movwf	FSR0L,ACCESS									\
			clrf	FSR0H,ACCESS									\
		_rtos_R2:													\
			decf	FSR0L,F,ACCESS									\
			movff	PREINC2,INDF0									\
			tstfsz	FSR0L,ACCESS									\
			SMARTJUMP _rtos_R2										\
			;														\
			; Restore the sfr's forming the tasks context.			\
			; We cannot yet restore bsr, w and status because		\
			; we need these	registers for a final test.				\
			;														\
			movff	PREINC2,PCLATH									\
			if __ROMSIZE > 0x8000									\
				movff	PREINC2,PCLATU								\
			else													\
				clrf	PCLATU,ACCESS								\
			endif													\
			movff	PREINC2,TBLPTRL									\
			movff	PREINC2,TBLPTRH									\
			if __ROMSIZE > 0x8000									\
				movff	PREINC2,TBLPTRU								\
			else													\
				clrf	TBLPTRU,ACCESS								\
			endif													\
			movff	PREINC2,TABLAT									\
			movff	PREINC2,FSR1L									\
			movff	PREINC2,FSR1H									\
			movff	PREINC2,FSR0L									\
			movff	PREINC2,FSR0H									\
			movff	PREINC2,PRODL									\
			movff	PREINC2,PRODH									\
			;														\
			; The return from portRESTORE_CONTEXT() depends on		\
			; the value of ucCriticalNesting. When it is zero,		\
			; interrupts need to be enabled. This is done via a		\
			; retfie instruction because we need the				\
			; interrupt-enabling and the return to the restored		\
			; task to be uninterruptable.							\
	 		; Because bsr, status and W are affected by the test	\
	 		; they are restored after the test.						\
			;														\
			movlb	ucCriticalNesting>>8							\
			tstfsz	ucCriticalNesting,BANKED						\
			SMARTJUMP _rtos_R4										\
		_rtos_R3:													\
			movff	PREINC2,BSR										\
			movff	PREINC2,WREG									\
			movff	PREINC2,STATUS									\
			retfie	0		; Return enabling interrupts			\
		_rtos_R4:													\
			movff	PREINC2,BSR										\
			movff	PREINC2,WREG									\
			movff	PREINC2,STATUS									\
			return	0		; Return without affecting interrupts	\
		_Pragma("asmend")											\
	} while(0)

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

#define portTICK_RATE_MS	( ( portTickType ) 1000 / configTICK_RATE_HZ )		

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

extern void vPortYield( void );
#define portYIELD()				vPortYield()

#define portNOP()	_Pragma("asm")									\
						nop											\
					_Pragma("asmend")

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

#define portTASK_FUNCTION( xFunction, pvParameters )	 	\
	void pointed xFunction( void *pvParameters )		\
	_Pragma(asmfunc xFunction)

#define portTASK_FUNCTION_PROTO		portTASK_FUNCTION
/*-----------------------------------------------------------*/

#define inline
#define volatile
#define register

#endif /* PORTMACRO_H */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品盗摄一区二区三区| 91视频一区二区三区| 欧美精品三级日韩久久| 香蕉成人啪国产精品视频综合网| 欧美亚洲一区二区在线| 五月婷婷欧美视频| 日韩精品一区二区三区视频 | 中文字幕日韩精品一区| 国产精品香蕉一区二区三区| 国产精品无圣光一区二区| 99久久国产综合精品麻豆| 亚洲一级片在线观看| 91精品免费观看| 国产麻豆精品在线| 最好看的中文字幕久久| 欧美日韩亚洲综合一区二区三区| 91网站最新地址| 亚洲国产综合视频在线观看| 日韩亚洲欧美高清| 粉嫩嫩av羞羞动漫久久久 | 在线免费观看一区| 国产999精品久久久久久绿帽| 国产欧美一区二区精品忘忧草| av中文字幕一区| 天天av天天翘天天综合网色鬼国产| 日韩欧美中文字幕公布| 国产成人午夜视频| 亚洲一区二区三区四区的| 日韩一区二区视频| 成人免费毛片片v| 亚洲高清免费一级二级三级| 精品国产乱码久久久久久1区2区| av影院午夜一区| 免费久久99精品国产| 国产精品久久久久一区 | 日本欧美一区二区三区| 中文字幕第一区综合| 日韩欧美国产一区二区三区 | 国内精品久久久久影院薰衣草 | 国产精品免费av| 欧美美女视频在线观看| 顶级嫩模精品视频在线看| 日韩电影在线一区二区三区| 中文字幕一区二区三区不卡在线| 91精品国产日韩91久久久久久| 成人黄色国产精品网站大全在线免费观看| 亚洲一区二区三区免费视频| 国产日产欧产精品推荐色| 欧美精选在线播放| 色综合中文字幕| 亚洲婷婷综合色高清在线| 欧美成人午夜电影| 欧美综合一区二区三区| 粉嫩aⅴ一区二区三区四区| 捆绑调教一区二区三区| 亚洲永久免费视频| 国产精品免费丝袜| 久久久久久久久久久99999| 欧美日韩激情一区二区| 色综合天天综合在线视频| 国产精品66部| 紧缚捆绑精品一区二区| 日本成人在线网站| 爽好久久久欧美精品| 亚洲国产一区二区在线播放| 国产精品污污网站在线观看| 久久综合网色—综合色88| 欧美一区二区日韩一区二区| 欧美群妇大交群中文字幕| 欧美伊人精品成人久久综合97| 91在线观看成人| 99久久久国产精品| 成人国产精品免费网站| yourporn久久国产精品| 国产+成+人+亚洲欧洲自线| 国产一区二区不卡| 国产精品一区在线观看你懂的| 麻豆成人综合网| 久久不见久久见免费视频1| 九九视频精品免费| 国产乱子轮精品视频| 国产制服丝袜一区| 国产一区视频导航| 国产成人av福利| 成人激情视频网站| 一本色道久久综合狠狠躁的推荐 | 亚洲午夜电影网| 亚洲一区av在线| 丝袜亚洲另类欧美| 免费成人在线视频观看| 精品一区二区av| 国产一区二区福利| 波波电影院一区二区三区| www.成人网.com| 欧洲生活片亚洲生活在线观看| 欧美性受xxxx黑人xyx性爽| 精品视频在线免费| 日韩欧美国产电影| 国产精品污网站| 亚洲高清视频在线| 另类调教123区| 粗大黑人巨茎大战欧美成人| 一本久久精品一区二区| 欧美日韩国产影片| 精品久久久久久久人人人人传媒| 欧美国产一区二区在线观看| 亚洲精选视频在线| 日韩二区三区四区| 丰满少妇在线播放bd日韩电影| 91原创在线视频| 日韩亚洲欧美一区| 国产精品福利av | 久久97超碰国产精品超碰| 国产一区二区三区免费观看| 91在线国产福利| 日韩欧美综合在线| 国产精品久久777777| 成人一级视频在线观看| 在线观看一区日韩| 精品免费视频一区二区| 自拍偷拍国产精品| 日本网站在线观看一区二区三区| 成人午夜视频免费看| 欧美久久久影院| 欧美激情资源网| 香港成人在线视频| 成人av免费在线播放| 欧美丰满美乳xxx高潮www| 国产精品美女久久久久aⅴ| 婷婷久久综合九色综合绿巨人| 国产suv精品一区二区883| 欧美精品在线一区二区三区| 国产精品久久久久久久午夜片 | 久国产精品韩国三级视频| 成人黄色综合网站| 精品国产乱码久久久久久夜甘婷婷 | 成人高清伦理免费影院在线观看| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 久久精品欧美日韩精品| 亚洲成人午夜影院| 91在线播放网址| 国产午夜亚洲精品羞羞网站| 蜜桃精品视频在线| 欧美性受xxxx黑人xyx性爽| 国产精品传媒入口麻豆| 国产精品夜夜嗨| 欧美大片在线观看一区| 亚洲va天堂va国产va久| 一本在线高清不卡dvd| 国产精品美女久久久久久久久 | 日韩一区欧美小说| 国产成人免费xxxxxxxx| 精品久久国产97色综合| 日韩av不卡一区二区| 欧美丝袜丝交足nylons图片| 中文字幕一区二区三区不卡在线| 国产精品一级二级三级| 日韩美女在线视频| 另类人妖一区二区av| 欧美一区二区在线观看| 视频在线在亚洲| 欧美日韩午夜在线| 亚洲v精品v日韩v欧美v专区| 欧美三级日韩三级| 亚洲国产精品久久久久秋霞影院 | 五月婷婷综合在线| 欧美日本国产视频| 日韩不卡一区二区三区| 欧美一激情一区二区三区| 日本欧美一区二区在线观看| 91精品欧美一区二区三区综合在| 日韩影院精彩在线| 日韩精品最新网址| 韩国理伦片一区二区三区在线播放| 日韩亚洲欧美成人一区| 久久er99热精品一区二区| 精品对白一区国产伦| 丁香网亚洲国际| 国产精品麻豆久久久| 91老司机福利 在线| 一区二区三区资源| 精品视频1区2区| 免费人成黄页网站在线一区二区| 日韩亚洲欧美高清| 国产精品99久久久久久宅男| 欧美—级在线免费片| 94-欧美-setu| 亚洲第一成人在线| 精品久久久久久久一区二区蜜臀| 国产精品一卡二卡| 成人欧美一区二区三区| 欧美日韩国产精品成人| 麻豆精品国产91久久久久久| 国产欧美日韩在线| 色综合久久久网| 日韩av成人高清| 久久久91精品国产一区二区精品 | 国产一区二区三区美女| 亚洲色欲色欲www在线观看| 欧美调教femdomvk|