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

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆久久久久久久| 欧美丝袜丝交足nylons| www.日韩av| 日韩一区二区在线看| 久久在线免费观看| 日本午夜精品视频在线观看| 成人av影视在线观看| 日韩欧美国产午夜精品| 国产精品视频免费| 日本91福利区| 欧美日产国产精品| 亚洲毛片av在线| 成人av影视在线观看| 久久精品视频在线看| 毛片一区二区三区| 91精品国产色综合久久ai换脸| 亚洲欧美日韩在线播放| 99视频一区二区三区| 国产欧美一二三区| 国产精品99久久不卡二区| 欧美成人福利视频| 久久精品99久久久| 精品久久久影院| 狠狠久久亚洲欧美| 精品国产乱码久久久久久免费 | 国产一区二区不卡| 日韩欧美国产综合| 国产又黄又大久久| 久久嫩草精品久久久精品| 激情六月婷婷久久| 国产无遮挡一区二区三区毛片日本| 国内精品久久久久影院一蜜桃| 日韩欧美国产综合在线一区二区三区| 免费人成在线不卡| 日韩欧美高清在线| 国产精品一二三区在线| 欧美国产日韩在线观看| av不卡免费在线观看| 亚洲欧美日韩系列| 欧美日免费三级在线| 亚洲成人动漫一区| 日韩精品一区二| 国产成人在线视频网站| 一区在线观看视频| 91久久香蕉国产日韩欧美9色| 亚洲女同ⅹxx女同tv| 欧美亚洲高清一区| 久久精品99国产精品| 国产欧美日韩久久| 色综合中文字幕国产 | 风间由美中文字幕在线看视频国产欧美| 日韩免费高清视频| 丁香五精品蜜臀久久久久99网站| 自拍av一区二区三区| 欧美唯美清纯偷拍| 九九九精品视频| 国产女人aaa级久久久级| zzijzzij亚洲日本少妇熟睡| 中文字幕在线一区免费| 欧美日韩黄色一区二区| 久久精品国产在热久久| 一区视频在线播放| 69堂精品视频| 国产盗摄一区二区| 亚洲一区二区三区在线播放| 日韩欧美一区中文| 日本高清视频一区二区| 精品中文字幕一区二区 | 久久一夜天堂av一区二区三区| 国产91丝袜在线18| 日韩国产欧美在线播放| 国产精品三级av| 日韩视频在线永久播放| 972aa.com艺术欧美| 久久99九九99精品| 亚洲大片在线观看| 国产精品天美传媒| 日韩精品一区二区三区中文不卡| 99久久精品情趣| 国产一区二区在线观看视频| 亚洲综合久久av| 国产精品三级电影| 久久久亚洲午夜电影| 欧美日韩精品免费观看视频 | 欧美高清精品3d| jizzjizzjizz欧美| 国产一区视频网站| 日精品一区二区| 亚洲一区二区三区免费视频| 久久精品视频在线免费观看| 欧美一级视频精品观看| 欧美中文字幕不卡| 不卡电影免费在线播放一区| 国产综合色视频| 日本午夜精品一区二区三区电影| 一区二区三区成人| 亚洲欧美日韩国产中文在线| 国产日韩精品一区| 久久综合久久综合久久| 日韩欧美一区二区久久婷婷| 欧美福利一区二区| 欧美日韩国产区一| 欧美日韩激情一区二区| 在线视频观看一区| 欧美在线免费观看视频| 日本道色综合久久| 日本韩国一区二区| 欧美性视频一区二区三区| 日本道色综合久久| 欧美影视一区二区三区| 欧洲一区在线电影| 欧美在线小视频| 欧美日韩一区二区三区在线看| 色综合天天天天做夜夜夜夜做| 成人一道本在线| av在线不卡电影| 91天堂素人约啪| 在线观看免费成人| 欧美日韩视频在线一区二区| 欧美精品欧美精品系列| 日韩色在线观看| 久久综合久久久久88| 亚洲国产精华液网站w| 中文字幕亚洲一区二区va在线| 亚洲视频小说图片| 亚洲午夜久久久久久久久电影网| 一区二区三区高清不卡| 亚洲 欧美综合在线网络| 日韩在线a电影| 国产一区二区毛片| a级高清视频欧美日韩| 欧美视频日韩视频在线观看| 91精品国产色综合久久久蜜香臀| 欧美tickling挠脚心丨vk| 欧美国产成人精品| 亚洲电影一级黄| 韩国精品免费视频| 91色|porny| 日韩欧美亚洲一区二区| 国产精品传媒在线| 五月婷婷欧美视频| 国产一区二区三区精品视频| va亚洲va日韩不卡在线观看| 欧美人xxxx| 国产精品视频一二三区| 天堂va蜜桃一区二区三区漫画版 | 国产女人18毛片水真多成人如厕| 综合分类小说区另类春色亚洲小说欧美| 一区二区高清视频在线观看| 免费人成网站在线观看欧美高清| 成人免费黄色在线| 欧美喷潮久久久xxxxx| 国产免费久久精品| 日韩在线播放一区二区| 粉嫩久久99精品久久久久久夜| 在线看日本不卡| 久久久亚洲高清| 五月天视频一区| 99r国产精品| 久久久噜噜噜久久中文字幕色伊伊| 综合久久综合久久| 韩国三级中文字幕hd久久精品| 色综合天天综合| 国产欧美在线观看一区| 日日摸夜夜添夜夜添国产精品| 国产99久久久国产精品潘金| 91精品中文字幕一区二区三区| 欧美激情资源网| 国模冰冰炮一区二区| 欧美一区二区三区四区在线观看| 亚洲欧美自拍偷拍| 国产一区二区按摩在线观看| 欧美高清一级片在线| 亚洲美女淫视频| 不卡一区二区中文字幕| 久久午夜老司机| 免费在线观看精品| 在线观看91精品国产麻豆| 亚洲久本草在线中文字幕| 成人av在线播放网站| 欧美激情综合五月色丁香| 国产精品亚洲午夜一区二区三区 | 久久人人爽爽爽人久久久| 日韩中文字幕区一区有砖一区| 91丨九色丨国产丨porny| 国产亚洲精品福利| 国内精品久久久久影院色| 日韩精品自拍偷拍| 免费成人性网站| 678五月天丁香亚洲综合网| 五月开心婷婷久久| 欧美高清激情brazzers| 日韩精品乱码av一区二区| 欧美日韩在线播放三区| 性做久久久久久久久| 欧美视频中文一区二区三区在线观看| 中文字幕一区二区不卡| 一本久久a久久免费精品不卡| 亚洲色图丝袜美腿| 色噜噜狠狠色综合中国|