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

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

?? port.c

?? FreeRTOS V4.2.1,增加了AVR32 UC3 和 LPC2368 的支持
?? C
字號:
/*
	FreeRTOS.org V4.2.1 - Copyright (C) 2003-2007 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.

	Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
	with commercial development and support options.
	***************************************************************************
*/


/*-----------------------------------------------------------
 * Implementation of functions defined in portable.h for the ARM7 port.
 *
 * Components that can be compiled to either ARM or THUMB mode are
 * contained in this file.  The ISR routines, which can only be compiled
 * to ARM mode are contained in portISR.c.
 *----------------------------------------------------------*/

/*
	Changes from V2.5.2
		
	+ ulCriticalNesting is now saved as part of the task context, as is 
	  therefore added to the initial task stack during pxPortInitialiseStack.

	Changes from V3.2.2

	+ Bug fix - The prescale value for the timer setup is now written to T0_PR 
	  instead of T0_PC.  This bug would have had no effect unless a prescale 
	  value was actually used.
*/


/* Standard includes. */
#include <stdlib.h>

/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"

/* Constants required to setup the task context. */
#define portINITIAL_SPSR				( ( portSTACK_TYPE ) 0x1f ) /* System mode, ARM mode, interrupts enabled. */
#define portTHUMB_MODE_BIT				( ( portSTACK_TYPE ) 0x20 )
#define portINSTRUCTION_SIZE			( ( portSTACK_TYPE ) 4 )
#define portNO_CRITICAL_SECTION_NESTING	( ( portSTACK_TYPE ) 0 )

/* Constants required to setup the tick ISR. */
#define portENABLE_TIMER			( ( unsigned portCHAR ) 0x01 )
#define portPRESCALE_VALUE			0x00
#define portINTERRUPT_ON_MATCH		( ( unsigned portLONG ) 0x01 )
#define portRESET_COUNT_ON_MATCH	( ( unsigned portLONG ) 0x02 )

/* Constants required to setup the VIC for the tick ISR. */
#define portTIMER_VIC_CHANNEL		( ( unsigned portLONG ) 0x0004 )
#define portTIMER_VIC_CHANNEL_BIT	( ( unsigned portLONG ) 0x0010 )
#define portTIMER_VIC_ENABLE		( ( unsigned portLONG ) 0x0020 )

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

/* Setup the timer to generate the tick interrupts. */
static void prvSetupTimerInterrupt( void );

/* 
 * The scheduler can only be started from ARM mode, so 
 * vPortISRStartFirstSTask() is defined in portISR.c. 
 */
extern void vPortISRStartFirstTask( void );

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

/* 
 * Initialise the stack of a task to look exactly as if a call to 
 * portSAVE_CONTEXT had been called.
 *
 * See header file for description. 
 */
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
portSTACK_TYPE *pxOriginalTOS;

	pxOriginalTOS = pxTopOfStack;

	/* Setup the initial stack of the task.  The stack is set exactly as 
	expected by the portRESTORE_CONTEXT() macro. */

	/* First on the stack is the return address - which in this case is the
	start of the task.  The offset is added to make the return address appear
	as it would within an IRQ ISR. */
	*pxTopOfStack = ( portSTACK_TYPE ) pxCode + portINSTRUCTION_SIZE;		
	pxTopOfStack--;

	*pxTopOfStack = ( portSTACK_TYPE ) 0xaaaaaaaa;	/* R14 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) pxOriginalTOS; /* Stack used when task starts goes in R13. */
	pxTopOfStack--;
	*pxTopOfStack = ( portSTACK_TYPE ) 0x12121212;	/* R12 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x11111111;	/* R11 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x10101010;	/* R10 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x09090909;	/* R9 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x08080808;	/* R8 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x07070707;	/* R7 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x06060606;	/* R6 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x05050505;	/* R5 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x04040404;	/* R4 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x03030303;	/* R3 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x02020202;	/* R2 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x01010101;	/* R1 */
	pxTopOfStack--;	

	/* When the task starts is will expect to find the function parameter in
	R0. */
	*pxTopOfStack = ( portSTACK_TYPE ) pvParameters; /* R0 */
	pxTopOfStack--;

	/* The last thing onto the stack is the status register, which is set for
	system mode, with interrupts enabled. */
	*pxTopOfStack = ( portSTACK_TYPE ) portINITIAL_SPSR;

	#ifdef THUMB_INTERWORK
	{
		/* We want the task to start in thumb mode. */
		*pxTopOfStack |= portTHUMB_MODE_BIT;
	}
	#endif

	pxTopOfStack--;

	/* Some optimisation levels use the stack differently to others.  This 
	means the interrupt flags cannot always be stored on the stack and will
	instead be stored in a variable, which is then saved as part of the
	tasks context. */
	*pxTopOfStack = portNO_CRITICAL_SECTION_NESTING;

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

