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

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

?? port.c

?? 最新版FreeRTOS, 包擴多種開發平臺的移植
?? C
字號:
/*
	FreeRTOS.org V4.1.1 - 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.2.1
	+ CallReturn Depth increased from 8 to 10 levels to accomodate wizC/fedC V12.
	
Changes from V3.2.0
	+ TBLPTRU is now initialised to zero during the initial stack creation of a new task. This solves
	an error on devices with more than 64kB ROM.

Changes from V3.0.0
	+ ucCriticalNesting is now initialised to 0x7F to prevent interrupts from being
          handled before the scheduler is started.

Changes from V3.0.1
*/

/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>

#include <malloc.h>

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

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

/*
 * Define minimal-stack constants
 * -----
 * FSR's:
 *		STATUS, WREG, BSR, PRODH, PRODL, FSR0H, FSR0L,
 *		FSR1H, FSR1L,TABLAT, (TBLPTRU), TBLPTRH, TBLPTRL,
 *		(PCLATU), PCLATH
 *		sfr's within parenthesis only on devices > 64kB
 * -----
 * Call/Return stack:
 *		 2 bytes per entry on devices <= 64kB
 *		 3 bytes per entry on devices >  64kB
 * -----
 * Other bytes:
 *		 2 bytes: FunctionParameter for initial taskcode
 *		 1 byte : Number of entries on call/return stack
 *		 1 byte : ucCriticalNesting
 *		16 bytes: Free space on stack
 */
#if _ROMSIZE > 0x8000
	#define portSTACK_FSR_BYTES				( 15 )
	#define portSTACK_CALLRETURN_ENTRY_SIZE	(  3 )
#else
	#define portSTACK_FSR_BYTES				( 13 )
	#define portSTACK_CALLRETURN_ENTRY_SIZE	(  2 )
#endif

#define portSTACK_MINIMAL_CALLRETURN_DEPTH	( 10 )
#define portSTACK_OTHER_BYTES				( 20 )

unsigned portSHORT usCalcMinStackSize		= 0;

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

/*
 * We initialise ucCriticalNesting to the middle value an 
 * unsigned char can contain. This way portENTER_CRITICAL()
 * and portEXIT_CRITICAL() can be called without interrupts
 * being enabled before the scheduler starts.
 */
register unsigned portCHAR ucCriticalNesting = 0x7F;

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

/* 
 * Initialise the stack of a new task.
 * See portSAVE_CONTEXT macro for description. 
 */
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
unsigned portCHAR ucScratch;
	/*
	 * Get the size of the RAMarea in page 0 used by the compiler
	 * We do this here already to avoid W-register conflicts.
	 */
	_Pragma("asm")
		movlw	OVERHEADPAGE0-LOCOPTSIZE+MAXLOCOPTSIZE
		movwf	PRODL,ACCESS		; PRODL is used as temp register
	_Pragma("asmend")
	ucScratch = PRODL;

	/*
	 * Place a few bytes of known values on the bottom of the stack. 
	 * This is just useful for debugging.
	 */
//	*pxTopOfStack--	= 0x11;
//	*pxTopOfStack-- = 0x22;
//	*pxTopOfStack-- = 0x33;

	/*
	 * Simulate how the stack would look after a call to vPortYield()
	 * generated by the compiler.
	 */

	/*
	 * First store the function parameters.  This is where the task expects
	 * to find them when it starts running.
	 */
	*pxTopOfStack-- = ( portSTACK_TYPE ) ( (( unsigned portSHORT ) pvParameters >> 8) & 0x00ff );
	*pxTopOfStack-- = ( portSTACK_TYPE ) (  ( unsigned portSHORT ) pvParameters       & 0x00ff );

	/*
	 * Next are all the registers that form part of the task context.
	 */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0x11; /* STATUS. */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0x22; /* WREG. */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0x33; /* BSR. */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0x44; /* PRODH. */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0x55; /* PRODL. */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0x66; /* FSR0H. */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0x77; /* FSR0L. */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0x88; /* FSR1H. */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0x99; /* FSR1L. */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0xAA; /* TABLAT. */
#if _ROMSIZE > 0x8000
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0x00; /* TBLPTRU. */
#endif
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0xCC; /* TBLPTRH. */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0xDD; /* TBLPTRL. */
#if _ROMSIZE > 0x8000
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0xEE; /* PCLATU. */
#endif
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0xFF; /* PCLATH. */

	/*
	 * Next the compiler's scratchspace.
	 */
	while(ucScratch-- > 0)
	{
		*pxTopOfStack-- = ( portSTACK_TYPE ) 0;
	}
	
	/*
	 * The only function return address so far is the address of the task entry.
	 * The order is TOSU/TOSH/TOSL. For devices > 64kB, TOSU is put on the 
	 * stack, too. TOSU is always written as zero here because wizC does not allow
	 * functionpointers to point above 64kB in ROM.
	 */
#if _ROMSIZE > 0x8000
	*pxTopOfStack-- = ( portSTACK_TYPE ) 0;
