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

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

?? port.c

?? MCS-51的一個Free小型操作系統,在KeilC中下編譯工作
?? C
字號:
/*
	FreeRTOS.org V4.1.3 - Copyright (C) 2003-2006 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 Atmel ARM7 port.
 *----------------------------------------------------------*/


/* Standard includes. */
#include <stdlib.h>
#include <intrinsic.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 setup the PIT. */
#define portPIT_CLOCK_DIVISOR			( ( unsigned portLONG ) 16 )
#define portPIT_COUNTER_VALUE			( ( ( configCPU_CLOCK_HZ / portPIT_CLOCK_DIVISOR ) / 1000UL ) * portTICK_RATE_MS )

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


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

/* Setup the PIT 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;

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

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

#if configUSE_PREEMPTION == 0

	/* The cooperative scheduler requires a normal IRQ service routine to
	simply increment the system tick. */
	static __arm __irq void vPortNonPreemptiveTick( void );
	static __arm __irq void vPortNonPreemptiveTick( void )
	{
		unsigned portLONG ulDummy;
		
		/* Increment the tick count - which may wake some tasks but as the
		preemptive scheduler is not being used any woken task is not given
		processor time no matter what its priority. */
		vTaskIncrementTick();
		
		/* Clear the PIT interrupt. */
		ulDummy = AT91C_BASE_PITC->PITC_PIVR;
		
		/* End the interrupt in the AIC. */
		AT91C_BASE_AIC->AIC_EOICR = ulDummy;
	}

#else

	/* Currently the IAR port requires the preemptive tick function to be
	defined in an asm file. */

