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

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

?? port.c

?? freertosV4.40 是一種small的嵌入式系統(tǒng)。利于嵌入式開好者入門學(xué)習(xí)嵌入式操作系統(tǒng)。通過對(duì)于源碼的學(xué)習(xí)可以很好的掌握freertos的運(yùn)行機(jī)制。
?? C
字號(hào):
/*
	FreeRTOS.org V4.4.0 - 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
 * using the Keil compiler.
 *
 * 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 V3.2.2

	+ Bug fix - The prescale value for the timer setup is now written to T0PR 
	  instead of T0PC.  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 initial 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 );

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

/* 
 * See header file for description. 
 */
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
portSTACK_TYPE *pxOriginalTOS;

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

	Remember where the top of the (simulated) stack is before we place 
	anything on it. */
	pxOriginalTOS = pxTopOfStack;

	/* 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--;	
	*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 KEIL_THUMB_INTERWORK
	{		
		/* We want the task to start in thumb mode. */
		*pxTopOfStack |= portTHUMB_MODE_BIT;
	}
	#endif

	pxTopOfStack--;

	/* The code generated by the Keil compiler does not maintain separate
	stack and frame pointers. The portENTER_CRITICAL macro cannot therefore
	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 = portNO_CRITICAL_SECTION_NESTING;

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

portBASE_TYPE xPortStartScheduler( void )
{
	/* Start the timer that generates the tick ISR. */
	prvSetupTimerInterrupt();

	/* Start the first task.  This is done from portISR.c as ARM mode must be
	used. */
	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.  If this is required - stop the tick ISR then
	return back to main. */
}
/*-----------------------------------------------------------*/

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. */
	T0PR = 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

	T0MR0 = ulCompareMatch;

	/* Generate tick with timer 0 compare match. */
	T0MCR = 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
	{	
		#ifdef KEIL_THUMB_INTERWORK
			extern void ( vPreemptiveTick )( void ) __arm __task;
		#else
			extern void ( vPreemptiveTick )( void ) __task;
		#endif

		VICVectAddr0 = ( unsigned portLONG ) vPreemptiveTick;
	}
	#else
	{
		extern void ( vNonPreemptiveTick )( void ) __irq;

		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. */
	T0TCR = portENABLE_TIMER;
}
/*-----------------------------------------------------------*/



