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

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

?? port.c

?? FreeRtos Source code Version 4.04
?? C
字號(hào):
/*
	FreeRTOS.org V4.0.4 - 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();
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
3751色影院一区二区三区| 中文字幕一区二区三区四区不卡| 国产婷婷色一区二区三区| 亚洲啪啪综合av一区二区三区| 日本va欧美va精品| 一本在线高清不卡dvd| 国产三级一区二区三区| 一区av在线播放| 国产电影一区在线| 欧美一级二级三级蜜桃| 一区二区三区在线不卡| 国产 日韩 欧美大片| 欧美一区二区三区四区五区| 一区二区三区中文字幕精品精品| 国产精品资源网| 精品国产免费人成电影在线观看四季| 亚洲自拍都市欧美小说| 97久久超碰精品国产| 欧美韩日一区二区三区四区| 韩国av一区二区三区| 欧美一区二区三区在线观看| 亚洲成人免费视频| 在线观看日韩国产| 亚洲另类春色校园小说| 成人av在线一区二区三区| 久久精品人人做| 激情六月婷婷综合| 精品国产精品网麻豆系列 | 久久国产精品一区二区| 欧美日韩成人在线一区| 亚洲国产日韩精品| 欧美日韩精品免费观看视频| 亚洲一区二区欧美日韩| 欧美亚洲愉拍一区二区| 亚洲影院理伦片| 在线观看亚洲一区| 亚洲成人资源网| 7777精品伊人久久久大香线蕉的| 亚洲123区在线观看| 欧美二区三区的天堂| 蜜桃视频免费观看一区| 精品久久国产字幕高潮| 国内精品伊人久久久久av影院| 久久亚洲精品小早川怜子| 国产美女一区二区三区| 国产欧美一区视频| 99国产欧美久久久精品| 亚洲国产一区二区三区青草影视| 99re免费视频精品全部| 一区二区三区在线免费播放| 欧美精品亚洲二区| 美女一区二区三区| 欧美激情综合五月色丁香| 91亚洲国产成人精品一区二区三| 亚洲美女视频在线| 91麻豆精品国产91久久久久久 | 国产精品国产精品国产专区不蜜| 94-欧美-setu| 日韩成人dvd| 日本一区二区免费在线| 在线日韩av片| 精品一二三四在线| 国产精品对白交换视频| 欧美男生操女生| 国产不卡在线播放| 午夜影院久久久| 亚洲国产精品成人综合 | 欧美乱妇15p| 国产伦精品一区二区三区免费迷| 日韩一区欧美小说| 91精品久久久久久久久99蜜臂| 国产·精品毛片| 亚洲成国产人片在线观看| 久久伊人中文字幕| 欧美伊人久久大香线蕉综合69| 精品一区二区成人精品| 亚洲柠檬福利资源导航| 欧美变态口味重另类| 91麻豆国产福利精品| 精品一区二区三区欧美| 一区二区三区产品免费精品久久75| 日韩视频在线一区二区| 97精品电影院| 国产精品2024| 日韩精品免费专区| 一区二区三区在线视频观看 | 麻豆精品一区二区三区| 亚洲人吸女人奶水| 中文字幕中文乱码欧美一区二区 | 亚洲香肠在线观看| 中文久久乱码一区二区| 欧美一级夜夜爽| 欧美在线免费视屏| 不卡一区在线观看| 国产在线国偷精品产拍免费yy| 亚洲综合免费观看高清完整版| 久久久天堂av| 精品人在线二区三区| 欧美日本不卡视频| 欧洲日韩一区二区三区| av网站免费线看精品| 国产传媒一区在线| 精品亚洲国产成人av制服丝袜| 亚洲va在线va天堂| 亚洲线精品一区二区三区| 18成人在线观看| 国产精品拍天天在线| 久久久www成人免费毛片麻豆| 日韩亚洲电影在线| 91麻豆精品久久久久蜜臀| 欧美日韩一区二区三区在线看| 91小视频在线免费看| 色综合一个色综合| 色综合天天性综合| 色哟哟精品一区| 91国模大尺度私拍在线视频| 97久久久精品综合88久久| 成人国产精品视频| 成人国产一区二区三区精品| 成人18视频在线播放| www.在线欧美| 色婷婷综合久久久久中文| 91黄色激情网站| 欧美性受xxxx| 91精品一区二区三区久久久久久 | 色综合久久六月婷婷中文字幕| 99精品欧美一区二区蜜桃免费| 99re这里都是精品| 91久久精品午夜一区二区| 欧美在线一二三四区| 欧美日韩精品一区二区天天拍小说| 欧美做爰猛烈大尺度电影无法无天| 在线观看视频一区| 欧美一区二区三区影视| 欧美精品一区二区三区视频| 中文字幕av一区二区三区| 日韩一区日韩二区| 亚洲高清视频的网址| 日本不卡的三区四区五区| 狠狠色综合色综合网络| aaa亚洲精品| 欧美日韩一级片网站| 精品国产一区二区三区忘忧草| 日本一区二区三区电影| 亚洲成在人线在线播放| 九九热在线视频观看这里只有精品| 国产成人99久久亚洲综合精品| 99精品视频一区二区| 欧美一级日韩免费不卡| 欧美国产综合一区二区| 亚洲福利国产精品| 国产精品资源网| 欧美私模裸体表演在线观看| 久久蜜桃av一区精品变态类天堂| 中文字幕永久在线不卡| 日本成人在线电影网| av电影在线观看一区| 在线不卡中文字幕播放| 中文在线免费一区三区高中清不卡| 亚洲五码中文字幕| 粉嫩蜜臀av国产精品网站| 精品视频全国免费看| 国产午夜亚洲精品不卡| 婷婷综合在线观看| 99国产一区二区三精品乱码| 日韩欧美中文一区二区| 亚洲黄色片在线观看| 国产一区二区91| 777xxx欧美| 亚洲欧美视频在线观看视频| 蜜桃在线一区二区三区| 欧美主播一区二区三区| 国产欧美一区二区精品久导航 | 亚洲国产精品二十页| 日韩av高清在线观看| 色欧美片视频在线观看在线视频| 久久婷婷成人综合色| 视频一区二区不卡| 一本大道久久a久久综合婷婷| 久久久国际精品| 麻豆91精品91久久久的内涵| 欧美日韩一区二区欧美激情| 1区2区3区欧美| 国产成人精品免费一区二区| 精品少妇一区二区三区在线播放| 亚洲国产精品人人做人人爽| 色视频成人在线观看免| 中文字幕日本乱码精品影院| 久久激五月天综合精品| 欧美精品高清视频| 亚洲一区二区三区四区中文字幕| eeuss鲁一区二区三区| 国产亚洲一区二区在线观看| 激情成人综合网| 精品国精品国产尤物美女| 久久99精品久久久久久国产越南 | 亚洲综合免费观看高清完整版在线| 成人网在线免费视频| 国产日韩欧美综合一区| 国产成人午夜视频|