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

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

?? port.c

?? FreeRTOS is a portable, open source, mini Real Time Kernel - a free to download and royalty free RTO
?? C
字號:
/*
	FreeRTOS.org V5.2.0 - Copyright (C) 2003-2009 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 (version 2) as published
	by the Free Software Foundation and modified by the FreeRTOS exception.

	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 is included to allow you 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.


	***************************************************************************
	*                                                                         *
	* Get the FreeRTOS eBook!  See http://www.FreeRTOS.org/Documentation      *
	*                                                                         *
	* This is a concise, step by step, 'hands on' guide that describes both   *
	* general multitasking concepts and FreeRTOS specifics. It presents and   *
	* explains numerous examples that are written using the FreeRTOS API.     *
	* Full source code for all the examples is provided in an accompanying    *
	* .zip file.                                                              *
	*                                                                         *
	***************************************************************************

	1 tab == 4 spaces!

	Please ensure to read the configuration and relevant port sections of the
	online documentation.

	http://www.FreeRTOS.org - Documentation, latest information, license and
	contact details.

	http://www.SafeRTOS.com - A version that is certified for use in safety
	critical systems.

	http://www.OpenRTOS.com - Commercial support, development, porting,
	licensing and training services.
*/

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人激情综合网| 蜜桃视频一区二区三区| 欧美一区二区视频免费观看| 国产风韵犹存在线视精品| 亚洲摸摸操操av| 精品国产91乱码一区二区三区| 色综合久久天天| 国产美女精品一区二区三区| 午夜电影网一区| 亚洲欧美日韩中文播放 | 国产亚洲精品久| 欧美日韩国产电影| 99视频在线精品| 国产精品1区二区.| 久久精品99国产精品日本| 亚洲成人av电影| 亚洲人成网站色在线观看| 国产三级精品视频| 精品国产乱码久久久久久闺蜜| 欧美日韩一区视频| 在线免费观看视频一区| 99在线热播精品免费| 成人在线综合网站| 国产九九视频一区二区三区| 美女在线一区二区| 首页国产丝袜综合| 日韩国产高清影视| 丝袜美腿一区二区三区| 午夜久久久久久久久| 一区二区三区欧美视频| 亚洲另类色综合网站| 国产精品进线69影院| 中文字幕一区二区三区四区 | 亚洲电影你懂得| 亚洲综合色成人| 亚洲午夜在线视频| 亚洲国产日韩一区二区| 亚洲国产人成综合网站| 亚洲国产日日夜夜| 亚洲二区在线视频| 偷拍日韩校园综合在线| 五月天一区二区三区| 日韩av一级片| 捆绑紧缚一区二区三区视频| 精彩视频一区二区三区| 国产精品99精品久久免费| 丁香网亚洲国际| av在线播放成人| 色婷婷亚洲精品| 欧美日韩另类一区| 欧美电影免费观看高清完整版 | 国产日韩av一区| 中文字幕中文乱码欧美一区二区 | 欧美一区二区成人6969| 欧美一卡二卡在线观看| 精品区一区二区| 久久九九久精品国产免费直播| 久久久久久久一区| 亚洲欧美综合网| 午夜精品久久久久久| 韩国三级中文字幕hd久久精品| 国产91精品精华液一区二区三区 | 日日夜夜精品视频天天综合网| 丝袜美腿亚洲一区| 国产精品资源网站| 一本到不卡精品视频在线观看| 欧美日韩在线播| 欧美精品一区二区三区视频 | 亚洲成av人片一区二区| 麻豆成人av在线| 福利电影一区二区| 欧美日韩中文字幕精品| 精品国产麻豆免费人成网站| 国产精品成人在线观看| 日韩成人一级片| 国产不卡在线播放| 欧美日本精品一区二区三区| 久久综合久久久久88| 亚洲素人一区二区| 奇米亚洲午夜久久精品| 成人av免费网站| 欧美一区二区播放| 日韩伦理av电影| 奇米777欧美一区二区| 成人黄色软件下载| 91精品国产入口在线| 中文字幕在线观看一区二区| 视频一区中文字幕国产| 国产91精品久久久久久久网曝门 | 成人永久aaa| 欧美日韩一区小说| 欧美激情一区不卡| 日本伊人色综合网| 91小视频免费看| 精品国产亚洲一区二区三区在线观看 | 国产乱理伦片在线观看夜一区| 在线观看区一区二| 国产视频视频一区| 日本欧美韩国一区三区| 91国偷自产一区二区开放时间 | 午夜精品成人在线视频| eeuss鲁片一区二区三区在线观看| 欧美一区二区三区四区视频| 亚洲精品菠萝久久久久久久| 国产成人啪免费观看软件 | 国产性色一区二区| 日韩 欧美一区二区三区| 欧洲中文字幕精品| 亚洲视频免费看| 成人免费视频播放| 国产日韩在线不卡| 国产一区二区三区在线看麻豆| 69p69国产精品| 亚洲一区在线视频| 91精彩视频在线观看| 亚洲欧美日韩国产中文在线| 国产iv一区二区三区| 精品成人一区二区三区| 久久精品国产亚洲一区二区三区| 欧美亚洲国产一区二区三区va | 成人一道本在线| 久久久亚洲精品石原莉奈| 蜜乳av一区二区三区| 正在播放一区二区| 日本在线不卡视频| 91精品国产综合久久久蜜臀粉嫩 | 91激情五月电影| 夜夜嗨av一区二区三区中文字幕 | 经典一区二区三区| 欧美电影免费观看高清完整版在线| 日韩高清欧美激情| 欧美一区二区三区白人 | 91电影在线观看| 亚洲一区二区三区四区五区中文| 91日韩一区二区三区| 一区二区三区四区乱视频| 91高清视频免费看| 亚洲成人先锋电影| 欧美丰满美乳xxx高潮www| 日日夜夜免费精品视频| 欧美电影免费观看高清完整版 | 亚洲午夜久久久久久久久电影网 | 91激情五月电影| 亚洲香肠在线观看| 欧美一卡二卡三卡四卡| 狠狠色狠狠色综合| 中文字幕电影一区| 91麻豆国产精品久久| 亚洲h在线观看| 日韩精品中文字幕一区二区三区| 精品一区二区三区在线观看 | 亚洲精品国产成人久久av盗摄| 在线观看日韩国产| 免费亚洲电影在线| 国产日本一区二区| 91免费观看国产| 日韩 欧美一区二区三区| 久久亚洲免费视频| 99久久99久久综合| 亚洲成av人片一区二区| 精品成人免费观看| av影院午夜一区| 午夜精品久久久久影视| 日韩精品中午字幕| 99精品欧美一区二区三区综合在线| 一区二区免费在线播放| 日韩亚洲欧美在线观看| 国产不卡视频在线观看| 亚洲一区二区在线免费看| 欧美一二三四区在线| 粉嫩一区二区三区性色av| 亚洲图片欧美激情| 日韩一区二区三区四区五区六区 | 日韩一级片网址| 成人av影视在线观看| 亚洲va欧美va人人爽午夜| 国产亚洲精品福利| 欧美影院精品一区| 国产一区二区伦理片| 亚洲国产日韩一级| 中文一区二区在线观看| 3d成人h动漫网站入口| 国产91对白在线观看九色| 亚洲尤物视频在线| 中文字幕乱码日本亚洲一区二区| 欧美性生活一区| 国产成人免费高清| 午夜视黄欧洲亚洲| 国产精品国产自产拍在线| 日韩一区二区精品| 91丨九色丨蝌蚪丨老版| 国产真实精品久久二三区| 亚洲综合在线五月| 国产日韩综合av| 欧美草草影院在线视频| 91激情在线视频| 99麻豆久久久国产精品免费| 久久99精品国产91久久来源| 亚洲夂夂婷婷色拍ww47| 国产精品成人一区二区艾草 |