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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? port.c

?? MCS-51的一個Free小型操作系統(tǒng),在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.
	***************************************************************************
*/

/*
Changes from V1.00:

	+ Call to taskYIELD() from within tick ISR has been replaced by the more
	  efficient portSWITCH_CONTEXT().
	+ ISR function definitions renamed to include the prv prefix.

Changes from V2.6.1

	+ Replaced the sUsingPreemption variable with the configUSE_PREEMPTION
	  macro to be consistent with the later ports.
*/

/*-----------------------------------------------------------
 * Implementation of functions defined in portable.h for the Flashlite 186
 * port.
 *----------------------------------------------------------*/

#include <dos.h>
#include <stdlib.h>
#include <setjmp.h>

#include "FreeRTOS.h"
#include "task.h"
#include "portasm.h"

/*lint -e950 Non ANSI reserved words okay in this file only. */

#define portTIMER_EOI_TYPE		( 8 )
#define portRESET_PIC()			portOUTPUT_WORD( ( unsigned portSHORT ) 0xff22, portTIMER_EOI_TYPE )
#define portTIMER_INT_NUMBER	0x12

#define portTIMER_1_CONTROL_REGISTER	( ( unsigned portSHORT ) 0xff5e )
#define portTIMER_0_CONTROL_REGISTER	( ( unsigned portSHORT ) 0xff56 )
#define portTIMER_INTERRUPT_ENABLE		( ( unsigned portSHORT ) 0x2000 )

/* Setup the hardware to generate the required tick frequency. */
static void prvSetTickFrequency( unsigned portLONG ulTickRateHz );

/* Set the hardware back to the state as per before the scheduler started. */
static void prvExitFunction( void );

/* The ISR used depends on whether the preemptive or cooperative scheduler
is being used. */
#if( configUSE_PREEMPTION == 1 )
	/* Tick service routine used by the scheduler when preemptive scheduling is
	being used. */
	static void __interrupt __far prvPreemptiveTick( void );
#else
	/* Tick service routine used by the scheduler when cooperative scheduling is
	being used. */
	static void __interrupt __far prvNonPreemptiveTick( void );
#endif

/* Trap routine used by taskYIELD() to manually cause a context switch. */
static void __interrupt __far prvYieldProcessor( void );

/*lint -e956 File scopes necessary here. */

/* Set true when the vectors are set so the scheduler will service the tick. */
static portBASE_TYPE xSchedulerRunning = pdFALSE;

/* Points to the original routine installed on the vector we use for manual
context switches.  This is then used to restore the original routine during
prvExitFunction(). */
static void ( __interrupt __far *pxOldSwitchISR )();

/* Used to restore the original DOS context when the scheduler is ended. */
static jmp_buf xJumpBuf;

/*lint +e956 */

/*-----------------------------------------------------------*/
portBASE_TYPE xPortStartScheduler( void )
{
	/* This is called with interrupts already disabled. */

	/* Remember what was on the interrupts we are going to use
	so we can put them back later if required. */
	pxOldSwitchISR = _dos_getvect( portSWITCH_INT_NUMBER );

	/* Put our manual switch (yield) function on a known
	vector. */
	_dos_setvect( portSWITCH_INT_NUMBER, prvYieldProcessor );

	#if( configUSE_PREEMPTION == 1 )
	{
		/* Put our tick switch function on the timer interrupt. */
		_dos_setvect( portTIMER_INT_NUMBER, prvPreemptiveTick );
	}
	#else
	{
		/* We want the timer interrupt to just increment the tick count. */
		_dos_setvect( portTIMER_INT_NUMBER, prvNonPreemptiveTick );
	}
	#endif

	prvSetTickFrequency( configTICK_RATE_HZ );

	/* Clean up function if we want to return to DOS. */
	if( setjmp( xJumpBuf ) != 0 )
	{
		prvExitFunction();
		xSchedulerRunning = pdFALSE;
	}
	else
	{
		xSchedulerRunning = pdTRUE;

		/* Kick off the scheduler by setting up the context of the first task. */
		portFIRST_CONTEXT();
	}

	return xSchedulerRunning;
}
/*-----------------------------------------------------------*/

/* The ISR used depends on whether the preemptive or cooperative scheduler
is being used. */
#if( configUSE_PREEMPTION == 1 )
	static void __interrupt __far prvPreemptiveTick( void )
	{
		/* Get the scheduler to update the task states following the tick. */
		vTaskIncrementTick();

		/* Switch in the context of the next task to be run. */
		portSWITCH_CONTEXT();

		/* Reset the PIC ready for the next time. */
		portRESET_PIC();
	}
#else
	static void __interrupt __far prvNonPreemptiveTick( void )
	{
		/* Same as preemptive tick, but the cooperative scheduler is being used
		so we don't have to switch in the context of the next task. */
		vTaskIncrementTick();
		portRESET_PIC();
	}
#endif
/*-----------------------------------------------------------*/

static void __interrupt __far prvYieldProcessor( void )
{
	/* Switch in the context of the next task to be run. */
	portSWITCH_CONTEXT();
}
/*-----------------------------------------------------------*/

