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

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

?? port.c

?? 開源的好的freertos操作系統(tǒng)
?? C
字號(hào):
/*
	FreeRTOS V3.2.4 - 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.
	***************************************************************************
*/

/* 
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	(  8 )
#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();
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av在线发布| 午夜av一区二区三区| 欧美在线观看你懂的| 国产精品一区二区果冻传媒| 日本中文字幕一区二区有限公司| 亚洲国产精品激情在线观看| 久久久不卡影院| 成人欧美一区二区三区黑人麻豆| 国产精品毛片久久久久久久| 国产日产欧美精品一区二区三区| 精品国产3级a| 亚洲视频一区二区在线| 亚洲va国产天堂va久久en| 日本亚洲欧美天堂免费| 国产乱人伦精品一区二区在线观看| 国产精品一区专区| 一本一道综合狠狠老| 日韩西西人体444www| 国产精品久久久一本精品| 亚洲精品视频一区| 国产综合久久久久久鬼色 | 麻豆精品国产91久久久久久| 日本系列欧美系列| 99久久99久久免费精品蜜臀| 日韩美女视频一区二区在线观看| 一区二区久久久久| 日产精品久久久久久久性色| 欧美亚洲综合另类| 日韩欧美成人一区| 亚洲国产视频一区| 91免费看片在线观看| 精品少妇一区二区三区日产乱码 | 精品一区二区三区久久| 成人av综合一区| 久久久噜噜噜久久人人看| 日本一区中文字幕| 欧美日韩高清影院| 免费观看在线色综合| 欧美精品亚洲一区二区在线播放| 亚洲免费视频中文字幕| 色综合久久久网| 亚洲1区2区3区视频| 日日欢夜夜爽一区| 婷婷久久综合九色综合绿巨人| 91国内精品野花午夜精品| 久久精品人人做人人爽人人| 中文字幕一区二区三区四区| 成人影视亚洲图片在线| 久久久www成人免费无遮挡大片| 国产麻豆成人传媒免费观看| 久久精品一区二区三区四区| 国产成人亚洲综合a∨猫咪| 国产精品蜜臀在线观看| 欧亚洲嫩模精品一区三区| 亚洲va在线va天堂| 中文字幕乱码一区二区免费| 在线观看视频欧美| 成人教育av在线| 久久久噜噜噜久噜久久综合| 秋霞电影一区二区| 国产女主播一区| 91精品国产综合久久久久久久久久 | 亚洲尤物视频在线| 中文字幕精品三区| 欧美一区二区美女| 欧美三区在线视频| 欧美艳星brazzers| 亚洲天堂久久久久久久| 欧美一区二区三区人| 99国产精品久久久久久久久久| 视频一区二区三区入口| 亚洲精品国产精华液| 国产精品久久久久影院老司| 欧美xxxxx牲另类人与| 色香色香欲天天天影视综合网| 9l国产精品久久久久麻豆| 日韩国产高清在线| 韩国一区二区三区| 成人精品国产福利| 大白屁股一区二区视频| 欧美精品国产精品| 欧美日韩在线播| 制服.丝袜.亚洲.另类.中文| 日韩一区二区三区视频在线 | 成人福利视频网站| 成人黄页在线观看| 欧美视频你懂的| 日韩一区二区麻豆国产| 精品国产免费人成电影在线观看四季 | 日本不卡的三区四区五区| 久久国产剧场电影| 日本成人中文字幕在线视频| 亚洲另类在线制服丝袜| 婷婷开心激情综合| 波多野结衣一区二区三区| 在线日韩av片| 国产视频911| 免费的国产精品| 91麻豆免费视频| 久久夜色精品一区| 日韩精品91亚洲二区在线观看| 成人av午夜电影| 风间由美一区二区三区在线观看 | 日韩一区二区电影| 欧美国产精品专区| 国产一区二区三区在线观看精品 | 久久理论电影网| 午夜不卡av免费| 欧美日韩小视频| 亚洲色图一区二区三区| 岛国精品在线观看| 精品国产91乱码一区二区三区 | 欧美无人高清视频在线观看| 国产日韩欧美精品一区| 精品在线观看视频| 国产精品国产馆在线真实露脸| 天堂午夜影视日韩欧美一区二区| 色国产综合视频| 亚洲国产精品一区二区久久恐怖片 | 亚洲欧洲在线观看av| 成人伦理片在线| 亚洲一区国产视频| 欧美日韩一卡二卡三卡| 人人精品人人爱| 国产免费成人在线视频| 99精品一区二区三区| 丝袜a∨在线一区二区三区不卡| 欧美人牲a欧美精品| 国产精一区二区三区| 国产欧美日韩不卡免费| 欧美少妇一区二区| 国产成人av电影免费在线观看| 亚洲视频在线一区二区| 欧美日韩不卡在线| 91麻豆免费视频| 黄网站免费久久| 日韩中文字幕91| 亚洲视频电影在线| 久久亚洲精精品中文字幕早川悠里| 豆国产96在线|亚洲| 午夜电影一区二区| 亚洲尤物视频在线| 国产日韩欧美综合在线| 欧美日韩免费在线视频| 99r精品视频| 91麻豆免费在线观看| 成人网男人的天堂| 99在线精品一区二区三区| 国产乱人伦精品一区二区在线观看| 美女视频网站黄色亚洲| 精品久久人人做人人爱| 欧美人伦禁忌dvd放荡欲情| 国产成人av一区二区三区在线| 老色鬼精品视频在线观看播放| 一区二区激情小说| 麻豆高清免费国产一区| 婷婷一区二区三区| 另类欧美日韩国产在线| 国内外成人在线| 国产iv一区二区三区| 国产麻豆9l精品三级站| 成人h动漫精品一区二区| 国产91精品一区二区麻豆亚洲| 国产精品资源网| 99久久综合国产精品| 欧美日韩高清影院| 日韩色在线观看| 国产欧美精品一区| 亚洲在线视频一区| 国产乱子伦一区二区三区国色天香 | 亚洲电影视频在线| 青青草成人在线观看| 99视频精品免费视频| 91精品国产综合久久福利| 中文字幕av一区二区三区高| 香蕉影视欧美成人| 91麻豆文化传媒在线观看| 国产成人av电影在线观看| 粉嫩av一区二区三区| 日韩免费在线观看| 亚洲激情一二三区| av电影在线观看一区| 欧美精品一区二区三区蜜桃 | 秋霞午夜av一区二区三区| 在线区一区二视频| 亚洲欧美日韩在线| 成熟亚洲日本毛茸茸凸凹| 精品黑人一区二区三区久久| 亚洲精品中文在线观看| 成人avav影音| 中文字幕免费不卡在线| 国产高清成人在线| 国产色综合久久| 成人黄动漫网站免费app| 久久久99精品免费观看| 成人午夜av影视| 国产精品欧美综合在线| 91小视频免费观看| 天天综合色天天综合色h| 欧美放荡的少妇|