portBASE_TYPE xPortStartScheduler( void )
{
	/* Start the timer that generates the tick ISR.  Interrupts are disabled
	here already. */
	prvSetupTimerInterrupt();

	/* Start the first task. */
	vPortISRStartFirstTask();	

	/* Should not get here! */
	return 0;
}
/*-----------------------------------------------------------*/

void vPortEndScheduler( void )
{
	/* It is unlikely that the ARM port will require this function as there
	is nothing to return to.  */
}
/*-----------------------------------------------------------*/

/*
 * Setup the timer 0 to generate the tick interrupts at the required frequency.
 */
static void prvSetupTimerInterrupt( void )
{
unsigned portLONG ulCompareMatch;

	/* A 1ms tick does not require the use of the timer prescale.  This is
	defaulted to zero but can be used if necessary. */
	T0_PR = portPRESCALE_VALUE;

	/* Calculate the match value required for our wanted tick rate. */
	ulCompareMatch = configCPU_CLOCK_HZ / configTICK_RATE_HZ;

	/* Protect against divide by zero.  Using an if() statement still results
	in a warning - hence the #if. */
	#if portPRESCALE_VALUE != 0
	{
		ulCompareMatch /= ( portPRESCALE_VALUE + 1 );
	}
	#endif
	T0_MR0 = ulCompareMatch;

	/* Generate tick with timer 0 compare match. */
	T0_MCR = portRESET_COUNT_ON_MATCH | portINTERRUPT_ON_MATCH;

	/* Setup the VIC for the timer. */
	VICIntSelect &= ~( portTIMER_VIC_CHANNEL_BIT );
	VICIntEnable |= portTIMER_VIC_CHANNEL_BIT;
	
	/* The ISR installed depends on whether the preemptive or cooperative
	scheduler is being used. */
	#if configUSE_PREEMPTION == 1
	{
		extern void ( vPreemptiveTick )( void );
		VICVectAddr0 = ( portLONG ) vPreemptiveTick;
	}
	#else
	{
		extern void ( vNonPreemptiveTick )( void );
		VICVectAddr0 = ( portLONG ) vNonPreemptiveTick;
	}
	#endif

	VICVectCntl0 = portTIMER_VIC_CHANNEL | portTIMER_VIC_ENABLE;

	/* Start the timer - interrupts are disabled when this function is called
	so it is okay to do this here. */
	T0_TCR = portENABLE_TIMER;
}
/*-----------------------------------------------------------*/



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜激情一区二区三区| 国产欧美一区二区三区鸳鸯浴| 国产麻豆成人传媒免费观看| 亚洲第一福利一区| 亚洲另类在线一区| 中文字幕亚洲视频| 欧美激情艳妇裸体舞| 国产精品色婷婷| 欧美高清在线精品一区| 国产亚洲短视频| 国产欧美精品一区aⅴ影院 | 51精品国自产在线| 51精品国自产在线| 中文字幕欧美日本乱码一线二线| 日韩精品一区二区三区在线| 日韩三级视频在线观看| 精品久久久久99| 国产日韩精品一区二区三区在线| 亚洲精品一区二区三区在线观看| 精品国产乱码久久久久久牛牛| 日韩免费看的电影| 久久久不卡影院| 国产精品激情偷乱一区二区∴| 《视频一区视频二区| 一区二区高清在线| 日本大胆欧美人术艺术动态| 久久精品国产精品亚洲精品| 国产福利一区在线| 在线视频一区二区三区| 欧美一级理论片| 精品sm捆绑视频| 最新国产成人在线观看| 午夜欧美2019年伦理 | 777午夜精品免费视频| 日韩网站在线看片你懂的| 久久久久久97三级| 一区二区免费在线| 老司机精品视频在线| 成人精品免费视频| 欧美日韩大陆在线| 国产精品美女www爽爽爽| 亚洲第四色夜色| 国产一区二区调教| 欧美日韩一级二级| 中文字幕第一区综合| 偷偷要91色婷婷| 国产91精品一区二区| 91精品在线观看入口| 中文字幕字幕中文在线中不卡视频| 丝袜a∨在线一区二区三区不卡| 国产精品99久久不卡二区| 欧美午夜片在线观看| 欧美激情在线看| 麻豆精品在线播放| 日本道精品一区二区三区| 国产欧美一区在线| 日韩精品福利网| 色哟哟亚洲精品| 国产天堂亚洲国产碰碰| 日本成人在线网站| 欧美日韩在线三区| 亚洲三级理论片| 国产精品一区二区三区四区| 欧美精品在线一区二区| 亚洲精品欧美激情| 不卡av在线网| 国产欧美视频一区二区| 日本v片在线高清不卡在线观看| 色婷婷综合久久久久中文 | 丁香网亚洲国际| 欧美白人最猛性xxxxx69交| 亚洲福中文字幕伊人影院| 99精品视频在线免费观看| 欧美国产禁国产网站cc| 激情综合网最新| 日韩一区二区精品葵司在线| 亚洲一区二区三区美女| 色综合一区二区三区| 成人免费在线观看入口| 成人精品免费网站| 中文字幕中文字幕一区二区 | 国产亚洲欧美日韩日本| 久久se这里有精品| 精品国产免费久久 | 精品人伦一区二区色婷婷| 肉色丝袜一区二区| 欧美精品777| 亚洲风情在线资源站| 欧美性猛片xxxx免费看久爱| 亚洲福利视频一区二区| 欧美精选一区二区| 麻豆国产精品官网| 久久精品亚洲乱码伦伦中文 | 精品无人区卡一卡二卡三乱码免费卡| 欧美一卡2卡3卡4卡| 精品一区二区综合| 久久久不卡影院| 99久久伊人久久99| 香蕉av福利精品导航| 91精品国产综合久久精品| 麻豆精品在线播放| 国产精品国产精品国产专区不片| 成人免费av网站| 亚洲愉拍自拍另类高清精品| 欧美日韩大陆一区二区| 久久精品国产精品青草| 国产精品情趣视频| 色欧美片视频在线观看在线视频| 亚洲国产精品视频| 欧美va天堂va视频va在线| 成人影视亚洲图片在线| 亚洲美女一区二区三区| 欧美一区二区三区电影| 国产精品1区2区| 一区二区激情小说| 久久蜜桃香蕉精品一区二区三区| 波多野结衣中文一区| 免费的国产精品| 亚洲色图欧美激情| 日韩欧美一区二区在线视频| 国产九色精品成人porny | 一区二区三区电影在线播| 91精品国产色综合久久久蜜香臀| 国产精品影视网| 亚洲成人7777| 国产精品色一区二区三区| 91精品国产黑色紧身裤美女| 不卡一区在线观看| 麻豆精品一区二区综合av| 亚洲免费观看高清完整版在线观看熊| 日韩一级在线观看| 欧美自拍偷拍午夜视频| 高清国产一区二区| 免费观看成人av| 亚洲电影在线播放| 亚洲人精品一区| 日本一区二区视频在线| 日韩欧美激情在线| 欧美乱妇一区二区三区不卡视频| 成人综合在线观看| 狠狠久久亚洲欧美| 视频在线观看一区二区三区| 亚洲美女区一区| 国产精品热久久久久夜色精品三区| 日韩一区二区精品葵司在线 | 一区二区三区资源| 一区免费观看视频| 国产日韩精品视频一区| 日韩一区二区视频| 欧美精品第1页| 欧美日韩黄色影视| 欧美日韩在线播放三区四区| 99久久综合国产精品| 99久久久国产精品免费蜜臀| 国产成人在线看| 国产一区二区三区四区在线观看| 三级不卡在线观看| 日韩精品每日更新| 免费一级片91| 蜜臀av性久久久久蜜臀aⅴ| 日本亚洲三级在线| 免费看日韩精品| 精品在线观看免费| 国产一区二区三区黄视频| 国产在线播放一区| 国产伦精品一区二区三区视频青涩| 久久精品国产第一区二区三区| 日本不卡免费在线视频| 久久精品国产成人一区二区三区| 免费的成人av| 国产福利一区二区| 91麻豆国产自产在线观看| 91麻豆免费看| 678五月天丁香亚洲综合网| 日韩精品一区国产麻豆| 国产蜜臀97一区二区三区| 1024精品合集| 午夜成人免费电影| 精油按摩中文字幕久久| 福利电影一区二区三区| 日本精品一区二区三区四区的功能| 色噜噜狠狠成人中文综合| 在线观看视频91| 日韩欧美国产三级| 国产欧美精品一区二区三区四区 | 99r国产精品| 欧美人狂配大交3d怪物一区| 日韩欧美电影一区| 亚洲国产经典视频| 亚洲国产精品麻豆| 国产精品中文字幕日韩精品 | 欧美中文字幕一区二区三区| 欧美电影影音先锋| 国产网红主播福利一区二区| 亚洲欧洲中文日韩久久av乱码| 午夜av一区二区| 国产传媒久久文化传媒| 欧美区视频在线观看| 国产精品久久久久天堂| 香蕉影视欧美成人|