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

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

?? port.c

?? STM32 FreeRTOS v5.2移植源代碼
?? 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一区二区三区免费野_久草精品视频
91黄视频在线| 成人av在线播放网站| 久久成人免费电影| 欧美综合在线视频| 国产色一区二区| 蜜臀av性久久久久蜜臀av麻豆| 欧美精品粉嫩高潮一区二区| 久久久99精品久久| 亚洲va国产va欧美va观看| 粉嫩13p一区二区三区| 91精品国产色综合久久不卡蜜臀| 国产精品久久久久久久岛一牛影视| 亚洲成人激情av| 99精品欧美一区| 国产亚洲欧美日韩在线一区| 亚洲成人免费视| 91色九色蝌蚪| 国产精品毛片a∨一区二区三区| 日韩中文字幕91| 欧美自拍偷拍一区| 中文字幕一区二区三| 国产呦精品一区二区三区网站| 欧美日韩亚洲综合| 亚洲伦在线观看| 成人av手机在线观看| 337p日本欧洲亚洲大胆精品| 图片区小说区国产精品视频| 91丨九色丨国产丨porny| 欧美国产日韩一二三区| 国产永久精品大片wwwapp| 欧美电影影音先锋| 性欧美大战久久久久久久久| 91黄视频在线观看| 一区二区成人在线| 色综合久久综合网| 中文字幕一区二区三区在线播放| 国产aⅴ精品一区二区三区色成熟| 精品美女被调教视频大全网站| 三级欧美在线一区| 6080国产精品一区二区| 一区二区三区在线视频播放| 99久久99久久久精品齐齐| 国产精品的网站| 波多野结衣欧美| 国产精品白丝在线| 91丨porny丨户外露出| 亚洲你懂的在线视频| 欧美在线free| 国产成人精品免费看| 久久精品视频免费| www.亚洲激情.com| 一区二区三区四区五区视频在线观看| 日本丰满少妇一区二区三区| 一区二区三区在线高清| 777久久久精品| 久久99精品网久久| 亚洲国产精品传媒在线观看| 91丨porny丨国产| 午夜精品123| 欧美精品一区在线观看| 成人精品国产福利| 亚洲国产综合人成综合网站| 欧美电影免费提供在线观看| 高清在线观看日韩| 亚洲一区二区高清| 精品福利视频一区二区三区| 国产98色在线|日韩| 亚洲一区二区视频在线观看| 欧美一级夜夜爽| 成人激情综合网站| 热久久久久久久| 国产精品无码永久免费888| 在线免费观看日本一区| 精品制服美女久久| 一区二区在线观看不卡| 欧美成人vr18sexvr| 9久草视频在线视频精品| 三级在线观看一区二区| 国产精品久久久久久久蜜臀 | 日韩精品影音先锋| 成人在线一区二区三区| 亚洲成av人片在线观看| 国产日韩av一区二区| 欧美女孩性生活视频| 成人精品国产一区二区4080| 免费观看一级欧美片| 国产精品区一区二区三区| 91精品免费在线观看| 成人黄色777网| 韩国视频一区二区| 性久久久久久久久久久久| 国产精品久久久一区麻豆最新章节| 欧美精品色综合| 99久久精品情趣| 国产精品羞羞答答xxdd| 午夜a成v人精品| 一区二区三区影院| 国产精品私人自拍| 久久人人爽爽爽人久久久| 欧美精品久久久久久久多人混战| caoporn国产一区二区| 国产一区二区三区免费播放| 日韩一区精品字幕| 亚洲sss视频在线视频| 亚洲精品国产成人久久av盗摄| 久久婷婷色综合| 欧美一级日韩一级| 精品污污网站免费看| 在线观看免费视频综合| 色综合中文字幕| 99久久国产综合精品色伊| 成人av在线播放网址| 成人免费毛片片v| 国产精品77777竹菊影视小说| 美女视频免费一区| 久久精品国产亚洲aⅴ| 亚洲成av人片在线观看| 一区二区三区不卡视频| 中文字幕一区在线观看视频| 国产精品欧美一级免费| 日本一区二区在线不卡| 国产精品欧美一区喷水| 国产精品久久毛片av大全日韩| 中文字幕精品一区二区三区精品| 国产丝袜欧美中文另类| 中文字幕欧美激情| 亚洲欧洲成人自拍| 亚洲激情图片qvod| 亚洲一二三四久久| 午夜久久久久久| 蜜臀久久久99精品久久久久久| 免费av成人在线| 国产做a爰片久久毛片| 国产成人在线视频网站| 成人涩涩免费视频| 91久久精品一区二区二区| 欧美午夜电影网| 日韩一区二区免费视频| 亚洲精品在线电影| 国产日韩欧美综合在线| 中文字幕在线观看一区| 一区二区三区欧美在线观看| 视频精品一区二区| 国产精品自在欧美一区| 99视频一区二区三区| 欧美视频在线一区二区三区| 欧美一激情一区二区三区| 国产亚洲精品资源在线26u| 国产精品国产三级国产aⅴ原创| 亚洲午夜国产一区99re久久| 久久精品国产精品亚洲精品| 成人夜色视频网站在线观看| 欧美亚一区二区| 欧美大白屁股肥臀xxxxxx| 欧美国产日韩a欧美在线观看| 一区二区高清在线| 国产一区二区三区高清播放| 色噜噜狠狠色综合中国| 欧美成人精精品一区二区频| 日韩中文字幕av电影| 国产在线播放一区| 欧美视频在线一区二区三区| 26uuu久久综合| 亚洲一区视频在线| 国产精品一区二区三区四区| 欧美伊人精品成人久久综合97| 日韩一区二区在线看片| 亚洲精品日韩综合观看成人91| 精品一区二区av| 欧美亚洲一区二区在线观看| 久久久五月婷婷| 日韩精品一级中文字幕精品视频免费观看| 国产成人自拍网| 91精品国产91久久综合桃花| 亚洲免费在线看| 国产精品1区二区.| 日韩欧美久久一区| 亚洲高清视频中文字幕| 99久久国产综合精品色伊| 久久天堂av综合合色蜜桃网| 婷婷综合五月天| 在线亚洲欧美专区二区| 国产日韩欧美精品综合| 久99久精品视频免费观看| 欧美私人免费视频| 日韩理论片网站| 国产成人av福利| 久久综合av免费| 蜜桃视频在线观看一区| 欧美日韩一区久久| 亚洲黄色尤物视频| 91小视频在线免费看| 国产精品久久久久久久久免费桃花 | 欧美精品在线视频| 亚洲综合小说图片| 日本韩国精品一区二区在线观看| 国产午夜精品福利| 国产99精品视频| 国产精品色在线| av不卡免费在线观看|