#endif
	*pxTopOfStack-- = ( portSTACK_TYPE ) ( ( ( unsigned portSHORT ) pxCode >> 8 ) & 0x00ff );
	*pxTopOfStack-- = ( portSTACK_TYPE ) ( (   unsigned portSHORT ) pxCode        & 0x00ff );

	/*
	 * Store the number of return addresses on the hardware stack.
	 * So far only the address of the task entry point.
	 */
	*pxTopOfStack-- = ( portSTACK_TYPE ) 1;

	/*
	 * The code generated by wizC does not maintain separate
	 * stack and frame pointers. Therefore the portENTER_CRITICAL macro cannot 
	 * use the stack as per other ports.  Instead a variable is used to keep
	 * track of the critical section nesting.  This variable has to be stored
	 * as part of the task context and is initially set to zero.
	 */
	*pxTopOfStack-- = ( portSTACK_TYPE ) portNO_CRITICAL_SECTION_NESTING;	

	return pxTopOfStack;
}
/*-----------------------------------------------------------*/

unsigned portSHORT usPortCALCULATE_MINIMAL_STACK_SIZE( void )
{
	/*
	 * Fetch the size of compiler's scratchspace.
	 */
	_Pragma("asm")
		movlw	OVERHEADPAGE0-LOCOPTSIZE+MAXLOCOPTSIZE
		movlb	usCalcMinStackSize>>8
		movwf	usCalcMinStackSize,BANKED
	_Pragma("asmend")

	/*
	 * Add minimum needed stackspace
	 */
	usCalcMinStackSize	+=	( portSTACK_FSR_BYTES )
		+	( portSTACK_MINIMAL_CALLRETURN_DEPTH * portSTACK_CALLRETURN_ENTRY_SIZE )
		+	( portSTACK_OTHER_BYTES );

	return(usCalcMinStackSize);
}

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

portBASE_TYPE xPortStartScheduler( void )
{
	extern void portSetupTick( void );

	/*
	 * Setup a timer for the tick ISR for the preemptive scheduler.
	 */
	portSetupTick(); 

	/*
	 * Restore the context of the first task to run.
	 */
	portRESTORE_CONTEXT();

	/*
	 * This point should never be reached during execution.
	 */
	return pdTRUE;
}

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

void vPortEndScheduler( void )
{
	/*
	 * It is unlikely that the scheduler for the PIC port will get stopped
	 * once running. When called a reset is done which is probably the
	 * most valid action.
	 */
	_Pragma(asmline reset);
}

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

/*
 * Manual context switch.  This is similar to the tick context switch,
 * but does not increment the tick count.  It must be identical to the
 * tick context switch in how it stores the stack of a task.
 */
void vPortYield( void )
{
	/*
	 * Save the context of the current task.
	 */
	portSAVE_CONTEXT( portINTERRUPTS_UNCHANGED );

	/*
	 * Switch to the highest priority task that is ready to run.
	 */
	vTaskSwitchContext();

	/*
	 * Start executing the task we have just switched to.
	 */
	portRESTORE_CONTEXT();
}

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

void *pvPortMalloc( unsigned portSHORT usWantedSize )
{
void *pvReturn;

	vTaskSuspendAll();
	{
		pvReturn = malloc( ( malloc_t ) usWantedSize );
	}
	xTaskResumeAll();

	return pvReturn;
}

