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


/* 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 ) 0x00000000;	/* 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

	VICVectCntl4 = 1;

	/* Start the timer - interrupts are disabled when this function is called
	so it is okay to do this here. */
	T0TCR = portENABLE_TIMER;
}
/*-----------------------------------------------------------*/



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久无码av三级| 中文字幕免费不卡| 国产二区国产一区在线观看| 一区在线播放视频| 久久奇米777| 欧美日高清视频| 91污在线观看| 国产成人在线视频网站| 视频一区视频二区中文| 亚洲精品成人少妇| 国产精品午夜在线| 日韩精品一区二区三区视频在线观看 | 伦理电影国产精品| 亚洲午夜三级在线| 中文字幕在线一区二区三区| 久久精品一区二区三区av| 91精品国产全国免费观看| 色噜噜狠狠色综合欧洲selulu| 国产激情视频一区二区在线观看 | 麻豆精品在线视频| 五月天激情综合| 亚洲另类在线视频| 国产精品不卡视频| 国产精品乱码一区二三区小蝌蚪| 精品国产区一区| 91麻豆精品国产91久久久| 欧美羞羞免费网站| 在线观看国产一区二区| 色老汉av一区二区三区| 91蜜桃免费观看视频| av电影在线观看一区| av激情综合网| 99精品久久免费看蜜臀剧情介绍| 成人美女视频在线观看| 国产高清不卡一区二区| 国产成人一区在线| 成人精品免费看| 成人一区在线看| 97精品国产露脸对白| 99re热视频精品| 99re视频这里只有精品| 91视频www| 欧美手机在线视频| 欧美电影在线免费观看| 91精品麻豆日日躁夜夜躁| 日韩一区二区在线观看视频| 欧美大片免费久久精品三p| 日韩欧美的一区| 国产三级一区二区三区| 国产精品少妇自拍| 亚洲色图20p| 亚洲午夜久久久久| 蜜臀av一级做a爰片久久| 国产一区二区伦理| 91在线你懂得| 欧美日韩一二区| 日韩欧美在线网站| 国产日产欧美一区| 一区二区三区在线免费播放| 五月天亚洲精品| 国产一区日韩二区欧美三区| 丰满亚洲少妇av| 在线视频你懂得一区二区三区| 欧美日韩国产电影| 久久综合九色综合欧美98| 欧美激情中文字幕| 亚洲一二三四在线观看| 麻豆精品精品国产自在97香蕉| 国产精品一区二区不卡| 99re视频这里只有精品| 日韩一级大片在线| 国产精品网站在线观看| 亚洲一区二区av在线| 国模一区二区三区白浆| 色综合久久综合网| 日韩一区二区三区免费观看 | 免费观看一级特黄欧美大片| 狠狠网亚洲精品| 欧美在线一二三四区| 久久精品人人做人人爽97| 一级日本不卡的影视| 精品制服美女丁香| 欧美在线观看你懂的| 欧美刺激午夜性久久久久久久| 国产精品欧美一级免费| 日韩国产欧美在线视频| 不卡av免费在线观看| 在线播放中文字幕一区| 国产精品乱码一区二区三区软件| 亚洲高清免费视频| 成人久久视频在线观看| 日韩欧美中文字幕公布| 亚洲伊人色欲综合网| 国产精品一区二区x88av| 91成人看片片| 日本一区二区三区四区| 人人超碰91尤物精品国产| 色综合中文字幕国产 | 国产91色综合久久免费分享| 欧美日韩精品免费观看视频| 国产精品久久久久久久午夜片 | 波多野结衣视频一区| 日韩精品最新网址| 亚洲 欧美综合在线网络| 99re热这里只有精品免费视频| 久久免费电影网| 久久精品国产亚洲5555| 欧美日韩免费电影| 亚洲综合一二三区| 99免费精品视频| 国产精品丝袜黑色高跟| 国产剧情在线观看一区二区| 日韩一二三区视频| 日韩国产一区二| 欧美精品三级在线观看| 一区二区不卡在线视频 午夜欧美不卡在| 国产精品18久久久久久久网站| 欧美狂野另类xxxxoooo| 一区二区久久久久| 91亚洲精品久久久蜜桃| 国产精品欧美精品| 国产宾馆实践打屁股91| 日韩欧美在线1卡| 男男gaygay亚洲| 3d成人h动漫网站入口| 亚洲永久精品国产| 欧美色精品天天在线观看视频| 亚洲乱码日产精品bd| 91在线国产观看| 自拍偷拍国产精品| 成人av在线资源网| 中文字幕一区三区| 91色在线porny| 亚洲日穴在线视频| 欧美午夜寂寞影院| 天堂久久久久va久久久久| 欧美一区二区在线播放| 免费成人av在线播放| 精品国产污污免费网站入口| 久久福利视频一区二区| 亚洲精品一线二线三线无人区| 精品一区二区三区在线观看| 日韩欧美的一区二区| 国产在线精品视频| 中文字幕第一区综合| 91麻豆6部合集magnet| 亚洲午夜在线观看视频在线| 3751色影院一区二区三区| 全国精品久久少妇| 久久久一区二区三区捆绑**| 风间由美中文字幕在线看视频国产欧美| 中文欧美字幕免费| 色拍拍在线精品视频8848| 亚洲第一电影网| 欧美精品一区二区久久久| 国产精品一区二区视频| 亚洲男人天堂av网| 欧美日本精品一区二区三区| 韩国女主播成人在线| 中文字幕精品一区二区三区精品| 色综合一区二区| 三级欧美在线一区| 久久久久成人黄色影片| 91麻豆国产精品久久| 午夜激情综合网| 久久久精品tv| 在线亚洲免费视频| 激情综合色播五月| 亚洲美女电影在线| 91麻豆精品91久久久久同性| 国产成人免费xxxxxxxx| 亚洲愉拍自拍另类高清精品| 精品国产乱码久久久久久图片 | 欧美又粗又大又爽| 狠狠色丁香久久婷婷综合丁香| 中文字幕一区二区三区四区| 欧美精品久久99| 波多野结衣在线一区| 午夜久久久影院| 国产精品久久久久久久蜜臀| 777亚洲妇女| 成人午夜看片网址| 视频一区视频二区中文| 国产精品天美传媒| 91精品欧美久久久久久动漫| aaa欧美色吧激情视频| 日韩av电影天堂| 亚洲精品视频在线观看免费| 精品久久五月天| 欧美日韩免费电影| 99久久精品国产一区| 国产在线日韩欧美| 亚洲不卡在线观看| 国产精品高潮呻吟| 精品国产免费人成电影在线观看四季 | 专区另类欧美日韩| 欧美精品一区二区蜜臀亚洲| 欧美日韩一区 二区 三区 久久精品| 国产精品一二三四区| 蜜臀av一区二区在线免费观看|