亚洲欧美第一页_禁久久精品乱码_粉嫩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.
	***************************************************************************
*/


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


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

	PCLKSEL0 = (PCLKSEL0 & (~(0x3<<2))) | (0x01 << 2);
	T0TCR  = 2;         /* Stop and reset the timer */
	T0CTCR = 0;         /* Timer mode               */
	
	/* 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
	T0MR1 = ulCompareMatch;

	/* Generate tick with timer 0 compare match. */
	T0MCR  = (3 << 3);  /* Reset timer on match and generate interrupt */

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

	VICVectPriority4 = 1;

	/* 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一区二区三区免费野_久草精品视频
色综合久久六月婷婷中文字幕| 麻豆一区二区99久久久久| 99久久久精品免费观看国产蜜| 国产精品久久久久久久久免费丝袜| 成人aaaa免费全部观看| 亚洲婷婷国产精品电影人久久| 91免费国产在线观看| 亚洲一本大道在线| 日韩亚洲欧美一区二区三区| 玖玖九九国产精品| 国产日韩欧美精品综合| 91香蕉视频黄| 亚洲福利一二三区| 精品91自产拍在线观看一区| 国产成人av影院| 综合亚洲深深色噜噜狠狠网站| 欧美熟乱第一页| 国产一区三区三区| 亚洲色图一区二区| 日韩一区二区精品在线观看| 国产**成人网毛片九色| 亚洲精品一二三区| 精品成人私密视频| 99riav久久精品riav| 亚洲国产精品影院| 国产欧美日韩中文久久| 欧美日韩一区二区电影| 捆绑调教美女网站视频一区| 国产精品黄色在线观看| 欧美一区二区私人影院日本| 国产精品正在播放| 亚洲国产一区二区视频| 久久久精品国产99久久精品芒果| 一本色道a无线码一区v| 激情综合色综合久久综合| 亚洲人成网站影音先锋播放| 欧美一区二区三区免费视频| 99这里只有精品| 免费观看成人鲁鲁鲁鲁鲁视频| 国产精品久久久久久久久动漫| 欧美理论电影在线| 91视视频在线直接观看在线看网页在线看 | 国产二区国产一区在线观看 | 亚洲综合久久久久| 国产日产精品1区| 555www色欧美视频| 99久久免费精品高清特色大片| 免费在线一区观看| 一区二区三区欧美激情| 久久色在线观看| 欧美一区二区大片| 欧美日韩视频一区二区| 91在线视频18| 国产高清不卡一区二区| 青青草97国产精品免费观看| 亚洲欧洲综合另类在线| 国产精品欧美久久久久无广告| 精品日产卡一卡二卡麻豆| 欧美日韩一本到| 欧美写真视频网站| 91激情在线视频| 成人激情黄色小说| 国产二区国产一区在线观看| 精彩视频一区二区| 九一九一国产精品| 麻豆freexxxx性91精品| 男女男精品视频网| 日本午夜精品一区二区三区电影| 亚洲成年人影院| 性欧美疯狂xxxxbbbb| 亚洲一区二区三区爽爽爽爽爽| 亚洲卡通动漫在线| 亚洲男同性视频| 亚洲影院理伦片| 中文字幕一区二区日韩精品绯色| 日韩欧美的一区二区| 欧美在线观看禁18| 色婷婷综合五月| 丁香六月综合激情| 国产一区二三区| 久久国产精品72免费观看| 日韩精品一区第一页| 亚洲一区二区三区四区的| 亚洲精品日产精品乱码不卡| 91精品午夜视频| 欧美va亚洲va在线观看蝴蝶网| 欧美色精品在线视频| 91国模大尺度私拍在线视频| 99r国产精品| 色呦呦日韩精品| 欧美中文字幕一区| 欧美自拍偷拍一区| 欧美成人精精品一区二区频| 6080日韩午夜伦伦午夜伦| 欧美日韩三级一区| 欧美电影一区二区| 欧美一区二区三区在线电影| 制服.丝袜.亚洲.中文.综合| 欧美日韩午夜影院| 欧美一区二区三区四区高清| 欧美一级欧美三级在线观看| 欧美一级一区二区| 久久亚洲精品国产精品紫薇| 久久精品日产第一区二区三区高清版| 久久久久久久久97黄色工厂| 国产精品免费丝袜| 亚洲欧美偷拍卡通变态| 夜夜夜精品看看| 五月天激情综合网| 另类中文字幕网| 成人性生交大片免费看中文网站| 国产乱子轮精品视频| 成人福利电影精品一区二区在线观看| 99麻豆久久久国产精品免费优播| 91成人在线免费观看| 在线成人av网站| 欧美草草影院在线视频| 一区精品在线播放| 三级不卡在线观看| 国产一区二区三区最好精华液| 日本二三区不卡| 欧美日本乱大交xxxxx| 欧美zozozo| 中文字幕一区二区视频| 午夜婷婷国产麻豆精品| 强制捆绑调教一区二区| 成人黄色在线视频| 日韩欧美第一区| 亚洲精品少妇30p| 麻豆精品新av中文字幕| 99精品视频一区| 欧美一区二区精美| 中文字幕在线免费不卡| 欧美aaaaaa午夜精品| 成人手机在线视频| 在线观看国产一区二区| 2欧美一区二区三区在线观看视频| 亚洲手机成人高清视频| 久草精品在线观看| 欧美三级韩国三级日本三斤| 国产亚洲视频系列| 五月天激情小说综合| 一本久久a久久免费精品不卡| 日韩欧美国产麻豆| 亚洲午夜免费视频| 色又黄又爽网站www久久| 久久嫩草精品久久久久| 亚洲成a人v欧美综合天堂 | 国产伦精品一区二区三区免费迷| 99久久777色| 精品久久免费看| 美女视频黄久久| 在线亚洲人成电影网站色www| 精品剧情v国产在线观看在线| 亚洲精品日韩一| av电影天堂一区二区在线| 国产欧美日韩另类一区| 青青青爽久久午夜综合久久午夜| 91婷婷韩国欧美一区二区| 久久久影视传媒| 日韩黄色一级片| 色老汉一区二区三区| 亚洲已满18点击进入久久| 成人一区二区三区视频在线观看| 日韩免费观看高清完整版在线观看| 亚洲伦在线观看| jlzzjlzz亚洲女人18| 成人免费在线视频| 国产成人av影院| 久久久久久97三级| 久久99久久99小草精品免视看| 欧美日韩一区二区不卡| 日韩精品电影一区亚洲| 欧美视频自拍偷拍| 亚洲国产一二三| 色av成人天堂桃色av| 亚洲精品乱码久久久久久黑人 | 亚洲福利一区二区| 在线视频亚洲一区| 一区二区三区四区蜜桃| 色综合久久久网| 亚洲欧美色图小说| 欧日韩精品视频| 亚洲二区在线视频| 欧美日韩免费在线视频| 一个色在线综合| 欧美少妇性性性| 美女视频一区二区三区| 精品国产乱子伦一区| 国产乱人伦偷精品视频不卡| 久久久久久久久免费| 国产成人综合网站| 国产日韩精品一区二区三区 | 亚洲sss视频在线视频| 在线视频综合导航| 日日夜夜精品免费视频| 久久色视频免费观看| 丁香婷婷综合激情五月色| 一色屋精品亚洲香蕉网站| 91国内精品野花午夜精品|