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

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

?? port.c

?? 超好的嵌入式操作系統(tǒng)學(xué)習(xí)代碼
?? C
字號:
/* 
	FreeRTOS.org V4.5.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.
	***************************************************************************
*/

/* GCC/HCS12 port by Jefferson L Smith, 2005 */

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

/* Port includes */
#include <sys/ports_def.h>

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


/*
 * Configure a timer to generate the RTOS tick at the frequency specified 
 * within FreeRTOSConfig.h.
 */
static void prvSetupTimerInterrupt( void );

/* NOTE: Interrupt service routines must be in non-banked memory - as does the
scheduler startup function. */
#define ATTR_NEAR	__attribute__((near))

/* Manual context switch function.  This is the SWI ISR. */
// __attribute__((interrupt))
void ATTR_NEAR vPortYield( void );

/* Tick context switch function.  This is the timer ISR. */
// __attribute__((interrupt))
void ATTR_NEAR vPortTickInterrupt( void );

/* Function in non-banked memory which actually switches to first task. */
portBASE_TYPE ATTR_NEAR xStartSchedulerNear( void );

/* Calls to portENTER_CRITICAL() can be nested.  When they are nested the 
critical section should not be left (i.e. interrupts should not be re-enabled)
until the nesting depth reaches 0.  This variable simply tracks the nesting 
depth.  Each task maintains it's own critical nesting depth variable so 
uxCriticalNesting is saved and restored from the task stack during a context
switch. */
volatile unsigned portBASE_TYPE uxCriticalNesting = 0x80;  // un-initialized

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

