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

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

?? port.c

?? STM32 FreeRTOS v5.2移植源代碼
?? C
字號:
/*
	FreeRTOS.org V5.2.0 - Copyright (C) 2003-2009 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 (version 2) as published
	by the Free Software Foundation and modified by the FreeRTOS exception.

	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 is included to allow you 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.


	***************************************************************************
	*                                                                         *
	* Get the FreeRTOS eBook!  See http://www.FreeRTOS.org/Documentation      *
	*                                                                         *
	* This is a concise, step by step, 'hands on' guide that describes both   *
	* general multitasking concepts and FreeRTOS specifics. It presents and   *
	* explains numerous examples that are written using the FreeRTOS API.     *
	* Full source code for all the examples is provided in an accompanying    *
	* .zip file.                                                              *
	*                                                                         *
	***************************************************************************

	1 tab == 4 spaces!

	Please ensure to read the configuration and relevant port sections of the
	online documentation.

	http://www.FreeRTOS.org - Documentation, latest information, license and
	contact details.

	http://www.SafeRTOS.com - A version that is certified for use in safety
	critical systems.

	http://www.OpenRTOS.com - Commercial support, development, porting,
	licensing and training services.
*/


/*-----------------------------------------------------------
 * 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;
extern void ( vTickISR )( void );

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

	VICVectAddr0 = ( portLONG ) vTickISR;
	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| 欧美成人女星排名| 国产一区视频导航| 日韩av中文在线观看| 午夜精品福利在线| 肉色丝袜一区二区| 美国毛片一区二区三区| 久久综合综合久久综合| 国产一区二区免费视频| 国产精品12区| 色综合天天综合色综合av| a4yy欧美一区二区三区| 在线精品国精品国产尤物884a| 成人激情午夜影院| 美女视频黄频大全不卡视频在线播放| 日韩精品一区二区三区中文不卡| 久久国产欧美日韩精品| 国产一区二区精品久久99 | 国产亲近乱来精品视频 | 国产精品第四页| 亚洲欧洲精品成人久久奇米网| 在线视频你懂得一区| 色综合久久久网| 欧美性生交片4| 日韩视频免费观看高清在线视频| 国产成人av电影在线播放| 成年人国产精品| 在线视频欧美精品| 欧美老年两性高潮| 欧美一区二区大片| 日本一区二区免费在线观看视频| 欧美日韩在线播放一区| 日韩一区二区在线观看视频播放| 99久久国产免费看| 欧美疯狂做受xxxx富婆| 欧美激情一区二区三区蜜桃视频| 欧美日韩国产成人在线91| 欧美mv日韩mv国产网站| 亚洲欧洲精品一区二区三区| 亚洲国产乱码最新视频| 国产精品夜夜嗨| 欧美日韩视频在线一区二区| www久久久久| 亚洲成av人片一区二区梦乃| 国产乱码精品一区二区三| 欧美日韩久久一区二区| 国产欧美1区2区3区| 亚洲在线视频一区| www.av精品| 久久久国际精品| 日韩影视精彩在线| 色婷婷综合久久久中文字幕| 精品福利av导航| 视频在线观看一区| 色爱区综合激月婷婷| 国产午夜亚洲精品不卡| 天堂精品中文字幕在线| 91久久久免费一区二区| 日本一区二区三级电影在线观看 | 国产精品素人视频| 亚洲成人av资源| 色综合久久中文字幕| 久久久久国产免费免费| 老司机午夜精品| 制服视频三区第一页精品| 亚洲免费毛片网站| aa级大片欧美| 亚洲色图欧美在线| 色爱区综合激月婷婷| 日本一区二区在线不卡| 国产精品自拍毛片| 26uuu另类欧美亚洲曰本| 免费观看久久久4p| 欧美一级视频精品观看| 日日欢夜夜爽一区| 日韩一区二区电影网| 美脚の诱脚舐め脚责91| 3d动漫精品啪啪一区二区竹菊 | 精品国产99国产精品| 男人的天堂久久精品| 欧美一区二区三区喷汁尤物| 日本v片在线高清不卡在线观看| 青青草97国产精品免费观看无弹窗版| 日本成人在线电影网| 欧美精品在线一区二区三区| 日韩电影网1区2区| 精品久久久久久久久久久久包黑料 | 天堂精品中文字幕在线| 欧美午夜精品一区二区蜜桃 | 蜜臀久久99精品久久久画质超高清| 免费人成在线不卡| 91精品国产免费久久综合| 麻豆精品视频在线观看免费 | 91亚洲永久精品| 亚洲影视资源网| 欧美日韩免费在线视频| 日韩av在线发布| 国产人成亚洲第一网站在线播放| 亚洲大片精品永久免费| 欧美成人一区二区三区| 国产一区二区视频在线| 综合久久给合久久狠狠狠97色| 青青草国产精品97视觉盛宴| 久久欧美一区二区| 欧美在线一二三四区| 老司机精品视频在线| 国产精品久久久久久久久动漫 | 蜜桃视频一区二区三区在线观看| 成人黄页在线观看| 日韩在线观看一区二区| 久久久综合激的五月天| 色老头久久综合| 国内精品自线一区二区三区视频| 欧美日韩一区高清| 国产精品白丝jk黑袜喷水| 午夜精品一区在线观看| 久久夜色精品一区| 在线免费不卡视频| 国产精品66部| 丝袜美腿亚洲一区| 亚洲天堂中文字幕| 亚洲精品一区在线观看| 欧美丝袜丝交足nylons图片| 国产福利一区二区三区| 日韩电影在线免费观看| 亚洲男帅同性gay1069| 欧美va亚洲va在线观看蝴蝶网| 亚洲成人免费影院| 中文字幕一区视频| 欧美大白屁股肥臀xxxxxx| 成人av在线影院| 狠狠狠色丁香婷婷综合久久五月| 日韩午夜av一区| 欧美日韩一二三| 色偷偷久久人人79超碰人人澡| 国产精品欧美极品| 亚洲精品在线免费观看视频| 欧美日韩你懂得| 北条麻妃国产九九精品视频| 激情五月婷婷综合网| 日韩制服丝袜av| 亚洲一区二区在线视频| 亚洲欧美国产三级| 亚洲视频一区在线观看| 中文字幕的久久| 国产清纯美女被跳蛋高潮一区二区久久w| 国产精品一区2区| 精品一区二区三区在线观看 | 国产精品毛片久久久久久| 久久久久国产一区二区三区四区| 国产精品911| 国产91富婆露脸刺激对白| 免费在线看成人av| 日本色综合中文字幕| 日韩1区2区日韩1区2区| 亚洲h在线观看| 日韩福利电影在线| 九一久久久久久| 国产在线视视频有精品| 国内精品嫩模私拍在线| 丰满岳乱妇一区二区三区| 丁香天五香天堂综合| 丰满少妇在线播放bd日韩电影| 亚洲成人中文在线| 青娱乐精品视频| 国产一区二区不卡老阿姨| 成人午夜电影久久影院| 一本大道久久a久久综合婷婷| 亚洲电影在线播放| 麻豆免费看一区二区三区| 久久成人久久爱| 成人av先锋影音| 色欧美日韩亚洲| 91精品国产综合久久精品 | 91捆绑美女网站| 欧美日韩在线播放一区| 日韩欧美综合在线| 中文一区一区三区高中清不卡| 欧美性受xxxx黑人xyx| 欧美精品123区| 久久久91精品国产一区二区精品| 91成人网在线| 日韩欧美国产综合在线一区二区三区| 成人av电影观看| 欧美日韩视频专区在线播放| 欧美一级高清大全免费观看| 久久久综合网站| 亚洲va国产va欧美va观看| 国产成人啪免费观看软件| 欧美在线影院一区二区| wwww国产精品欧美| 亚洲欧美色一区| 精品一区二区三区在线观看| 91麻豆.com| 久久免费的精品国产v∧| 亚洲午夜精品网| 成人黄色国产精品网站大全在线免费观看 | 国产激情精品久久久第一区二区 | 亚洲国产欧美在线人成| 国产激情视频一区二区三区欧美 |