#endif

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

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

		AT91F_AIC_ConfigureIt( AT91C_BASE_AIC, AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST, portINT_LEVEL_SENSITIVE, ( void (*)(void) ) vPortNonPreemptiveTick );

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

	#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. */
	AT91F_AIC_EnableIt( AT91C_BASE_AIC, AT91C_ID_SYS );
}
/*-----------------------------------------------------------*/

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

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一区二区三区免费野_久草精品视频
亚洲色图欧美偷拍| 亚洲自拍偷拍综合| 丝袜美腿亚洲综合| 白白色 亚洲乱淫| 26uuu欧美| 日韩综合小视频| 91福利国产精品| 国产欧美一区二区三区在线看蜜臀 | 日韩欧美在线影院| 日韩高清不卡一区二区三区| 欧美www视频| 久久爱另类一区二区小说| 欧美成人精品福利| av网站一区二区三区| 亚洲六月丁香色婷婷综合久久| 欧美午夜不卡视频| 精品一区二区影视| 国产日产欧美一区二区视频| 99久久久久久| 久久国产精品一区二区| 国产精品久久久久久久蜜臀| 9191精品国产综合久久久久久| 中文字幕在线观看不卡视频| 日韩精品欧美成人高清一区二区| 2020国产精品自拍| 色噜噜狠狠成人中文综合| 青青草原综合久久大伊人精品 | 在线欧美一区二区| 国产一区不卡在线| 视频一区欧美精品| 日韩一区在线播放| www激情久久| 欧美人xxxx| 在线视频国产一区| 中文字幕中文字幕一区| 国产99精品视频| 国内成人自拍视频| 成人av资源站| 色综合久久久久久久久| 一本久久综合亚洲鲁鲁五月天| www.色精品| 欧美伊人久久久久久久久影院| 欧美色精品在线视频| 日韩免费看的电影| 国产精品国产三级国产有无不卡| 亚洲va在线va天堂| 91精品国产免费久久综合| 91精品国产综合久久福利| 91免费看片在线观看| 色综合欧美在线| 日本高清无吗v一区| 欧美午夜精品久久久久久超碰 | 久久久精品综合| 久久久久久久综合色一本| 国产亚洲一二三区| 中文字幕av资源一区| 亚洲免费观看高清完整版在线观看熊 | 精品成人一区二区三区四区| 久久婷婷国产综合国色天香| 久久嫩草精品久久久精品一| 国产精品久久久一区麻豆最新章节| 国产精品不卡在线| 日本在线不卡一区| 不卡的av在线| 7799精品视频| 综合中文字幕亚洲| 麻豆精品视频在线观看免费| 懂色av一区二区在线播放| 欧美日韩一区小说| 亚洲国产成人自拍| 日韩黄色在线观看| 日本乱人伦aⅴ精品| 日韩一级在线观看| 亚洲综合成人在线视频| 久久97超碰色| 97精品国产露脸对白| 午夜日韩在线电影| 91精品国产色综合久久不卡蜜臀| 亚洲乱码国产乱码精品精的特点 | 日韩一区国产二区欧美三区| 图片区小说区国产精品视频| 欧美亚日韩国产aⅴ精品中极品| 亚洲国产精品欧美一二99| 欧美午夜精品一区| 精品一区二区日韩| 日本一区二区成人| 99久久久久免费精品国产| 亚洲美女少妇撒尿| 日韩一区二区高清| 国产福利91精品| 亚洲狠狠丁香婷婷综合久久久| 欧美亚洲国产一卡| 久久99国产精品尤物| 国产精品入口麻豆九色| 一本到高清视频免费精品| 亚洲成人免费观看| 久久亚洲综合色一区二区三区| 成人av网站在线观看免费| 亚洲欧美精品午睡沙发| 欧美一区二区视频在线观看2020 | 久国产精品韩国三级视频| 日本一区二区三区四区| 欧美少妇性性性| 国产91精品一区二区麻豆网站| 自拍偷拍国产亚洲| 久久久亚洲精华液精华液精华液| 99久久国产免费看| 极品销魂美女一区二区三区| 亚洲免费观看高清完整版在线观看| 日韩欧美成人激情| 欧美老人xxxx18| 不卡视频免费播放| 久久精品国产77777蜜臀| 久久天堂av综合合色蜜桃网| 9i看片成人免费高清| 日本麻豆一区二区三区视频| 国产精品美女视频| 91福利小视频| 成人理论电影网| 国产乱码精品一区二区三区av | 日韩欧美一级在线播放| 91浏览器入口在线观看| 久久国内精品自在自线400部| 1024成人网色www| 久久影院电视剧免费观看| 91精品国产入口| 欧美区一区二区三区| 欧洲一区二区三区免费视频| 99精品欧美一区二区蜜桃免费 | 亚洲一区二区三区四区五区中文| 欧美一级理论片| 色偷偷久久一区二区三区| 成人网页在线观看| 国产剧情在线观看一区二区| 国产在线精品免费av| 激情国产一区二区 | 欧美日韩视频在线第一区 | 99re热这里只有精品视频| 丁香亚洲综合激情啪啪综合| 成人黄页毛片网站| 色av一区二区| 9191成人精品久久| 久久久久久久一区| 亚洲老司机在线| 麻豆精品视频在线观看免费| 国产精品一线二线三线精华| 高清在线成人网| 黄色日韩网站视频| 国产成人在线观看免费网站| 国产jizzjizz一区二区| 国精产品一区一区三区mba桃花| 成人夜色视频网站在线观看| 在线看不卡av| 久久久精品蜜桃| 亚洲影视在线观看| 美女高潮久久久| 99久久久无码国产精品| 欧美日韩国产影片| 国产天堂亚洲国产碰碰| 亚洲日本中文字幕区| 久久伊人中文字幕| 久久精品视频一区二区| 亚洲午夜免费福利视频| 成人网在线免费视频| 欧美老年两性高潮| 欧美视频在线播放| 国产福利精品导航| 蜜桃精品在线观看| 麻豆国产一区二区| 国产美女精品一区二区三区| 成人免费毛片app| 在线播放国产精品二区一二区四区| 日韩欧美二区三区| 亚洲男帅同性gay1069| 蜜桃一区二区三区在线| 成人av片在线观看| 日韩一区二区三免费高清| 椎名由奈av一区二区三区| 男男gaygay亚洲| 欧美性受xxxx黑人xyx性爽| 国产亚洲精品中文字幕| 免费观看成人鲁鲁鲁鲁鲁视频| 成人午夜大片免费观看| 日韩精品影音先锋| 亚洲成人黄色小说| 欧美影院一区二区| 综合欧美亚洲日本| 懂色av一区二区在线播放| 久久丝袜美腿综合| 韩国v欧美v日本v亚洲v| 欧美成人vps| 国产最新精品免费| 久久女同性恋中文字幕| 极品尤物av久久免费看| 精品少妇一区二区| 精品无人区卡一卡二卡三乱码免费卡| 欧美片在线播放| 毛片av一区二区| 欧美精品一区二区三区久久久| 国产高清成人在线|