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

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

?? port.c

?? Este é um rtos free para a familia arm7
?? C
字號:
/*
	FreeRTOS V4.0.0 - Copyright (C) 2003-2006 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.
	***************************************************************************
*/


/*-----------------------------------------------------------
 * 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一区二区三区免费野_久草精品视频
成人丝袜视频网| 色婷婷国产精品综合在线观看| 激情五月婷婷综合网| 色老汉一区二区三区| 久久久噜噜噜久久中文字幕色伊伊| 亚洲午夜激情网页| 91网站最新地址| 国产欧美日韩麻豆91| 美女视频黄久久| 欧美精品亚洲二区| 亚洲国产精品影院| av成人免费在线观看| 久久久久久久精| 黄色资源网久久资源365| 91精品国产综合久久久久久久| 亚洲男同性视频| 成人av网站在线观看| 国产日本亚洲高清| 国产经典欧美精品| 久久久亚洲国产美女国产盗摄| 久久精品99国产精品日本| 欧美久久久久久蜜桃| 亚洲一区自拍偷拍| 欧美午夜影院一区| 亚洲图片欧美色图| 色婷婷激情综合| 亚洲精品视频在线观看网站| 色又黄又爽网站www久久| 亚洲色欲色欲www| 91老司机福利 在线| 亚洲女人的天堂| 欧美日韩午夜影院| 青青草成人在线观看| 精品国产91乱码一区二区三区| 蜜臀av一区二区三区| 日韩精品中文字幕一区| 精品一区二区三区视频在线观看| 欧美变态凌虐bdsm| 国产jizzjizz一区二区| 中文字幕在线免费不卡| 91福利在线导航| 日本不卡的三区四区五区| 精品国产一区二区亚洲人成毛片 | 日韩视频免费观看高清完整版| 性欧美疯狂xxxxbbbb| 欧美一级xxx| 国产美女久久久久| 国产精品亲子乱子伦xxxx裸| 91黄色免费网站| 日本欧美一区二区| 国产女同互慰高潮91漫画| 日本乱人伦aⅴ精品| 午夜精品久久久久| 精品日韩一区二区| 9久草视频在线视频精品| 亚洲国产欧美日韩另类综合 | 在线观看日韩高清av| 五月天精品一区二区三区| 26uuu成人网一区二区三区| www.欧美日韩| 婷婷成人激情在线网| 国产亚洲欧美在线| 欧美亚洲免费在线一区| 久久91精品久久久久久秒播| 自拍偷拍亚洲综合| 欧美一级高清片| 91亚洲男人天堂| 国模大尺度一区二区三区| 亚洲精品日韩专区silk | 欧美少妇bbb| 国产一区二区三区四区五区美女| 亚洲欧美色图小说| 欧美成人一区二区| 在线国产电影不卡| 国产成都精品91一区二区三| 午夜欧美电影在线观看| 国产欧美一区二区精品性色 | 综合婷婷亚洲小说| 亚洲精品在线免费观看视频| 色狠狠桃花综合| 国产精品夜夜嗨| 三级久久三级久久久| 中文字幕亚洲成人| 久久综合久久综合亚洲| 欧美色爱综合网| 91麻豆国产精品久久| 国产电影精品久久禁18| 日韩激情一区二区| 亚洲国产aⅴ天堂久久| 中文成人综合网| 久久日韩粉嫩一区二区三区| 欧美精品在线视频| 欧美天堂亚洲电影院在线播放| 成+人+亚洲+综合天堂| 国产在线视视频有精品| 伦理电影国产精品| 日韩成人伦理电影在线观看| 洋洋av久久久久久久一区| 国产精品久久午夜夜伦鲁鲁| 久久久噜噜噜久久人人看 | 日韩一级二级三级| 欧美日本精品一区二区三区| 91免费在线视频观看| 91污在线观看| 色综合一区二区三区| 97se亚洲国产综合自在线| 成人不卡免费av| 99国产欧美久久久精品| 成人av在线资源网站| 99视频在线精品| 91在线你懂得| 色88888久久久久久影院野外| 91高清视频在线| 色噜噜狠狠色综合中国| 欧美在线影院一区二区| 欧美午夜一区二区三区 | 麻豆精品在线看| 蜜桃一区二区三区在线| 久久精品国产澳门| 国产精品自拍一区| 国产91精品免费| 91免费视频网| 精品婷婷伊人一区三区三| 666欧美在线视频| 日韩欧美成人一区二区| 欧美精品一区二| 国产精品丝袜在线| 亚洲精品欧美激情| 天天色综合成人网| 激情成人综合网| k8久久久一区二区三区 | 国产精品久久久久久久久快鸭 | 亚洲精品日日夜夜| 日韩精品免费视频人成| 韩国一区二区在线观看| jizzjizzjizz欧美| 欧美精品一级二级三级| 久久天堂av综合合色蜜桃网| 国产精品妹子av| 午夜精品国产更新| 国产黄色精品视频| 欧美视频在线一区| 精品av综合导航| 一区二区三区免费观看| 精品综合久久久久久8888| 成人黄色av网站在线| 在线成人av网站| 欧美极品美女视频| 天天操天天干天天综合网| 国产一区二区中文字幕| 色成年激情久久综合| 日韩女优视频免费观看| 成人免费小视频| 日本中文字幕一区二区有限公司| 成人午夜激情片| 欧美一级片在线| 亚洲免费观看高清完整版在线| 日本vs亚洲vs韩国一区三区二区 | 国产精品毛片高清在线完整版| 亚洲大片精品永久免费| 国产成人夜色高潮福利影视| 精品视频在线免费观看| 国产精品黄色在线观看| 另类人妖一区二区av| 欧美亚洲综合色| 亚洲欧美怡红院| 国产一区二区三区香蕉 | 国产一区欧美二区| 欧美区一区二区三区| 国产精品白丝在线| 国产精品一区在线观看乱码| 在线播放视频一区| 亚洲综合色婷婷| www.久久精品| 国产精品久久久久aaaa| 国产一区二区主播在线| 欧美xxxxxxxx| 美国毛片一区二区三区| 7777精品伊人久久久大香线蕉的 | 日韩欧美美女一区二区三区| 亚洲精品欧美在线| 91在线你懂得| 中文字幕在线观看不卡| 成人免费视频免费观看| 精品成人一区二区三区| 奇米精品一区二区三区在线观看 | 中文乱码免费一区二区| 国产一区二区三区国产| 日韩精品一区二区三区中文不卡| 亚洲电影一区二区| 91久久香蕉国产日韩欧美9色| 国产精品久久久久三级| 成人精品免费网站| 国产精品系列在线| 成人午夜av在线| 中文字幕一区二区在线观看| 99久久精品免费精品国产| 国产精品久久久久一区二区三区共 | 日韩一区二区在线看| 日韩av不卡一区二区|