void vPortFree( void *pv )
{
	if( pv )
	{
		vTaskSuspendAll();
		{
			free( pv );
		}
		xTaskResumeAll();
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av中文字幕一区二区 | 精品一区二区三区免费| 国产一区二区按摩在线观看| 91香蕉视频mp4| 久久久久久久久一| 午夜久久久久久电影| 99在线热播精品免费| 日韩免费观看高清完整版 | 国产一区二区三区蝌蚪| 欧美亚州韩日在线看免费版国语版| 精品福利在线导航| 日韩激情视频在线观看| 91国产视频在线观看| 国产精品看片你懂得| 国产一区二区剧情av在线| 欧美美女一区二区在线观看| 国产精品天干天干在观线| 精品一区二区三区在线观看国产| 欧美日韩色综合| 亚洲午夜私人影院| 欧美日韩一区视频| 一区二区欧美精品| 99re热这里只有精品视频| 自拍偷拍欧美激情| 不卡大黄网站免费看| 国产精品毛片大码女人| 国产成人在线视频网址| 久久精品免费在线观看| 国产乱码一区二区三区| 国产偷国产偷精品高清尤物| 国产精品自在在线| 欧美极品aⅴ影院| 国产不卡视频在线观看| 欧美国产欧美亚州国产日韩mv天天看完整| 久99久精品视频免费观看| 欧美成人猛片aaaaaaa| 久久精品99久久久| 亚洲精品在线观| 粉嫩欧美一区二区三区高清影视 | 欧美精品久久久久久久多人混战| 亚洲成a人片在线观看中文| 欧美日韩成人激情| 免费成人性网站| 久久久精品国产免费观看同学| 国产传媒久久文化传媒| 国产精品高潮呻吟| 欧美日韩在线一区二区| 毛片av中文字幕一区二区| 久久人人97超碰com| 成人精品一区二区三区中文字幕| 成人免费在线播放视频| 欧美在线一二三| 日韩精品乱码av一区二区| 日韩欧美中文一区二区| 成人午夜视频在线观看| 亚洲综合精品久久| 日韩精品一区国产麻豆| 国产精品亚洲一区二区三区妖精| 国产精品福利电影一区二区三区四区| 一本久久a久久精品亚洲| 亚洲一区二三区| 日韩免费看的电影| 色综合久久久久综合体| 喷水一区二区三区| 国产精品久99| 日韩精品中文字幕在线不卡尤物| 国产福利精品一区二区| 亚洲国产视频一区二区| 久久理论电影网| 日韩欧美亚洲一区二区| 国产成人综合亚洲91猫咪| 一区二区三区中文字幕精品精品 | 欧美中文一区二区三区| 麻豆成人免费电影| 亚洲欧美中日韩| 欧美一区二区三区男人的天堂| 福利电影一区二区三区| 亚洲国产一区二区视频| 欧美—级在线免费片| 欧美人妇做爰xxxⅹ性高电影| 国产乱子伦视频一区二区三区| 亚洲摸摸操操av| 精品福利在线导航| 欧美日韩一区二区欧美激情| 国产成人综合网| 麻豆一区二区三| 亚洲aⅴ怡春院| 亚洲美女屁股眼交3| 久久影院午夜论| 欧美日韩大陆一区二区| 色999日韩国产欧美一区二区| 国产一区二区三区观看| 午夜不卡在线视频| 亚洲精品日产精品乱码不卡| 欧美国产国产综合| 久久久天堂av| 欧美精品一区二区在线播放| 日韩亚洲欧美一区二区三区| 一本大道综合伊人精品热热| 成人免费毛片片v| 国产成人自拍网| 国产精品自拍三区| 激情小说亚洲一区| 久久国产麻豆精品| 青娱乐精品视频在线| 亚洲 欧美综合在线网络| 亚洲精品国产成人久久av盗摄| 国产精品美女一区二区在线观看| 久久久久久久久久美女| 久久久一区二区| 久久精品一级爱片| 久久婷婷色综合| 久久久久国产精品厨房| 久久久99精品免费观看| 久久久久久久精| 中文字幕高清不卡| 国产三级一区二区| 中文字幕制服丝袜一区二区三区| 中文字幕视频一区二区三区久| 中文字幕免费一区| 综合久久久久久| 亚洲女厕所小便bbb| 亚洲丝袜精品丝袜在线| 一区二区高清在线| 午夜a成v人精品| 久久66热偷产精品| 成人在线视频首页| 91在线观看免费视频| 色婷婷综合久久久久中文一区二区 | 综合久久国产九一剧情麻豆| 国产精品的网站| 亚洲自拍欧美精品| 日本vs亚洲vs韩国一区三区二区| 蜜桃视频在线观看一区二区| 国产在线精品一区二区三区不卡| 国产福利一区二区三区| 99精品在线免费| 欧美人妇做爰xxxⅹ性高电影| 欧美岛国在线观看| 国产精品区一区二区三区| 亚洲最新在线观看| 美女一区二区三区在线观看| 成人亚洲精品久久久久软件| 在线免费观看一区| 精品久久久久久综合日本欧美 | 亚洲一区欧美一区| 蜜桃一区二区三区在线| 波多野结衣精品在线| 欧美欧美欧美欧美首页| 久久精品一区二区三区不卡牛牛| 亚洲日穴在线视频| 美女爽到高潮91| 91在线视频网址| 精品成人一区二区三区| 最好看的中文字幕久久| 蜜桃精品视频在线观看| 91网站黄www| 精品国产sm最大网站免费看 | 国产精品无码永久免费888| 亚洲最新视频在线观看| 国产伦精品一区二区三区视频青涩| 99久久久久免费精品国产| 制服.丝袜.亚洲.另类.中文| 日本一区二区电影| 石原莉奈在线亚洲二区| 92国产精品观看| 国产午夜精品美女毛片视频| 无吗不卡中文字幕| 成人动漫一区二区三区| 欧美tickle裸体挠脚心vk| 一区二区三区在线影院| 国产99精品国产| 欧美电影免费观看高清完整版| 亚洲一区二区高清| 91亚洲资源网| 中文欧美字幕免费| 国产综合色视频| 欧美一区二区在线免费观看| 亚洲综合区在线| 99久久精品国产网站| 国产欧美精品一区| 国产精品资源在线看| 精品国产电影一区二区 | 亚洲国产精品一区二区久久 | 精品久久五月天| 麻豆精品一区二区综合av| 欧美日韩精品一区二区三区| 一区二区三区在线观看网站| 成人av资源网站| 国产精品成人在线观看| 国产福利电影一区二区三区| 久久日一线二线三线suv| 久久精品免费观看| 欧美一区二区三区男人的天堂| 日韩国产高清在线| 欧美一三区三区四区免费在线看 | 色妹子一区二区| 亚洲乱码中文字幕综合| 91久久精品一区二区三| 亚洲愉拍自拍另类高清精品|