/* 
 * See header file for description. 
 */
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{


	/* Setup the initial stack of the task.  The stack is set exactly as 
	expected by the portRESTORE_CONTEXT() macro.  In this case the stack as
	expected by the HCS12 RTI instruction. */


	/* The address of the task function is placed in the stack byte at a time. */
	*pxTopOfStack   = ( portSTACK_TYPE ) *( ((portSTACK_TYPE *) (&pxCode) ) + 1 );
	*--pxTopOfStack = ( portSTACK_TYPE ) *( ((portSTACK_TYPE *) (&pxCode) ) + 0 );

	/* Next are all the registers that form part of the task context. */

	/* Y register */
	*--pxTopOfStack = ( portSTACK_TYPE ) 0xff;
	*--pxTopOfStack = ( portSTACK_TYPE ) 0xee;

	/* X register */
	*--pxTopOfStack = ( portSTACK_TYPE ) 0xdd;
	*--pxTopOfStack = ( portSTACK_TYPE ) 0xcc;
 
	/* A register contains parameter high byte. */
	*--pxTopOfStack = ( portSTACK_TYPE ) *( ((portSTACK_TYPE *) (&pvParameters) ) + 0 );

	/* B register contains parameter low byte. */
	*--pxTopOfStack = ( portSTACK_TYPE ) *( ((portSTACK_TYPE *) (&pvParameters) ) + 1 );

	/* CCR: Note that when the task starts interrupts will be enabled since
	"I" bit of CCR is cleared */
	*--pxTopOfStack = ( portSTACK_TYPE ) 0x80;		// keeps Stop disabled (MCU default)
	
	/* tmp softregs used by GCC. Values right now don't	matter. */
	__asm("\n\
		movw _.frame, 2,-%0							\n\
		movw _.tmp, 2,-%0							\n\
		movw _.z, 2,-%0								\n\
		movw _.xy, 2,-%0							\n\
		;movw _.d2, 2,-%0							\n\
		;movw _.d1, 2,-%0							\n\
	": "=A"(pxTopOfStack) : "0"(pxTopOfStack) );

	#ifdef BANKED_MODEL
		/* The page of the task. */
		*--pxTopOfStack = 0x30;      // can only directly start in PPAGE 0x30
	#endif
	
	/* The critical nesting depth is initialised with 0 (meaning not in
	a critical section). */
	*--pxTopOfStack = ( portSTACK_TYPE ) 0x00;


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

void vPortEndScheduler( void )
{
	/* It is unlikely that the HCS12 port will get stopped. */
}
/*-----------------------------------------------------------*/

static void prvSetupTimerInterrupt( void )
{
	/* Enable hardware RTI timer */
	/* Ignores configTICK_RATE_HZ */
	RTICTL = 0x50;			// 16 MHz xtal: 976.56 Hz, 1024mS 
	CRGINT |= 0x80;			// RTIE
}
/*-----------------------------------------------------------*/

portBASE_TYPE xPortStartScheduler( void )
{
	/* xPortStartScheduler() does not start the scheduler directly because 
	the header file containing the xPortStartScheduler() prototype is part 
	of the common kernel code, and therefore cannot use the CODE_SEG pragma. 
	Instead it simply calls the locally defined xNearStartScheduler() - 
	which does use the CODE_SEG pragma. */

	short register d;
	__asm ("jmp  xStartSchedulerNear		; will never return": "=d"(d));
	return d;
}
/*-----------------------------------------------------------*/

portBASE_TYPE xStartSchedulerNear( void )
{
	/* Configure the timer that will generate the RTOS tick.  Interrupts are
	disabled when this function is called. */
	prvSetupTimerInterrupt();

	/* Restore the context of the first task. */
	portRESTORE_CONTEXT();

	portISR_TAIL();

	/* Should not get here! */
	return pdFALSE;
}
/*-----------------------------------------------------------*/

/*
 * Context switch functions.  These are interrupt service routines.
 */

/*
 * Manual context switch forced by calling portYIELD().  This is the SWI
 * handler.
 */
void vPortYield( void )
{
	portISR_HEAD();
	/* NOTE: This is the trap routine (swi) although not defined as a trap.
	   It will fill the stack the same way as an ISR in order to mix preemtion
	   and cooperative yield. */

	portSAVE_CONTEXT();
	vTaskSwitchContext();
	portRESTORE_CONTEXT();

	portISR_TAIL();
}
/*-----------------------------------------------------------*/

/*
 * RTOS tick interrupt service routine.  If the cooperative scheduler is 
 * being used then this simply increments the tick count.  If the 
 * preemptive scheduler is being used a context switch can occur.
 */
void vPortTickInterrupt( void )
{
	portISR_HEAD();

	/* Clear tick timer flag */
	CRGFLG = 0x80;

	#if configUSE_PREEMPTION == 1
	{
		/* A context switch might happen so save the context. */
		portSAVE_CONTEXT();

		/* Increment the tick ... */
		vTaskIncrementTick();

		/* ... then see if the new tick value has necessitated a
		context switch. */
		vTaskSwitchContext();

		/* Restore the context of a task - which may be a different task
		to that interrupted. */
		portRESTORE_CONTEXT();
	}
	#else
	{
		vTaskIncrementTick();
	}
	#endif

	portISR_TAIL();
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美在线观看你懂的| 亚洲成人自拍一区| 国产高清视频一区| 精品99一区二区三区| 国内成人精品2018免费看| 精品国产成人系列| 国产精品伊人色| 久久精品一区四区| 成人综合在线观看| 成人免费在线播放视频| 色哟哟一区二区三区| 亚洲一区二区精品视频| 91精品国产综合久久精品性色| 日韩成人免费电影| 精品久久99ma| 国产91色综合久久免费分享| 国产精品成人在线观看| 在线区一区二视频| 天天影视色香欲综合网老头| 日韩欧美成人一区| 成人激情校园春色| 亚洲一区在线看| 91精品国产91热久久久做人人 | 欧美高清dvd| 免费观看久久久4p| 国产欧美日韩在线看| 在线免费观看日本一区| 另类小说视频一区二区| 国产三级一区二区| 91福利在线免费观看| 日本视频免费一区| 国产精品每日更新| 欧美精品欧美精品系列| 国内精品久久久久影院色| 亚洲三级理论片| 日韩一级二级三级精品视频| 成人午夜私人影院| 首页国产欧美久久| 成人欧美一区二区三区黑人麻豆| 91超碰这里只有精品国产| 国产精品白丝jk黑袜喷水| 一区二区三区中文字幕精品精品| 欧美一级二级三级蜜桃| 91在线云播放| 久久精品视频在线免费观看| 激情综合色播五月| 一区二区三区在线不卡| 日韩欧美另类在线| 欧美在线免费观看亚洲| 国产精品99久久不卡二区| 亚洲国产精品精华液网站| 日本一区二区综合亚洲| 717成人午夜免费福利电影| 不卡一区二区三区四区| 麻豆精品久久精品色综合| 亚洲情趣在线观看| 国产女人18水真多18精品一级做| 337p亚洲精品色噜噜噜| 色先锋资源久久综合| 成人免费观看视频| 久久不见久久见中文字幕免费| 亚洲欧美日韩国产手机在线| 欧美激情艳妇裸体舞| 日韩一级在线观看| 欧美日韩视频不卡| 色婷婷综合久久久| 粉嫩av一区二区三区在线播放| 日本vs亚洲vs韩国一区三区二区| 一区二区在线观看免费视频播放| 国产日韩精品视频一区| 欧美精品一区二区三区四区| 6080日韩午夜伦伦午夜伦| 欧美综合视频在线观看| av一本久道久久综合久久鬼色| 国产一区日韩二区欧美三区| 日本成人在线网站| 爽好多水快深点欧美视频| 亚洲国产综合91精品麻豆| 亚洲人被黑人高潮完整版| 亚洲婷婷国产精品电影人久久| 国产欧美日韩视频在线观看| 久久蜜桃av一区精品变态类天堂| 欧美一级搡bbbb搡bbbb| 制服丝袜在线91| 91精品国产综合久久福利软件| 色av综合在线| 在线精品观看国产| 欧美日韩国产a| 欧美肥妇free| 欧美一级一级性生活免费录像| 91麻豆精品国产91久久久久久| 欧美精品三级日韩久久| 337p亚洲精品色噜噜噜| 欧美一区二区三区在线观看视频| 日韩一区二区免费电影| 日韩欧美色电影| 精品国产一区二区三区av性色| 亚洲精品在线免费播放| 久久久久国产精品厨房| 亚洲国产精华液网站w| 国产精品久久久久久久久晋中 | 久国产精品韩国三级视频| 美女网站在线免费欧美精品| 国产一区二区三区免费在线观看| 亚洲欧美一区二区三区国产精品| 51精品国自产在线| 精品国产乱码久久久久久久久| 欧美激情在线观看视频免费| 亚洲色图欧洲色图| 天堂一区二区在线免费观看| 国产一区二区不卡| 91免费国产在线| 91.麻豆视频| 国产欧美在线观看一区| 亚洲精品菠萝久久久久久久| 三级不卡在线观看| 国产激情精品久久久第一区二区| av一本久道久久综合久久鬼色| 精品视频在线免费观看| 精品久久久久久无| 一区二区三区四区中文字幕| 青草av.久久免费一区| 成人性生交大片免费看视频在线 | caoporn国产精品| 欧美性猛交xxxxxx富婆| 精品免费国产一区二区三区四区| 成人免费一区二区三区视频| 麻豆精品视频在线| 色欧美日韩亚洲| 精品99一区二区| 亚洲v日本v欧美v久久精品| 国产精品99久久久久久有的能看 | 欧美久久久一区| 国产婷婷色一区二区三区在线| 一区二区三区在线视频观看| 国内成+人亚洲+欧美+综合在线 | 天天av天天翘天天综合网| 国产成人免费在线| 欧美精品v国产精品v日韩精品| 国产精品入口麻豆原神| 免费观看一级欧美片| 欧美最猛黑人xxxxx猛交| 国产喷白浆一区二区三区| 日韩经典一区二区| 色综合久久中文字幕综合网| 久久久久国产精品麻豆ai换脸 | 日韩一区二区三区电影在线观看| 亚洲少妇30p| 国产电影一区在线| 欧美福利电影网| 亚洲午夜羞羞片| 99riav一区二区三区| 久久久www成人免费无遮挡大片| 日韩成人免费在线| 欧美日韩aaa| 精品噜噜噜噜久久久久久久久试看 | 国产精品蜜臀在线观看| 狠狠色丁香久久婷婷综合_中 | 欧美肥妇free| 亚洲香肠在线观看| 97国产一区二区| 日本一区二区久久| 国产一区在线观看麻豆| 26uuu色噜噜精品一区二区| 日本91福利区| 91精品啪在线观看国产60岁| 亚洲高清视频在线| 欧美性xxxxxx少妇| 亚洲在线成人精品| 欧美伊人精品成人久久综合97 | 亚洲综合一区在线| 色八戒一区二区三区| 一区二区三区日韩欧美| 日本精品一区二区三区高清| 亚洲女人的天堂| 色又黄又爽网站www久久| 亚洲激情欧美激情| 欧美丝袜第三区| 亚洲图片自拍偷拍| 欧美高清精品3d| 麻豆精品国产传媒mv男同| 欧美电影免费观看完整版| 麻豆精品视频在线观看免费| 久久久久一区二区三区四区| 国产精品88av| 懂色av中文一区二区三区| 欧美精品一区二区三区久久久| 久久不见久久见免费视频1| 久久影院视频免费| 国产91精品一区二区麻豆亚洲| 欧美激情综合五月色丁香 | 国产精品免费视频一区| 波多野结衣中文字幕一区二区三区 | 欧美日韩中字一区| 日本不卡中文字幕| 国产婷婷色一区二区三区在线| 91蝌蚪porny| 奇米精品一区二区三区在线观看| 久久久久高清精品| 欧美在线免费播放|