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

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

?? port.c

?? FreeRTOS is a portable, open source, mini Real Time Kernel - a free to download and royalty free RTO
?? C
字號:
/*
	FreeRTOS.org V5.2.0 - Copyright (C) 2003-2009 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 (version 2) as published
	by the Free Software Foundation and modified by the FreeRTOS exception.

	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 is included to allow you 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.


	***************************************************************************
	*                                                                         *
	* Get the FreeRTOS eBook!  See http://www.FreeRTOS.org/Documentation      *
	*                                                                         *
	* This is a concise, step by step, 'hands on' guide that describes both   *
	* general multitasking concepts and FreeRTOS specifics. It presents and   *
	* explains numerous examples that are written using the FreeRTOS API.     *
	* Full source code for all the examples is provided in an accompanying    *
	* .zip file.                                                              *
	*                                                                         *
	***************************************************************************

	1 tab == 4 spaces!

	Please ensure to read the configuration and relevant port sections of the
	online documentation.

	http://www.FreeRTOS.org - Documentation, latest information, license and
	contact details.

	http://www.SafeRTOS.com - A version that is certified for use in safety
	critical systems.

	http://www.OpenRTOS.com - Commercial support, development, porting,
	licensing and training services.
*/

/*
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一区二区三区免费野_久草精品视频
五月婷婷另类国产| 国产精品一二三区在线| 在线免费不卡电影| 亚洲裸体在线观看| 91片黄在线观看| 一个色在线综合| 欧美日韩亚洲另类| 麻豆精品久久久| 久久精品欧美日韩精品| 成人免费电影视频| 亚洲综合色区另类av| 51午夜精品国产| 国产中文字幕一区| 国产精品不卡一区二区三区| 91丨porny丨国产| 午夜视频一区在线观看| 欧美成va人片在线观看| 成人免费的视频| 亚洲国产乱码最新视频| 精品福利在线导航| 99精品热视频| 欧美aaaaa成人免费观看视频| 精品免费一区二区三区| av电影在线观看一区| 亚洲一区二区在线观看视频| 日韩一区二区视频| 成人深夜福利app| 亚洲二区视频在线| 国产日韩av一区| 欧美亚男人的天堂| 国产成人福利片| 亚洲h动漫在线| 欧美激情艳妇裸体舞| 欧美精品在线观看播放| 国产成人av电影在线观看| 亚洲综合一区二区精品导航| 精品少妇一区二区三区日产乱码 | 亚洲国产一区二区a毛片| 日韩一级免费一区| 99精品视频在线观看| 久久精品国产亚洲高清剧情介绍| 亚洲色图在线看| 精品国产3级a| 7777精品伊人久久久大香线蕉经典版下载 | 欧美日韩高清不卡| 不卡av电影在线播放| 精品中文字幕一区二区小辣椒 | 亚洲成人动漫一区| 欧美激情一区二区三区不卡 | 中文无字幕一区二区三区| 91精品国产aⅴ一区二区| 97超碰欧美中文字幕| 国产精品自拍三区| 日韩福利视频网| 亚洲精品日韩专区silk| 欧美极品xxx| 精品电影一区二区三区| 欧美一区二区三区的| 欧美视频在线不卡| 99精品视频中文字幕| 成人高清视频在线| 国产成人亚洲综合色影视| 蜜臀av性久久久久蜜臀aⅴ| 亚洲成av人在线观看| 一区二区三区四区在线| 亚洲人成网站精品片在线观看| 国产亚洲欧美激情| 久久精品一区二区三区不卡 | 在线成人免费观看| 欧美视频完全免费看| 一本一本大道香蕉久在线精品| 不卡大黄网站免费看| aaa国产一区| 成人91在线观看| 99视频一区二区| 成人成人成人在线视频| 成人爽a毛片一区二区免费| 成人在线综合网站| 成人激情黄色小说| 白白色 亚洲乱淫| 99久久精品国产一区二区三区 | 欧美三日本三级三级在线播放| 91同城在线观看| 一本大道久久a久久综合| 色综合天天综合网国产成人综合天| 99re6这里只有精品视频在线观看| 成人aaaa免费全部观看| 99精品视频一区二区| 欧美在线三级电影| 欧美精品乱码久久久久久| 日韩三级.com| 国产亚洲综合色| 中文字幕一区二区不卡| 一区二区三区在线观看欧美| 日韩福利视频网| 国内外精品视频| 高清国产午夜精品久久久久久| 成人av资源下载| 欧洲激情一区二区| 日韩色视频在线观看| 国产视频一区二区在线观看| 中文字幕在线观看不卡| 亚洲va欧美va人人爽午夜| 蜜臀av性久久久久蜜臀aⅴ流畅 | 在线日韩一区二区| 91精选在线观看| 国产日产亚洲精品系列| 国产精品亚洲一区二区三区在线| 亚洲精品你懂的| 国产精品亚洲人在线观看| 色综合久久综合| 国产中文字幕一区| 91免费在线播放| 欧美嫩在线观看| 久久久久久久久久久99999| 亚洲天堂a在线| 秋霞午夜鲁丝一区二区老狼| 国产成人av一区二区三区在线 | 亚洲欧美福利一区二区| 婷婷综合久久一区二区三区| 国产精品一区二区久久不卡| 一本一道久久a久久精品综合蜜臀| 91麻豆精品国产| 亚洲欧美区自拍先锋| 国内外成人在线| 欧美午夜精品久久久久久孕妇| 久久影视一区二区| 五月激情综合婷婷| a级精品国产片在线观看| 日韩女优视频免费观看| 亚洲精品国久久99热| 国产美女一区二区三区| 欧美理论电影在线| 中文字幕中文字幕一区| 韩国中文字幕2020精品| 欧美三级电影精品| 日韩一区在线看| 国产精选一区二区三区| 91精品国产黑色紧身裤美女| 一区二区三区在线播| 成人动漫一区二区在线| 久久久久久久久久久久久女国产乱| 亚洲成av人片一区二区三区| av一区二区三区在线| 久久先锋影音av| 日本不卡的三区四区五区| 91福利在线播放| 亚洲欧美另类久久久精品| 粉嫩嫩av羞羞动漫久久久| 日韩欧美一区在线观看| 天涯成人国产亚洲精品一区av| 色综合天天综合狠狠| 国产精品久久久久久户外露出| 国产一区不卡在线| 亚洲精品在线观| 久久99精品视频| 日韩免费观看2025年上映的电影 | 国产精品18久久久久久vr| 欧美一区二区视频网站| 午夜精品久久一牛影视| 欧美在线高清视频| 一区二区三区欧美在线观看| 91麻豆文化传媒在线观看| 成人欧美一区二区三区白人| 成人动漫在线一区| 日韩毛片在线免费观看| 一本大道综合伊人精品热热| 一区二区免费在线播放| 在线观看免费一区| 亚洲成a人v欧美综合天堂下载| 欧美日韩大陆一区二区| 日韩和的一区二区| 6080亚洲精品一区二区| 蜜乳av一区二区| 精品美女一区二区三区| 国产精品一区久久久久| 国产三级精品三级| 99久久精品国产毛片| 亚洲欧美激情插| 欧美日韩免费观看一区二区三区 | 亚洲丝袜制服诱惑| 在线视频亚洲一区| 亚洲一二三四在线观看| 欧美一三区三区四区免费在线看| 日本不卡一区二区三区| 欧美不卡一二三| 成人av资源在线| 激情欧美一区二区| 日本一二三四高清不卡| 99视频一区二区三区| 亚洲bt欧美bt精品| 欧美不卡一区二区三区| 91亚洲大成网污www| 亚洲第一在线综合网站| 欧美大胆一级视频| 不卡电影一区二区三区| 亚洲电影一区二区三区| 精品国精品自拍自在线| 99精品视频免费在线观看| 日韩精品久久理论片|