?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩欧美一区二区三区高清影视 | 亚洲国产精品精华液2区45| 国产精品夜夜爽| 亚洲国产综合91精品麻豆| 久久久精品一品道一区| 欧美美女一区二区在线观看| 成人av在线播放网站| 蜜臀久久久99精品久久久久久| 亚洲男人天堂av网| 国产日韩欧美精品在线| 7777精品伊人久久久大香线蕉最新版| 成人av在线看| 激情文学综合网| 日本欧美一区二区| 亚洲一二三级电影| 亚洲欧美日韩精品久久久久| 欧美精品一区二区三| 欧美精品九九99久久| 99久久综合国产精品| 国产精品一区二区久激情瑜伽| 日韩av不卡一区二区| 亚洲一区在线电影| 亚洲精品欧美激情| 国产精品乱码一区二三区小蝌蚪| 日韩欧美一级二级| 91精品国产福利| 欧美日韩在线三级| 色偷偷久久人人79超碰人人澡| 风间由美性色一区二区三区| 国产福利一区二区三区视频在线| 美女视频第一区二区三区免费观看网站 | 一区二区三区美女视频| 国产精品久久久久久亚洲伦| 国产清纯白嫩初高生在线观看91| 26uuu精品一区二区在线观看| 日韩女优制服丝袜电影| 日韩视频123| 91精品国产综合久久精品 | 欧美一区二区日韩一区二区| 欧美高清一级片在线| 欧美肥妇bbw| 欧美一区永久视频免费观看| 337p亚洲精品色噜噜噜| 这里只有精品电影| 欧美一二三区在线| 亚洲精品在线三区| 国产亚洲成aⅴ人片在线观看| 国产亚洲欧美日韩日本| 国产欧美日韩视频一区二区| 国产亚洲精品免费| 国产精品毛片无遮挡高清| 国产精品成人网| 亚洲精品自拍动漫在线| 亚洲精品日韩综合观看成人91| 亚洲第一激情av| 免费视频最近日韩| 国产一区欧美日韩| 99久久精品一区| 欧美日韩国产首页| 日韩精品专区在线影院观看| 久久久www免费人成精品| 中文字幕一区二区在线观看| 亚洲综合色网站| 免费日韩伦理电影| 国产99精品在线观看| 91在线视频免费观看| 欧美日韩一区二区在线观看| 欧美v日韩v国产v| 国产精品久久久久天堂| 亚洲一区二区视频在线观看| 国产乱色国产精品免费视频| av资源站一区| 91精品综合久久久久久| 中国av一区二区三区| 亚洲一区二区在线观看视频| 久久99久久久欧美国产| aaa欧美日韩| 日韩亚洲欧美综合| 一区视频在线播放| 免费黄网站欧美| 不卡的电影网站| 91精品国模一区二区三区| 久久久久国产一区二区三区四区| 亚洲人成伊人成综合网小说| 人人超碰91尤物精品国产| av一区二区不卡| 欧美一区二区三区思思人| 日韩美女精品在线| 美女一区二区三区在线观看| 99国内精品久久| 日韩欧美国产一区二区三区| 综合亚洲深深色噜噜狠狠网站| 日日摸夜夜添夜夜添精品视频| 成人午夜av影视| 日韩女同互慰一区二区| 亚洲精品免费电影| 国产成人在线电影| 7777精品伊人久久久大香线蕉超级流畅 | 久久精品视频免费观看| 亚洲高清免费视频| 成人av影院在线| 欧美精品一区二区三区蜜臀| 一区二区免费看| 成人精品视频.| 精品久久99ma| 亚洲va韩国va欧美va精品| 成人午夜短视频| 精品毛片乱码1区2区3区| 午夜伊人狠狠久久| 91免费版pro下载短视频| 久久久久久久一区| 美美哒免费高清在线观看视频一区二区 | 欧美成人a∨高清免费观看| 夜夜嗨av一区二区三区中文字幕| 国产成人一级电影| 久久婷婷久久一区二区三区| 日本成人在线不卡视频| 欧美曰成人黄网| 伊人夜夜躁av伊人久久| 99精品欧美一区二区三区小说| 久久精品网站免费观看| 男人的天堂久久精品| 欧美在线免费视屏| 国产精品美女久久久久久久久| 精品一区二区三区的国产在线播放 | 久久精品视频一区| 男人的j进女人的j一区| 成人免费av在线| 欧美极品美女视频| 国产美女一区二区| 欧美一区二区二区| 亚洲国产欧美日韩另类综合| 91玉足脚交白嫩脚丫在线播放| 亚洲视频你懂的| 9i在线看片成人免费| 国产色91在线| av一二三不卡影片| 色八戒一区二区三区| 国产高清视频一区| 亚洲h动漫在线| 91福利视频久久久久| 欧美经典一区二区| 成人午夜电影网站| 欧美国产国产综合| 93久久精品日日躁夜夜躁欧美| 中文在线一区二区| 成人av电影免费在线播放| 亚洲美女一区二区三区| bt欧美亚洲午夜电影天堂| 亚洲精品国产精华液| 色综合天天视频在线观看| 亚洲制服丝袜av| 欧美日韩在线电影| 久88久久88久久久| 精品99久久久久久| 粉嫩一区二区三区在线看| 亚洲精品免费电影| 在线观看网站黄不卡| 日韩电影一区二区三区| 日韩一区二区三区在线视频| 国产一区999| 自拍偷自拍亚洲精品播放| 色综合色综合色综合色综合色综合 | 午夜欧美视频在线观看| 日韩你懂的电影在线观看| 国产米奇在线777精品观看| 亚洲婷婷国产精品电影人久久| 91片黄在线观看| 日本va欧美va精品发布| www欧美成人18+| 色欧美日韩亚洲| 免费成人av在线播放| 国产日韩精品视频一区| 欧美在线free| 毛片不卡一区二区| 专区另类欧美日韩| 欧美日韩精品免费观看视频| 国产精品中文字幕欧美| 久久综合色一综合色88| 色综合色综合色综合色综合色综合| 午夜影院在线观看欧美| 久久精品视频免费观看| 欧美日韩激情一区| 国产精品一级在线| 五月天欧美精品| 欧美一级国产精品| 成人国产在线观看| 全部av―极品视觉盛宴亚洲| 亚洲国产精品成人综合色在线婷婷| 欧美在线看片a免费观看| 麻豆国产91在线播放| 亚洲卡通欧美制服中文| www国产亚洲精品久久麻豆| 一本一道综合狠狠老| 国产成人精品免费网站| 香蕉久久一区二区不卡无毒影院| 欧美国产激情二区三区| 欧美喷水一区二区| 一本到不卡精品视频在线观看| 日韩成人免费看|