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

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

?? port.c

?? 最新版FreeRTOS, 包擴多種開發平臺的移植
?? C
字號:
/* 
	FreeRTOS.org V4.1.1 - 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一区二区三区免费野_久草精品视频
国产一区二区视频在线| 精品一区二区三区欧美| 国产亚洲女人久久久久毛片| 欧美成人vps| 欧美成人精精品一区二区频| 9191国产精品| 日韩一区二区三区视频在线| 日韩精品一区二区三区在线观看| 欧美性受xxxx| 欧美一级黄色大片| 日韩欧美中文一区| 国产亚洲成年网址在线观看| 国产欧美日韩三级| 亚洲乱码一区二区三区在线观看| 亚洲激情在线播放| 午夜电影网一区| 久久69国产一区二区蜜臀| 国产一二三精品| 成人黄色综合网站| 欧美日韩日日骚| 4438x亚洲最大成人网| 欧美zozozo| 国产精品欧美久久久久无广告| 中文字幕一区二区三区四区不卡 | 99免费精品在线观看| 91亚洲永久精品| 欧美日韩一区二区在线观看| 欧美一区二区在线不卡| 国产丝袜在线精品| 亚洲小说春色综合另类电影| 日本vs亚洲vs韩国一区三区二区| 国产成人在线视频播放| 色94色欧美sute亚洲线路二| 精品成人在线观看| 依依成人精品视频| 九九精品视频在线看| 91小宝寻花一区二区三区| 日韩免费性生活视频播放| 国产精品水嫩水嫩| 日本女人一区二区三区| 不卡电影一区二区三区| 日韩欧美综合在线| 一区二区三区久久| 成人午夜免费av| 欧美一区二区三区人| √…a在线天堂一区| 精品一区二区三区在线播放视频| 色哟哟精品一区| 久久久久国产免费免费| 日韩成人精品在线观看| 色狠狠综合天天综合综合| 2023国产精品| 免费看黄色91| 欧美日韩黄视频| 国产精品对白交换视频| 国产一区二三区| 欧美一级片在线看| 一区二区三区在线视频观看 | 成人精品国产免费网站| 91精品国产一区二区三区| 亚洲视频在线观看一区| 国产酒店精品激情| 精品国产a毛片| 日本欧美在线看| 欧美日本在线视频| 亚洲五月六月丁香激情| 91视频国产资源| 中文字幕亚洲一区二区av在线| 黄色精品一二区| 亚洲精品一区二区三区精华液| 日本中文字幕一区二区有限公司| 91国产成人在线| 依依成人综合视频| 欧美天堂一区二区三区| 亚洲一区在线观看免费观看电影高清| av电影在线观看完整版一区二区| 久久久久久久综合日本| 国产精品 欧美精品| 中文字幕欧美国产| 不卡一区二区中文字幕| 国产精品天干天干在线综合| 国产精品18久久久久久久久久久久 | 成人综合婷婷国产精品久久| www亚洲一区| 成人精品gif动图一区| 欧美激情一区在线| 色综合久久综合网| 亚洲地区一二三色| 日韩一区二区在线免费观看| 美女国产一区二区三区| 久久久久久电影| 99精品久久免费看蜜臀剧情介绍| 亚洲欧美韩国综合色| 欧美男生操女生| 国产美女在线精品| 亚洲欧美综合色| 欧美日韩国产成人在线免费| 麻豆极品一区二区三区| 中文在线免费一区三区高中清不卡| 成人黄色国产精品网站大全在线免费观看 | 中文一区二区完整视频在线观看| 成人av电影免费在线播放| 亚洲一区视频在线| 久久综合九色综合97_久久久| 国产成人免费9x9x人网站视频| 亚洲三级在线免费观看| 欧美老女人第四色| 国产91在线|亚洲| 亚洲成人免费在线观看| 欧美高清在线精品一区| 欧美色爱综合网| 国产麻豆视频一区二区| 亚洲一区二区三区自拍| 国产亚洲欧美色| 777午夜精品视频在线播放| 高清日韩电视剧大全免费| 夜夜揉揉日日人人青青一国产精品| 日韩欧美另类在线| 欧洲视频一区二区| 国产91对白在线观看九色| 亚洲精品成人a在线观看| 国产丝袜欧美中文另类| 欧美一区二区精品在线| 91免费国产在线| 国产电影一区在线| 裸体一区二区三区| 亚洲成人久久影院| 亚洲女同ⅹxx女同tv| 日本一区二区三区在线观看| 欧美一区二区三区在线观看视频| 91丨九色丨尤物| 国产成人8x视频一区二区| 久久国产乱子精品免费女| 亚洲一区二区偷拍精品| 亚洲欧美在线观看| 日本一区二区三级电影在线观看| 日韩网站在线看片你懂的| 欧美午夜精品免费| 色悠久久久久综合欧美99| 国产91精品一区二区麻豆亚洲| 久热成人在线视频| 日韩高清电影一区| 午夜电影一区二区| 亚洲一区精品在线| 亚洲精品乱码久久久久久黑人 | 在线观看区一区二| 92精品国产成人观看免费| 粉嫩av一区二区三区粉嫩| 蜜桃精品视频在线| 蜜臀精品久久久久久蜜臀| 亚洲成av人片在线| 午夜精品免费在线观看| 亚洲图片有声小说| 亚洲成a人片在线观看中文| 亚洲线精品一区二区三区| 亚洲老妇xxxxxx| 亚洲影视在线播放| 午夜精品一区在线观看| 天天亚洲美女在线视频| 日韩精品一卡二卡三卡四卡无卡 | 久久综合色8888| 日韩三级精品电影久久久| 日韩女优电影在线观看| 欧美大片在线观看一区二区| 日韩美女视频在线| 久久精品亚洲乱码伦伦中文| 日本一区二区三区四区| 亚洲三级在线看| 亚洲国产另类av| 另类欧美日韩国产在线| 国产综合成人久久大片91| 粉嫩高潮美女一区二区三区| 99视频一区二区| 欧美精品一二三| 精品卡一卡二卡三卡四在线| 久久噜噜亚洲综合| 亚洲人成网站色在线观看| 日韩av电影免费观看高清完整版在线观看| 美女一区二区久久| 国产成人av电影在线| 在线看国产一区| 日韩欧美在线1卡| 国产精品久久久久aaaa樱花| 亚洲高清免费在线| 国内久久精品视频| aaa亚洲精品一二三区| 7799精品视频| 国产精品久久久久影院亚瑟| 亚洲影院免费观看| 国产久卡久卡久卡久卡视频精品| 99视频在线观看一区三区| 91精品国产丝袜白色高跟鞋| 国产欧美日韩视频一区二区| 亚洲成人久久影院| 成人理论电影网| 91麻豆精品国产91久久久久久久久 | 欧美视频在线观看一区| 久久九九99视频| 日韩av中文在线观看| 99久久免费视频.com|