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

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

?? port.c

?? freertosV4.40 是一種small的嵌入式系統。利于嵌入式開好者入門學習嵌入式操作系統。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? C
字號:
/*
	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 ST STR75x ARM7
 * port.
 *----------------------------------------------------------*/

/* Library includes. */
#include "75x_tb.h"
#include "75x_eic.h"

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

/* Constants required to setup the initial stack. */
#define portINITIAL_SPSR				( ( portSTACK_TYPE ) 0x3f ) /* System mode, THUMB mode, interrupts enabled. */
#define portINSTRUCTION_SIZE			( ( portSTACK_TYPE ) 4 )

/* Constants required to handle critical sections. */
#define portNO_CRITICAL_NESTING 		( ( unsigned portLONG ) 0 )

/* Prescale used on the timer clock when calculating the tick period. */
#define portPRESCALE 20


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

/* Setup the TB to generate the tick interrupts. */
static void prvSetupTimerInterrupt( void );

/* ulCriticalNesting will get set to zero when the first task starts.  It
cannot be initialised to 0 as this will cause interrupts to be enabled
during the kernel initialisation process. */
unsigned portLONG ulCriticalNesting = ( unsigned portLONG ) 9999;

/* Tick interrupt routines for preemptive operation. */
__arm void vPortPreemptiveTick( 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 status register is set for system mode, with interrupts enabled. */
	*pxTopOfStack = ( portSTACK_TYPE ) portINITIAL_SPSR;
	pxTopOfStack--;

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

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

portBASE_TYPE xPortStartScheduler( void )
{
extern void vPortStartFirstTask( void );

	/* Start the timer that generates the tick ISR.  Interrupts are disabled
	here already. */
	prvSetupTimerInterrupt();

	/* Start the first task. */
	vPortStartFirstTask();	

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

__arm void vPortPreemptiveTick( void )
{
	/* Increment the tick counter. */
	vTaskIncrementTick();

	/* The new tick value might unblock a task.  Ensure the highest task that
	is ready to execute is the task that will execute when the tick ISR
	exits. */
	#if configUSE_PREEMPTION == 1
		vTaskSwitchContext();
	#endif

	TB_ClearITPendingBit( TB_IT_Update );
}
/*-----------------------------------------------------------*/

static void prvSetupTimerInterrupt( void )
{
EIC_IRQInitTypeDef  EIC_IRQInitStructure;	
TB_InitTypeDef      TB_InitStructure;

	/* Setup the EIC for the TB. */
	EIC_IRQInitStructure.EIC_IRQChannelCmd = ENABLE;
	EIC_IRQInitStructure.EIC_IRQChannel = TB_IRQChannel;
	EIC_IRQInitStructure.EIC_IRQChannelPriority = 1;
	EIC_IRQInit(&EIC_IRQInitStructure);
	
	/* Setup the TB for the generation of the tick interrupt. */
	TB_InitStructure.TB_Mode = TB_Mode_Timing;
	TB_InitStructure.TB_CounterMode = TB_CounterMode_Down;
	TB_InitStructure.TB_Prescaler = portPRESCALE;
	TB_InitStructure.TB_AutoReload = ( ( configCPU_CLOCK_HZ / ( portPRESCALE + 1 ) ) / configTICK_RATE_HZ ) + 1;
	TB_Init(&TB_InitStructure);
	
	/* Enable TB Update interrupt */
	TB_ITConfig(TB_IT_Update, ENABLE);

	/* Clear TB Update interrupt pending bit */
	TB_ClearITPendingBit(TB_IT_Update);

	/* Enable TB */
	TB_Cmd(ENABLE);
}
/*-----------------------------------------------------------*/

__arm __interwork void vPortEnterCritical( void )
{
	/* Disable interrupts first! */
	__disable_interrupt();

	/* Now interrupts are disabled ulCriticalNesting can be accessed
	directly.  Increment ulCriticalNesting to keep a count of how many times
	portENTER_CRITICAL() has been called. */
	ulCriticalNesting++;
}
/*-----------------------------------------------------------*/

__arm __interwork void vPortExitCritical( void )
{
	if( ulCriticalNesting > portNO_CRITICAL_NESTING )
	{
		/* Decrement the nesting count as we are leaving a critical section. */
		ulCriticalNesting--;

		/* If the nesting level has reached zero then interrupts should be
		re-enabled. */
		if( ulCriticalNesting == portNO_CRITICAL_NESTING )
		{
			__enable_interrupt();
		}
	}
}
/*-----------------------------------------------------------*/






?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产69精品久久久久777| 欧美bbbbb| 国模冰冰炮一区二区| 91激情五月电影| 国产欧美久久久精品影院| 日韩精品久久理论片| 91网站视频在线观看| 久久久精品免费观看| 日韩制服丝袜先锋影音| 99久久综合狠狠综合久久| 精品国产一区二区精华| 天堂va蜜桃一区二区三区漫画版| 不卡的电影网站| 久久久精品人体av艺术| 麻豆91小视频| 91精品国产一区二区| 亚洲观看高清完整版在线观看 | 中文字幕不卡在线播放| 国产盗摄女厕一区二区三区| 日韩精品一区二| 日韩在线卡一卡二| 在线精品视频免费观看| 综合电影一区二区三区| 成人免费视频视频| 国产无人区一区二区三区| 欧洲亚洲国产日韩| 久久综合久久综合久久综合| 婷婷综合五月天| 欧美伊人久久久久久久久影院 | 欧美日韩在线精品一区二区三区激情| 中文天堂在线一区| 国产91精品免费| 久久精品欧美日韩精品| 国产在线视频一区二区| 精品国产1区2区3区| 精品一区二区久久| 亚洲精品一区在线观看| 久久精品免费看| 欧美一级一区二区| 麻豆高清免费国产一区| 日韩欧美一级片| 久久99精品一区二区三区三区| 91麻豆精品国产91久久久更新时间| 亚洲v日本v欧美v久久精品| 欧美视频在线播放| 天天影视色香欲综合网老头| 欧美久久一区二区| 日韩精品成人一区二区三区| 91精品国产高清一区二区三区蜜臀| 三级精品在线观看| 欧美一区二区在线视频| 久久av中文字幕片| 久久精品视频一区二区| 懂色av一区二区夜夜嗨| 中文字幕制服丝袜一区二区三区| 成人高清视频在线观看| 亚洲人成网站色在线观看| 91高清视频在线| 天堂av在线一区| 欧美成人aa大片| 国产经典欧美精品| 最好看的中文字幕久久| 欧美性生交片4| 日韩不卡免费视频| 精品久久久久久久久久久院品网| 国产一区不卡视频| 中文字幕亚洲在| 欧洲一区二区av| 秋霞国产午夜精品免费视频| 久久久国产精华| 91在线精品一区二区三区| 亚洲在线视频一区| 精品日韩在线观看| fc2成人免费人成在线观看播放 | 亚洲综合另类小说| 日韩一级片在线观看| 国产精品18久久久| 一区二区三区在线视频免费 | 成人性生交大片免费看中文| 亚洲精品videosex极品| 制服视频三区第一页精品| 国产乱子轮精品视频| 亚洲欧美日本韩国| 91精品国产色综合久久久蜜香臀| 国产美女av一区二区三区| 亚洲免费在线看| 欧美一区二视频| 不卡视频在线看| 亚洲成人免费观看| 国产亚洲一本大道中文在线| 欧美在线free| 国产中文一区二区三区| 亚洲综合av网| 久久精品视频网| 欧美日韩在线播放| 成人中文字幕合集| 天堂久久一区二区三区| 国产日韩综合av| 欧美精选午夜久久久乱码6080| 国产乱码精品一区二区三| 亚洲宅男天堂在线观看无病毒| 精品国产乱码久久久久久老虎| 99久久婷婷国产综合精品| 免费人成在线不卡| 亚洲天堂免费在线观看视频| 日韩免费观看高清完整版| 91亚洲男人天堂| 国内外成人在线| 亚洲影视在线播放| 中文一区二区在线观看| 日韩一级二级三级| 在线精品观看国产| 风间由美一区二区av101| 免费观看在线综合色| 亚洲品质自拍视频网站| 久久精品视频在线看| 欧美一区二区三区男人的天堂| 97se亚洲国产综合自在线| 韩国欧美国产1区| 午夜精品久久久久久久久久久| 国产精品久久影院| 26uuu国产日韩综合| 欧美日韩免费一区二区三区 | 日韩av电影一区| 亚洲美女免费视频| 欧美极品xxx| 精品成人一区二区| 7777精品伊人久久久大香线蕉完整版| 波多野结衣亚洲| 国产一区二区三区香蕉| 日韩成人av影视| 亚洲国产日韩综合久久精品| 中文字幕五月欧美| 久久精品一区二区三区不卡| 日韩一级欧美一级| 91精品国产一区二区三区| 欧美在线免费播放| 精品对白一区国产伦| 5858s免费视频成人| 在线精品视频一区二区三四| 91在线免费播放| 成人h精品动漫一区二区三区| 国产真实乱子伦精品视频| 蜜桃精品视频在线| 蜜桃视频免费观看一区| 日本伊人色综合网| 日韩电影在线观看电影| 午夜激情综合网| 性感美女久久精品| 图片区小说区区亚洲影院| 亚洲综合清纯丝袜自拍| 樱花草国产18久久久久| 综合久久一区二区三区| 亚洲日本一区二区| 综合自拍亚洲综合图不卡区| 亚洲欧洲一区二区在线播放| 欧美国产一区视频在线观看| 国产丝袜在线精品| 久久精品视频一区二区三区| 国产日本欧洲亚洲| 中文字幕av一区 二区| 国产日本一区二区| 国产精品美女久久久久久| 国产精品传媒在线| 亚洲欧美电影一区二区| 一区二区三区日韩精品视频| 一级女性全黄久久生活片免费| 一二三区精品福利视频| 亚洲bt欧美bt精品| 日韩精品午夜视频| 久久精品噜噜噜成人88aⅴ| 国产在线精品一区二区不卡了| 国产成人免费在线视频| av爱爱亚洲一区| 色婷婷久久一区二区三区麻豆| 欧美伊人久久久久久久久影院| 欧美日韩国产精选| 日韩免费电影网站| 国产亲近乱来精品视频| 亚洲色图清纯唯美| 亚洲国产精品自拍| 老汉av免费一区二区三区| 国产一区二区三区四区五区美女 | 国产在线精品免费av| 国产91丝袜在线播放九色| 不卡视频在线观看| 欧美性一区二区| 日韩欧美国产一区二区在线播放| 久久久久久久久蜜桃| 国产精品久久久久久久午夜片| 亚洲精品视频免费观看| 五月激情综合网| 国产精品2024| 色成人在线视频| 日韩视频中午一区| 欧美精品 日韩| 中文字幕一区二区三区在线观看 | 欧美成人三级在线| 欧美高清一级片在线观看| 亚洲一区二区成人在线观看|