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


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

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

/* Processor constants. */
#include "AT91SAM7X256.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 PIT. */
#define portPIT_CLOCK_DIVISOR			( ( unsigned portLONG ) 16 )
#define portPIT_COUNTER_VALUE			( ( ( configCPU_CLOCK_HZ / portPIT_CLOCK_DIVISOR ) / 1000UL ) * portTICK_RATE_MS )

#define portINT_LEVEL_SENSITIVE  0
#define portPIT_ENABLE      	( ( unsigned portSHORT ) 0x1 << 24 )
#define portPIT_INT_ENABLE     	( ( unsigned portSHORT ) 0x1 << 25 )
/*-----------------------------------------------------------*/

/* 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 )
{
AT91PS_PITC pxPIT = AT91C_BASE_PITC;

	/* Setup the AIC for PIT interrupts.  The interrupt routine chosen depends
	on whether the preemptive or cooperative scheduler is being used. */
	#if configUSE_PREEMPTION == 0

		extern void ( vNonPreemptiveTick ) ( void );
		AT91F_AIC_ConfigureIt( AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST, portINT_LEVEL_SENSITIVE, ( void (*)(void) ) vNonPreemptiveTick );

	#else
		
		extern void ( vPreemptiveTick )( void );
		AT91F_AIC_ConfigureIt( AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST, portINT_LEVEL_SENSITIVE, ( void (*)(void) ) vPreemptiveTick );

	#endif

	/* Configure the PIT period. */
	pxPIT->PITC_PIMR = portPIT_ENABLE | portPIT_INT_ENABLE | portPIT_COUNTER_VALUE;

	/* Enable the interrupt.  Global interrupts are disables at this point so 
	this is safe. */
    AT91C_BASE_AIC->AIC_IECR = 0x1 << AT91C_ID_SYS;
}
/*-----------------------------------------------------------*/



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人在线综合网| 国产欧美一区二区三区在线看蜜臀 | 亚洲三级在线看| 全部av―极品视觉盛宴亚洲| av在线播放一区二区三区| 日韩女优电影在线观看| 一级特黄大欧美久久久| 国产成人综合在线播放| 日韩一本二本av| 亚洲网友自拍偷拍| 99麻豆久久久国产精品免费 | 综合电影一区二区三区| 精品一区在线看| 91精品在线观看入口| 亚洲午夜精品一区二区三区他趣| 国产精品资源在线| 6080日韩午夜伦伦午夜伦| 亚洲日本在线a| 成人av在线资源网| 久久综合九色综合97婷婷女人 | 亚洲影视在线播放| 91麻豆免费看| 亚洲人一二三区| 91色乱码一区二区三区| 国产精品久久久久一区二区三区 | 99re在线视频这里只有精品| 久久影院午夜论| 加勒比av一区二区| 日韩精品自拍偷拍| 美日韩一区二区| 91精品久久久久久久99蜜桃 | 日韩欧美一区二区视频| 三级欧美在线一区| 在线成人免费视频| 日韩电影在线免费观看| 51精品国自产在线| 奇米色一区二区| 欧美一卡在线观看| 免费观看91视频大全| 欧美大片顶级少妇| 国内精品久久久久影院一蜜桃| 日韩欧美成人激情| 国内外成人在线视频| 久久久国产一区二区三区四区小说 | 日韩精品国产精品| 777午夜精品免费视频| 日韩福利电影在线观看| 日韩一本二本av| 国产精品18久久久久久久久| 国产午夜亚洲精品不卡| 成人av手机在线观看| 亚洲欧美一区二区久久| 欧美色窝79yyyycom| 欧美日韩国产三级| 悠悠色在线精品| 欧美亚洲国产一区在线观看网站| 亚洲一区免费视频| 日韩欧美色综合| 国产精品一区在线观看你懂的| 国产日韩av一区| 91美女片黄在线观看| 日日摸夜夜添夜夜添亚洲女人| 777a∨成人精品桃花网| 国产一区二区视频在线播放| 国产精品丝袜久久久久久app| 色综合视频在线观看| 亚洲成人av一区| 精品久久五月天| jiyouzz国产精品久久| 樱花影视一区二区| 色又黄又爽网站www久久| 在线亚洲人成电影网站色www| 亚洲综合视频网| 日韩精品一区二区三区老鸭窝| 国产超碰在线一区| 一区二区不卡在线播放| 精品日韩av一区二区| 国产成人免费在线| 亚洲成人一区在线| 久久久久久久久久久99999| 在线观看一区二区视频| 狠狠色丁香久久婷婷综合丁香| 国产亚洲污的网站| 欧美精品电影在线播放| 成人综合婷婷国产精品久久免费| 综合久久给合久久狠狠狠97色| 欧美日本免费一区二区三区| 国产 日韩 欧美大片| 无码av中文一区二区三区桃花岛| 久久久久国产精品免费免费搜索| 91成人在线精品| 国产精品原创巨作av| 日韩av一二三| 国产精品久久久久婷婷二区次| 欧美日韩不卡一区| 色欧美日韩亚洲| 久久国产精品色婷婷| 亚洲bt欧美bt精品777| 中日韩免费视频中文字幕| 精品捆绑美女sm三区| 欧美色精品天天在线观看视频| 国产成人综合自拍| 国产九色sp调教91| 老司机一区二区| 午夜欧美一区二区三区在线播放| 亚洲天堂网中文字| 国产精品嫩草99a| 日韩久久久精品| 精品少妇一区二区三区日产乱码 | 国产精品一二三四| 激情五月婷婷综合网| 日韩成人dvd| 成人精品国产福利| 国产高清精品在线| 国产成人精品免费视频网站| 国内精品久久久久影院薰衣草 | 久久久久久久久久看片| 精品国产一区二区国模嫣然| 日韩一区二区麻豆国产| 日韩精品一区二区三区在线观看 | 国产精品中文字幕日韩精品| 国产一区二区三区观看| 国产一区二区三区黄视频 | 国产成人午夜精品5599| 成人短视频下载| 99综合电影在线视频| 99视频精品在线| 91久久线看在观草草青青| 色婷婷久久久亚洲一区二区三区 | 久久久www成人免费毛片麻豆 | 91视频在线看| 欧美日免费三级在线| 日韩欧美一级特黄在线播放| 艳妇臀荡乳欲伦亚洲一区| 亚洲成a人v欧美综合天堂下载 | 不卡一二三区首页| 91免费精品国自产拍在线不卡| 欧美性生活一区| 欧美丰满高潮xxxx喷水动漫| 欧美成人官网二区| 欧美激情中文不卡| 一区二区三区在线观看视频| 奇米色777欧美一区二区| 国产不卡一区视频| 欧美亚日韩国产aⅴ精品中极品| 欧美一区二区免费视频| 亚洲国产精品99久久久久久久久 | 国产欧美日韩不卡| 亚洲一二三四在线观看| 美洲天堂一区二卡三卡四卡视频 | 国产成人精品免费在线| 欧美午夜精品理论片a级按摩| 91精品国产色综合久久ai换脸| 国产亚洲精品免费| 一区二区三区四区五区视频在线观看| 天堂蜜桃一区二区三区| 成人午夜免费av| 538在线一区二区精品国产| 欧美国产一区视频在线观看| 亚洲第一精品在线| 成年人午夜久久久| 日韩欧美的一区二区| 亚洲精品日产精品乱码不卡| 国产综合一区二区| 欧美在线观看禁18| 日本一区二区视频在线观看| 日av在线不卡| 一本久久a久久精品亚洲| 欧美成人精品1314www| 亚洲一区国产视频| 成人黄页毛片网站| 精品欧美乱码久久久久久 | 欧美老年两性高潮| 亚洲视频在线一区观看| 精品亚洲国内自在自线福利| 欧美午夜精品免费| 国产精品国产自产拍高清av王其| 精品一区二区免费视频| 欧美欧美午夜aⅴ在线观看| 亚洲视频一区二区免费在线观看| 国产精品18久久久久久久久久久久 | 久久久久久麻豆| 老司机午夜精品| 欧美精选在线播放| 亚洲国产精品精华液网站| www.亚洲国产| 国产色产综合色产在线视频| 狠狠色丁香婷婷综合| 日韩情涩欧美日韩视频| 天堂蜜桃91精品| 欧美人与禽zozo性伦| 亚洲国产精品自拍| 日本大香伊一区二区三区| 亚洲私人黄色宅男| bt欧美亚洲午夜电影天堂| 日本一区二区三区在线观看| 国产成人aaa| 日本一二三不卡| 成人午夜电影小说| 久久无码av三级|