void vPortEndScheduler( void )
{
	/* Jump back to the processor state prior to starting the
	scheduler.  This means we are not going to be using a
	task stack frame so the task can be deleted. */
	longjmp( xJumpBuf, 1 );
}
/*-----------------------------------------------------------*/

static void prvExitFunction( void )
{
const unsigned portSHORT usTimerDisable = 0x0000;
unsigned portSHORT usTimer0Control;

	/* Interrupts should be disabled here anyway - but no
	harm in making sure. */
	portDISABLE_INTERRUPTS();
	if( xSchedulerRunning == pdTRUE )
	{
		/* Put back the switch interrupt routines that was in place
		before the scheduler started. */
		_dos_setvect( portSWITCH_INT_NUMBER, pxOldSwitchISR );
	}

	/* Disable the timer used for the tick to ensure the scheduler is
	not called before restoring interrupts.  There was previously nothing
	on this timer so there is no old ISR to restore. */
	portOUTPUT_WORD( portTIMER_1_CONTROL_REGISTER, usTimerDisable );

	/* Restart the DOS tick. */
	usTimer0Control = portINPUT_WORD( portTIMER_0_CONTROL_REGISTER );
	usTimer0Control |= portTIMER_INTERRUPT_ENABLE;
	portOUTPUT_WORD( portTIMER_0_CONTROL_REGISTER, usTimer0Control );


	portENABLE_INTERRUPTS();

	/* This will free up all the memory used by the scheduler.
	exiting back to dos with INT21 AH=4CH will do this anyway so
	it is not necessary to call this. */
	vTaskCleanUpResources();
}
/*-----------------------------------------------------------*/

static void prvSetTickFrequency( unsigned portLONG ulTickRateHz )
{
const unsigned portSHORT usMaxCountRegister = 0xff5a;
const unsigned portSHORT usTimerPriorityRegister = 0xff32;
const unsigned portSHORT usTimerEnable = 0xC000;
const unsigned portSHORT usRetrigger = 0x0001;
const unsigned portSHORT usTimerHighPriority = 0x0000;
unsigned portSHORT usTimer0Control;

/* ( CPU frequency / 4 ) / clock 2 max count [inpw( 0xff62 ) = 7] */

const unsigned portLONG ulClockFrequency = ( unsigned portLONG ) 0x7f31a0UL;

unsigned portLONG ulTimerCount = ulClockFrequency / ulTickRateHz;

	portOUTPUT_WORD( portTIMER_1_CONTROL_REGISTER, usTimerEnable | portTIMER_INTERRUPT_ENABLE | usRetrigger );
	portOUTPUT_WORD( usMaxCountRegister, ( unsigned portSHORT ) ulTimerCount );
	portOUTPUT_WORD( usTimerPriorityRegister, usTimerHighPriority );

	/* Stop the DOS tick - don't do this if you want to maintain a TOD clock. */
	usTimer0Control = portINPUT_WORD( portTIMER_0_CONTROL_REGISTER );
	usTimer0Control &= ~portTIMER_INTERRUPT_ENABLE;
	portOUTPUT_WORD( portTIMER_0_CONTROL_REGISTER, usTimer0Control );
}


