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

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

?? port.c

?? 最新版FreeRTOS, 包擴多種開發(fā)平臺的移植
?? 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.
	***************************************************************************
*/


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



?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91丝袜美女网| 久久久三级国产网站| 欧美日韩三级视频| 欧美一区二区三区影视| 久久这里只有精品首页| 中文字幕+乱码+中文字幕一区| 精品国产网站在线观看| 国产精品国产a级| 天堂午夜影视日韩欧美一区二区| 久久99精品久久久久久国产越南 | 日韩欧美国产午夜精品| 国产欧美日韩综合精品一区二区| 亚洲欧美一区二区久久| 久久电影国产免费久久电影| 91麻豆蜜桃一区二区三区| 国产精品久久久久久久第一福利| 亚洲一区在线播放| 韩国女主播一区| 欧美在线看片a免费观看| 国产亚洲va综合人人澡精品 | 蜜桃视频第一区免费观看| 国产99久久精品| 欧美妇女性影城| 亚洲欧美在线aaa| 国内不卡的二区三区中文字幕| 日本精品视频一区二区| 国产亚洲人成网站| 欧美aaaaa成人免费观看视频| 99久久国产综合精品女不卡| 精品久久一区二区三区| 首页国产欧美久久| 欧美亚洲综合色| 国产精品久久久久久久岛一牛影视| 美女视频黄 久久| 欧美日韩免费观看一区二区三区| 国产免费观看久久| 国产一区二区中文字幕| 欧美成人精精品一区二区频| 中文字幕亚洲在| 韩国欧美一区二区| 7777精品伊人久久久大香线蕉| 日韩一区在线播放| 粉嫩绯色av一区二区在线观看| 精品裸体舞一区二区三区| 美日韩一区二区三区| 在线成人免费视频| 亚洲成av人片一区二区三区| 欧美亚洲自拍偷拍| 亚洲视频你懂的| 国v精品久久久网| 国产亚洲欧美在线| 国模套图日韩精品一区二区| 日韩欧美国产电影| 韩国一区二区在线观看| 精品国产3级a| 国产成人免费在线观看不卡| 中文一区二区完整视频在线观看| 国产福利一区二区| 中国色在线观看另类| 国内精品视频666| 国产日韩三级在线| 99re成人精品视频| 亚洲高清免费在线| 欧美sm极限捆绑bd| 国产精品自拍av| 亚洲日本成人在线观看| 色嗨嗨av一区二区三区| 婷婷国产在线综合| 久久亚洲一级片| 99久久免费国产| 亚洲国产精品久久人人爱| 色天使久久综合网天天| 五月婷婷久久丁香| www久久精品| 制服丝袜激情欧洲亚洲| 免费在线观看一区| 中文成人综合网| 在线观看av一区二区| 蜜桃一区二区三区在线| 日韩一区二区三区视频在线观看| 亚洲成av人片观看| 国产视频一区不卡| 91激情在线视频| 捆绑调教美女网站视频一区| 欧美—级在线免费片| 欧美日韩视频一区二区| 成人综合婷婷国产精品久久| 中文字幕av免费专区久久| 3d动漫精品啪啪1区2区免费| 成人午夜视频在线| 日韩影院免费视频| 欧美国产成人精品| 欧美日韩久久一区二区| 精品写真视频在线观看| 中文字幕免费不卡| 欧美一区二区三区爱爱| 色偷偷久久一区二区三区| 美女网站色91| 亚洲免费观看高清| 久久网站热最新地址| 91极品视觉盛宴| 成人国产电影网| 美女网站色91| 亚洲成人综合网站| 国产精品不卡视频| 久久综合九色欧美综合狠狠| 在线观看日韩电影| 毛片不卡一区二区| 亚洲小说欧美激情另类| 欧美极品xxx| 久久久久久综合| 欧美二区乱c少妇| 色一情一伦一子一伦一区| 国产做a爰片久久毛片| 人人爽香蕉精品| 午夜精品成人在线| 亚洲国产中文字幕| 中文字幕日韩精品一区| 欧美不卡在线视频| 日韩三级中文字幕| 欧美日韩黄视频| 欧美视频第二页| 日本高清不卡aⅴ免费网站| 国产福利一区二区三区视频在线| 蜜桃久久av一区| 免费高清视频精品| 亚洲成av人影院| 亚洲一区二区三区中文字幕| 亚洲国产高清在线观看视频| 2023国产精品| 精品福利二区三区| 久久久亚洲精品石原莉奈 | 国产精品拍天天在线| 久久夜色精品国产欧美乱极品| 欧美大尺度电影在线| 欧美精品免费视频| 日韩精品一区二区三区中文精品| 欧美日韩中字一区| 91麻豆精品国产综合久久久久久| 欧美性生交片4| 777色狠狠一区二区三区| 日本一区二区三区免费乱视频| 欧美不卡激情三级在线观看| 欧美日本乱大交xxxxx| 色婷婷久久久综合中文字幕 | 亚洲少妇中出一区| 亚洲欧洲av色图| 中文字幕不卡三区| 亚洲精品成人精品456| 亚洲精选视频免费看| 亚洲国产成人porn| 九九热在线视频观看这里只有精品| 九九九精品视频| 成人免费av网站| 国产精品午夜免费| 亚洲色欲色欲www| 久久精品99国产精品日本| 波多野结衣一区二区三区| 欧美精品视频www在线观看 | 欧美一二区视频| 亚洲丝袜美腿综合| 久久99精品国产.久久久久久| 99r国产精品| 精品国产成人系列| 午夜亚洲国产au精品一区二区| 国产成人一区在线| 日韩欧美中文一区| 亚洲风情在线资源站| 成人精品电影在线观看| 日韩女优视频免费观看| 亚洲一区在线观看免费观看电影高清 | 日日夜夜精品视频免费| 99精品国产99久久久久久白柏 | 91麻豆自制传媒国产之光| 亚洲精品一区二区三区四区高清| 亚洲国产综合91精品麻豆| 91尤物视频在线观看| 精品av综合导航| 老色鬼精品视频在线观看播放| 91麻豆123| 国产精品国产三级国产aⅴ中文| 免费视频一区二区| 欧美日韩一二区| 综合精品久久久| 成人av资源网站| 国产精品美女一区二区在线观看| 久久99精品久久久久| 日韩一级免费观看| 石原莉奈在线亚洲二区| 欧美体内she精高潮| 亚洲综合男人的天堂| 不卡一区二区三区四区| 国产免费观看久久| 成人精品视频.| 国产精品天干天干在线综合| 国产一区 二区| 国产拍欧美日韩视频二区| 国产成人自拍网| 国产女主播视频一区二区| 国产福利一区二区三区视频|