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

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

?? port.c

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

/* 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一区二区三区免费野_久草精品视频
国产精品丝袜一区| 蜜臀久久久99精品久久久久久| 国产福利一区在线| 亚洲精品一区二区三区蜜桃下载 | 一区二区三区在线视频免费| 91一区二区在线| 一区二区三区四区亚洲| 欧美影视一区在线| 美女精品一区二区| 久久免费精品国产久精品久久久久| 国产福利精品导航| 日韩理论片网站| 欧美精品一卡二卡| 国产成人免费xxxxxxxx| 日韩美女视频一区| 91精品国产综合久久福利| 国产一区二区在线影院| 国产精品看片你懂得| 欧美午夜在线观看| 国产又黄又大久久| 亚洲美女精品一区| 日韩亚洲欧美一区| 国产成人精品一区二| 亚洲国产精品自拍| 国产色产综合色产在线视频| 一本久久综合亚洲鲁鲁五月天| 亚洲妇女屁股眼交7| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美日精品一区视频| 精品一区二区在线免费观看| 亚洲精品一卡二卡| 日韩免费视频一区二区| www.欧美精品一二区| 午夜欧美大尺度福利影院在线看| 久久久99久久| 欧美日本在线观看| a级精品国产片在线观看| 视频一区二区欧美| 中文字幕一区二区在线播放| 欧美一区二区三区四区久久| 99综合影院在线| 美国av一区二区| 亚洲午夜在线视频| 国产精品不卡在线| 欧美精品一区二区久久婷婷| 精品视频一区二区不卡| 成人免费毛片aaaaa**| 蜜桃视频免费观看一区| 亚洲成人www| 亚洲视频小说图片| 久久精品一二三| 日韩欧美专区在线| 欧洲激情一区二区| 成人午夜视频在线| 国产又粗又猛又爽又黄91精品| 日韩激情一二三区| 亚洲一区自拍偷拍| 最新高清无码专区| 国产精品全国免费观看高清 | 国产精品乱码一区二区三区软件 | www.66久久| 五月婷婷欧美视频| 亚洲综合成人在线视频| 国产精品美女久久久久久久久 | 中文字幕不卡在线| 日韩三级视频在线看| 555夜色666亚洲国产免| 欧美亚洲免费在线一区| 91免费视频网址| 99国产精品一区| 91美女在线看| 成人aaaa免费全部观看| 4438x成人网最大色成网站| 欧美日精品一区视频| 欧美在线free| 欧美视频一区在线| 色爱区综合激月婷婷| 在线视频观看一区| 在线精品国精品国产尤物884a| 色婷婷综合在线| 91小视频在线| 欧美性生活影院| 欧美无乱码久久久免费午夜一区| 久久久久久久久免费| 国产精品毛片大码女人| 国产日韩欧美不卡| 中文字幕精品综合| 国产精品久久久久久久久晋中 | 日韩欧美亚洲一区二区| 日韩一区二区三区免费看 | 99久久精品国产麻豆演员表| 高清国产一区二区| av毛片久久久久**hd| 一本大道久久a久久综合| 日本丶国产丶欧美色综合| 欧美在线观看一二区| 欧美日韩精品三区| 精品美女一区二区三区| 国产日韩欧美综合在线| 亚洲人亚洲人成电影网站色| 亚洲一区中文日韩| 麻豆精品新av中文字幕| 国产不卡视频一区二区三区| 91亚洲精品久久久蜜桃网站| 欧洲一区二区av| 日韩精品一区二区三区中文不卡| 久久久久久久久久久久久久久99| 国产精品美女久久久久久久久| 亚洲一区在线观看免费| 激情深爱一区二区| 99亚偷拍自图区亚洲| 欧美日韩在线电影| 26uuu国产电影一区二区| 国产精品成人在线观看| 日本成人超碰在线观看| 国产高清亚洲一区| 欧美三级视频在线观看| 国产亚洲精品福利| 亚洲国产裸拍裸体视频在线观看乱了 | 欧美日韩在线免费视频| 精品国产91乱码一区二区三区| 中文字幕在线视频一区| 亚洲成av人影院在线观看网| 国产成人精品综合在线观看 | 精品综合免费视频观看| 色综合天天做天天爱| 欧美一区二区三区日韩| 国产精品美女久久久久久久| 日韩电影免费在线观看网站| av亚洲精华国产精华精华| 欧美一区二区三区在| 亚洲视频免费观看| 精品一区二区三区日韩| 欧美日韩中文字幕一区二区| 国产午夜三级一区二区三| 亚洲第一福利一区| www.综合网.com| 欧美精品一区二区久久婷婷| 午夜精品福利一区二区蜜股av| 夜夜嗨av一区二区三区四季av | 欧美成人一区二区| 亚洲伦理在线精品| 国产福利电影一区二区三区| 欧美一区在线视频| 欧美电影免费观看高清完整版在线 | 麻豆视频一区二区| 欧美三级三级三级| 亚洲精品你懂的| 成人国产视频在线观看| 久久久精品tv| 韩国一区二区视频| 欧美一区二区在线观看| 亚洲精品高清在线观看| av在线这里只有精品| 国产日产欧美一区二区三区| 精品在线观看视频| 日韩一区二区三区视频在线观看| 亚洲国产精品一区二区久久| 91色九色蝌蚪| 亚洲丝袜制服诱惑| av高清久久久| 亚洲激情av在线| 色欧美乱欧美15图片| 国产精品美女www爽爽爽| 国产福利91精品一区二区三区| 2023国产精品视频| 狠狠色狠狠色综合日日91app| 欧美一区二区免费观在线| 日韩国产高清在线| 欧美一级高清大全免费观看| 男女男精品视频| 精品国产乱码久久久久久免费| 裸体健美xxxx欧美裸体表演| 欧美日韩的一区二区| 视频一区二区不卡| 日韩一级成人av| 国产精品456露脸| 欧美激情一区二区三区蜜桃视频| 成人手机电影网| 亚洲三级免费电影| 欧美优质美女网站| 日日摸夜夜添夜夜添精品视频 | 日韩精品成人一区二区三区| 日韩精品一区国产麻豆| 狠狠久久亚洲欧美| 亚洲国产精品精华液ab| 成人18视频日本| 亚洲综合成人网| 91精品国产色综合久久| 九色综合狠狠综合久久| 日本一区二区三区免费乱视频| 成人午夜伦理影院| 亚洲综合偷拍欧美一区色| 在线播放中文一区| 国产在线国偷精品产拍免费yy| 日韩一区欧美小说| 欧美日韩精品欧美日韩精品| 精品在线播放午夜| 亚洲久草在线视频| 日韩欧美色综合|