/*lint +e950 */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
顶级嫩模精品视频在线看| 国产成人免费视频一区| 琪琪久久久久日韩精品| 久久成人免费日本黄色| 国产在线精品视频| 97久久久精品综合88久久| 日韩一级免费观看| 日本道色综合久久| 色狠狠av一区二区三区| 制服丝袜一区二区三区| 欧美激情综合在线| 日韩影院在线观看| 成人av集中营| 欧美大片在线观看一区| 亚洲免费在线电影| 亚洲综合一区二区| 国产xxx精品视频大全| 777欧美精品| 国产精品无码永久免费888| 一区二区三区波多野结衣在线观看| 人人爽香蕉精品| 欧美三级电影在线观看| 欧美激情综合在线| 免费成人小视频| 欧美日韩精品一二三区| 亚洲综合清纯丝袜自拍| 成人动漫一区二区在线| 国产日韩亚洲欧美综合| 韩国三级中文字幕hd久久精品| 欧美精品免费视频| 图片区小说区国产精品视频| 色婷婷精品久久二区二区蜜臀av| 中文字幕欧美区| 国产精品99久久久久久久女警| 精品国产免费久久| 国产一区在线观看麻豆| 久久免费看少妇高潮| 国v精品久久久网| 中文字幕一区二区三区四区| 91香蕉视频污| 一区二区在线观看av| 欧美一区二区在线看| 免费观看在线综合| 国产视频一区二区三区在线观看| 国产精品白丝jk黑袜喷水| 国产精品理伦片| 欧美日韩专区在线| 久久精品国产亚洲一区二区三区| 久久先锋资源网| 在线精品视频免费播放| 久久精品国产秦先生| 国产精品毛片高清在线完整版| 欧洲一区在线观看| 久草这里只有精品视频| 亚洲美腿欧美偷拍| 久久精品视频在线看| 91视频.com| 精品在线一区二区| 亚洲午夜视频在线观看| 久久久国产综合精品女国产盗摄| 91在线高清观看| 国产精品99久久久| 日韩国产欧美在线视频| ...av二区三区久久精品| 日韩欧美在线一区二区三区| 99精品视频一区二区三区| 国产一区久久久| 日本美女一区二区三区| 亚洲国产视频一区| 国产精品不卡在线| 国产三级精品三级在线专区| 欧美日韩国产另类一区| 青青草视频一区| 国产欧美一区二区在线观看| 欧美高清视频在线高清观看mv色露露十八| 国产高清视频一区| 国产成人综合亚洲网站| 捆绑紧缚一区二区三区视频| 日本免费新一区视频| 日韩精品亚洲一区二区三区免费| 亚洲午夜精品17c| 性欧美大战久久久久久久久| 五月婷婷久久综合| 久久av中文字幕片| 国产一区二区三区久久久| 国产乱码精品一区二区三区av | 偷拍一区二区三区四区| 亚洲激情综合网| 日本系列欧美系列| 激情综合色播五月| 国产二区国产一区在线观看| 国产美女视频一区| 国产毛片精品一区| 色婷婷久久久亚洲一区二区三区| 在线观看国产一区二区| 欧美丰满少妇xxxxx高潮对白| 91精品国产乱码久久蜜臀| 久久精品一区四区| 亚洲国产精品久久久男人的天堂 | 日韩精品一区二区三区中文精品| 26uuu另类欧美亚洲曰本| 亚洲综合丁香婷婷六月香| 精品一区二区三区影院在线午夜| 99久久伊人精品| 日韩欧美一级二级三级久久久| 久久综合色天天久久综合图片| 伊人开心综合网| 国产成人aaa| 日韩美女视频在线| 亚洲国产精品久久不卡毛片| 成人自拍视频在线| 日韩精品中文字幕一区二区三区 | 夜夜嗨av一区二区三区网页| 国产福利一区二区三区视频在线| 欧美蜜桃一区二区三区| 1000部国产精品成人观看| 黑人精品欧美一区二区蜜桃| 91精品国产91久久久久久一区二区 | 狠狠色2019综合网| 日韩精品一区二区三区中文精品| 午夜久久福利影院| 欧美在线观看你懂的| 亚洲日韩欧美一区二区在线| 成人午夜视频网站| 欧美精品一区二区三区蜜桃| 国内不卡的二区三区中文字幕| 日韩三区在线观看| 蜜桃av一区二区| 国产亚洲欧美激情| 岛国一区二区三区| 综合久久国产九一剧情麻豆| 国产成人精品一区二区三区四区 | 久久欧美中文字幕| 成人一区二区三区中文字幕| 国产偷国产偷精品高清尤物 | 一区二区在线观看视频在线观看| 色欧美88888久久久久久影院| 亚洲综合一二区| 精品美女一区二区| 91蜜桃视频在线| 日本午夜精品视频在线观看| 日韩免费高清视频| 成人福利视频网站| 日本人妖一区二区| 国产精品久久久久久久裸模| 欧美精品在线视频| 成人成人成人在线视频| 偷拍亚洲欧洲综合| 国产精品久久影院| 精品国产制服丝袜高跟| 欧洲人成人精品| 国产成人在线免费| 男女视频一区二区| 亚洲天天做日日做天天谢日日欢| 欧美一二三区精品| 日本高清免费不卡视频| 国产成人免费视频网站高清观看视频 | 久久99久久99精品免视看婷婷| 亚洲老妇xxxxxx| 国产精品视频九色porn| 久久精品亚洲精品国产欧美kt∨ | 五月天丁香久久| 亚洲另类在线视频| 国产精品久久久久久久久久免费看| 日韩精品影音先锋| 欧美mv日韩mv| 亚洲精品一区二区三区蜜桃下载 | 蜜臀久久99精品久久久久久9| 亚洲mv在线观看| 亚洲午夜久久久久久久久电影院| 亚洲美女视频一区| 一区二区三区产品免费精品久久75| 亚洲国产成人一区二区三区| 国产欧美一二三区| 亚洲人妖av一区二区| 国产精品久久久久久久浪潮网站| 综合欧美亚洲日本| 亚洲一线二线三线视频| 日本亚洲最大的色成网站www| 日本欧美一区二区| 国产精品一区二区三区乱码| 成人做爰69片免费看网站| 一本大道av伊人久久综合| 在线观看三级视频欧美| 日韩视频在线观看一区二区| 日韩一级黄色片| 国产精品久久久久久久久免费樱桃 | 99re热视频这里只精品| 制服.丝袜.亚洲.中文.综合| 日韩欧美中文字幕公布| 亚洲人妖av一区二区| 美洲天堂一区二卡三卡四卡视频| 国产乱子伦视频一区二区三区| av资源网一区| 久久亚洲春色中文字幕久久久| 亚洲色图欧美激情| 国产精品中文字幕一区二区三区| 色偷偷久久一区二区三区| 欧美精品一区二区在线观看| 午夜精品久久久久久久久久|