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

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

?? port.c

?? 開源ZigBee 協議棧
?? C
字號:
/*
	FreeRTOS V3.2.0 - Copyright (C) 2003 - 2005 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 Atmel AT91R40008
 * 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.
 *----------------------------------------------------------*/

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

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

/* Hardware specific definitions. */
#include "AT91R40008.h"
#include "pio.h"
#include "aic.h"
#include "tc.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 )
#define portTICK_PRIORITY_6				( 6 )
/*-----------------------------------------------------------*/

/* 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 tick timer to generate the tick interrupts at the required frequency.
 */
static void prvSetupTimerInterrupt( void )
{
volatile unsigned portLONG ulDummy;

	/* Enable clock to the tick timer... */
	AT91C_BASE_PS->PS_PCER = portTIMER_CLK_ENABLE_BIT;

	/* Stop the tick timer... */
	portTIMER_REG_BASE_PTR->TC_CCR = TC_CLKDIS;

	/* Start with tick timer interrupts disabled... */
	portTIMER_REG_BASE_PTR->TC_IDR = 0xFFFFFFFF;

	/* Clear any pending tick timer interrupts... */
	ulDummy = portTIMER_REG_BASE_PTR->TC_SR;

	/* Store interrupt handler function address in tick timer vector register...
	The ISR installed depends on whether the preemptive or cooperative
	scheduler is being used. */
	#if configUSE_PREEMPTION == 1
	{
		extern void ( vPreemptiveTick )( void );
		AT91C_BASE_AIC->AIC_SVR[portTIMER_AIC_CHANNEL] = ( unsigned portLONG ) vPreemptiveTick;
	}
	#else  // else use cooperative scheduler
	{
		extern void ( vNonPreemptiveTick )( void );
		AT91C_BASE_AIC->AIC_SVR[portTIMER_AIC_CHANNEL] = ( unsigned portLONG ) vNonPreemptiveTick;
	}
	#endif

	/* Tick timer interrupt level-sensitive, priority 6... */
	AT91C_BASE_AIC->AIC_SMR[ portTIMER_AIC_CHANNEL ] = AIC_SRCTYPE_INT_LEVEL_SENSITIVE | portTICK_PRIORITY_6;

	/* Enable the tick timer interrupt...

	First at timer level */
	portTIMER_REG_BASE_PTR->TC_IER = TC_CPCS;

	/* Then at the AIC level. */
	AT91C_BASE_AIC->AIC_IECR = (1 << portTIMER_AIC_CHANNEL);

	/* Calculate timer compare value to achieve the desired tick rate... */
	if( (configCPU_CLOCK_HZ / (configTICK_RATE_HZ * 2) ) <= 0xFFFF )
	{
		/* The tick rate is fast enough for us to use the faster timer input
		clock (main clock / 2). */
		portTIMER_REG_BASE_PTR->TC_CMR = TC_WAVE | TC_CLKS_MCK2 | TC_BURST_NONE | TC_CPCTRG;
		portTIMER_REG_BASE_PTR->TC_RC  = configCPU_CLOCK_HZ / (configTICK_RATE_HZ * 2);
	}
	else
	{
		/* We must use a slower timer input clock (main clock / 8) because the
		tick rate is too slow for the faster input clock. */
		portTIMER_REG_BASE_PTR->TC_CMR = TC_WAVE | TC_CLKS_MCK8 | TC_BURST_NONE | TC_CPCTRG;
		portTIMER_REG_BASE_PTR->TC_RC  = configCPU_CLOCK_HZ / (configTICK_RATE_HZ * 8);
	}

	/* Start tick timer... */
	portTIMER_REG_BASE_PTR->TC_CCR = TC_SWTRG | TC_CLKEN;
}
/*-----------------------------------------------------------*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产一区二区视频| 国产欧美综合色| 国产精品国产三级国产普通话三级| 全部av―极品视觉盛宴亚洲| 欧美午夜精品久久久久久孕妇| 洋洋av久久久久久久一区| 色婷婷久久久亚洲一区二区三区| 国内精品国产三级国产a久久 | 一区二区三区日韩精品视频| 亚洲成人一二三| 欧美日韩黄视频| 99久久精品免费看| 精品国产精品网麻豆系列 | 中文字幕日韩精品一区| 白白色 亚洲乱淫| 国产日韩欧美一区二区三区综合| 国产精品一卡二| 中国色在线观看另类| 白白色 亚洲乱淫| 亚洲精品久久久蜜桃| 欧美久久久久久蜜桃| 另类小说色综合网站| 中文字幕av免费专区久久| 成人av资源站| 婷婷开心激情综合| 久久九九久精品国产免费直播| 不卡一区中文字幕| 午夜精品福利视频网站 | 精品国产一区二区亚洲人成毛片| 国产成人精品免费| 洋洋av久久久久久久一区| 日韩精品一区二| eeuss鲁一区二区三区| 五月婷婷久久丁香| 欧美极品少妇xxxxⅹ高跟鞋| 欧美日韩视频专区在线播放| 国产经典欧美精品| 亚洲大型综合色站| 国产午夜亚洲精品理论片色戒| 在线看不卡av| 国产精品888| 视频一区在线播放| 中文字幕中文字幕一区二区| 91精品国产乱| 色综合天天做天天爱| 国产精品主播直播| 丝袜美腿亚洲综合| 亚洲精品日日夜夜| 国产亚洲成aⅴ人片在线观看| 欧美疯狂做受xxxx富婆| 成人app下载| 国产一区二区剧情av在线| 亚洲国产一区视频| 亚洲精品成人悠悠色影视| 欧美国产欧美综合| 久久精品在线观看| 日韩你懂的在线观看| 欧美丝袜第三区| 91蜜桃视频在线| 丁香婷婷综合激情五月色| 激情综合色综合久久| 五月婷婷色综合| 午夜亚洲国产au精品一区二区| 综合自拍亚洲综合图不卡区| 亚洲国产高清aⅴ视频| 亚洲精品一区二区精华| 欧美一区二区三区影视| 欧美日韩在线播放一区| 日本二三区不卡| 成人av电影在线网| 成人精品视频一区二区三区| 国产毛片精品国产一区二区三区| 日韩va亚洲va欧美va久久| 亚洲精品日产精品乱码不卡| 中文字幕精品三区| 91美女在线观看| 色综合久久天天综合网| 成人免费电影视频| 国产伦理精品不卡| 麻豆中文一区二区| 视频一区在线播放| 亚洲国产aⅴ天堂久久| 国产精品系列在线| 久久久精品国产免大香伊| 日韩亚洲欧美一区二区三区| 一本到三区不卡视频| 97久久精品人人澡人人爽| 激情综合色综合久久综合| 人人精品人人爱| 天天综合日日夜夜精品| 国产调教视频一区| 精品国产乱码久久久久久图片| 欧美日韩国产综合久久| 欧美午夜精品久久久久久孕妇| 91麻豆视频网站| 99国产精品国产精品毛片| av欧美精品.com| 波多野结衣中文字幕一区二区三区| 国产福利一区二区三区视频 | 久久综合久久99| 欧美大片一区二区| 精品国产免费久久| 欧美成人a在线| 久久久久久一级片| 国产欧美1区2区3区| 欧美极品美女视频| 中文字幕欧美一| 一区二区三区不卡视频在线观看| 亚洲另类在线视频| 亚洲精品ww久久久久久p站| 亚洲不卡av一区二区三区| 热久久免费视频| 国产一区日韩二区欧美三区| 成人av第一页| 欧美日韩一区高清| 日韩欧美一区在线| 久久一夜天堂av一区二区三区| 中文字幕一区二区三中文字幕| 亚洲免费三区一区二区| 亚洲v日本v欧美v久久精品| 久久99日本精品| 成人av在线播放网址| 欧美三级日韩三级| 亚洲精品一区二区三区精华液 | 97se亚洲国产综合自在线不卡 | 欧美成人国产一区二区| 精品三级在线观看| 国产精品色哟哟| 亚洲一区二区三区四区在线观看| 日本亚洲最大的色成网站www| 激情综合一区二区三区| 94-欧美-setu| 欧美一区二区三区电影| 国产精品入口麻豆九色| 亚洲激情男女视频| 精品在线观看免费| 91美女视频网站| 9191国产精品| 亚洲特级片在线| 免费久久99精品国产| 91丝袜美腿高跟国产极品老师 | 久久精品久久精品| 色综合夜色一区| 精品女同一区二区| 亚洲精品一二三区| 国产精品456| 91精品国产综合久久婷婷香蕉| 亚洲精品在线电影| 亚洲成在人线在线播放| 丰满亚洲少妇av| 91精品国产美女浴室洗澡无遮挡| 国产精品国产a级| 麻豆国产精品视频| 欧美三级午夜理伦三级中视频| 中文字幕日韩一区| 精品中文字幕一区二区小辣椒| 91在线视频18| 欧美一区日本一区韩国一区| 亚洲国产精品精华液ab| 性久久久久久久| 91麻豆精品在线观看| 久久久久久久久久久久电影| 亚洲成av人在线观看| 99久久婷婷国产综合精品| 亚洲国产精品av| 国内精品第一页| 欧美一区二区三区在线视频| 一级精品视频在线观看宜春院| 高清成人免费视频| 精品久久久久久久久久久院品网| 亚洲高清三级视频| 色综合中文综合网| 日韩黄色小视频| jlzzjlzz亚洲日本少妇| 国产欧美一区二区精品婷婷| 精品一区二区三区免费观看| 欧美精品乱码久久久久久| 一区二区高清免费观看影视大全 | 欧美刺激午夜性久久久久久久| 亚洲一区精品在线| 在线免费精品视频| 亚洲码国产岛国毛片在线| 成人福利在线看| 中文字幕巨乱亚洲| 成人午夜视频福利| 国产精品素人视频| 成人黄色网址在线观看| 国产精品久久一级| 精品视频全国免费看| 亚洲a一区二区| 欧美系列亚洲系列| 亚洲二区在线观看| 欧美三级电影网站| 亚洲黄色性网站| 69精品人人人人| 免费观看日韩电影| 国产亚洲欧美中文| 成人在线一区二区三区| 中文字幕一区二区在线播放| www.欧美日韩国产在线|