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

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

?? port.c

?? FreeRTOSV3.2.0 經典嵌入式操作系統
?? C
字號:
/*
	FreeRTOS V3.2.0 - Copyright (C) 2003 - 2005 Richard Barry.

	This file is part of the FreeRTOS distribution.

	FreeRTOS 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 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; 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, 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.
	***************************************************************************
*/

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


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


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

/* When the task starts interrupts should be enabled. */
#define portINITIAL_CCR			( ( portSTACK_TYPE ) 0x00 )

/* Hardware specific constants used to generate the RTOS tick from the TPU. */
#define portCLEAR_ON_TGRA_COMPARE_MATCH ( ( unsigned portCHAR ) 0x20 )
#define portCLOCK_DIV_64				( ( unsigned portCHAR ) 0x03 )
#define portCLOCK_DIV					( ( unsigned portLONG ) 64 )
#define portTGRA_INTERRUPT_ENABLE		( ( unsigned portCHAR ) 0x01 )
#define portTIMER_CHANNEL				( ( unsigned portCHAR ) 0x02 )
#define portMSTP13						( ( unsigned portSHORT ) 0x2000 )

/*
 * Setup TPU channel one for the RTOS tick at the requested frequency.
 */
static void prvSetupTimerInterrupt( void );

/*
 * The ISR used by portYIELD(). This is installed as a trap handler.
 */
void vPortYield( void ) __attribute__ ( ( saveall, interrupt_handler ) );

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

/* 
 * See header file for description. 
 */
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
unsigned portSHORT usAddress;
unsigned portLONG ulValue;

	/* This requires an even address. */
	ulValue = ( unsigned portLONG ) pxTopOfStack;
	if( ulValue & 1UL )
	{
		pxTopOfStack = pxTopOfStack - 1;
	}

	/* Place a few bytes of known values on the bottom of the stack. 
	This is just useful for debugging. */
	pxTopOfStack--;
	*pxTopOfStack = 0xaa;
	pxTopOfStack--;
	*pxTopOfStack = 0xbb;
	pxTopOfStack--;
	*pxTopOfStack = 0xcc;
	pxTopOfStack--;
	*pxTopOfStack = 0xdd;

	/* The initial stack mimics an interrupt stack.  First there is the program
	counter (24 bits). */
	ulValue = ( unsigned portLONG ) pxCode;

	pxTopOfStack--;
	*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
	pxTopOfStack--;
	ulValue >>= 8UL;
	*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
	pxTopOfStack--;
	ulValue >>= 8UL;
	*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );

	/* Followed by the CCR. */	
	pxTopOfStack--;
	*pxTopOfStack = portINITIAL_CCR;

	/* Next all the general purpose registers - with the parameters being passed
	in ER0.  The parameter order must match that used by the compiler when the
	"saveall" function attribute is used. */

	/* ER6 */
	pxTopOfStack--;
	*pxTopOfStack = 0x66;
	pxTopOfStack--;
	*pxTopOfStack = 0x66;
	pxTopOfStack--;
	*pxTopOfStack = 0x66;
	pxTopOfStack--;
	*pxTopOfStack = 0x66;
	
	/* ER0 */
	ulValue = ( unsigned portLONG ) pvParameters;

	pxTopOfStack--;
	*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
	pxTopOfStack--;
	ulValue >>= 8UL;
	*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
	pxTopOfStack--;
	ulValue >>= 8UL;
	*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
	pxTopOfStack--;
	ulValue >>= 8UL;
	*pxTopOfStack = ( portSTACK_TYPE ) ( ulValue & 0xff );
	
	/* ER1 */
	pxTopOfStack--;
	*pxTopOfStack = 0x11;
	pxTopOfStack--;
	*pxTopOfStack = 0x11;
	pxTopOfStack--;
	*pxTopOfStack = 0x11;
	pxTopOfStack--;
	*pxTopOfStack = 0x11;

	/* ER2 */
	pxTopOfStack--;
	*pxTopOfStack = 0x22;
	pxTopOfStack--;
	*pxTopOfStack = 0x22;
	pxTopOfStack--;
	*pxTopOfStack = 0x22;
	pxTopOfStack--;
	*pxTopOfStack = 0x22;

	/* ER3 */
	pxTopOfStack--;
	*pxTopOfStack = 0x33;
	pxTopOfStack--;
	*pxTopOfStack = 0x33;
	pxTopOfStack--;
	*pxTopOfStack = 0x33;
	pxTopOfStack--;
	*pxTopOfStack = 0x33;

	/* ER4 */
	pxTopOfStack--;
	*pxTopOfStack = 0x44;
	pxTopOfStack--;
	*pxTopOfStack = 0x44;
	pxTopOfStack--;
	*pxTopOfStack = 0x44;
	pxTopOfStack--;
	*pxTopOfStack = 0x44;

	/* ER5 */
	pxTopOfStack--;
	*pxTopOfStack = 0x55;
	pxTopOfStack--;
	*pxTopOfStack = 0x55;
	pxTopOfStack--;
	*pxTopOfStack = 0x55;
	pxTopOfStack--;
	*pxTopOfStack = 0x55;

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

portBASE_TYPE xPortStartScheduler( void )
{
extern void * pxCurrentTCB;

	/* Setup the hardware to generate the tick. */
	prvSetupTimerInterrupt();

	/* Restore the context of the first task that is going to run.  This
	mirrors the function epilogue code generated by the compiler when the
	"saveall" function attribute is used. */
	asm volatile ( "MOV.L		@_pxCurrentTCB, ER6"	);
	asm volatile ( "MOV.L		@ER6, ER7"				);
	asm volatile ( "LDM.L     	@SP+, (ER4-ER5)"		);
	asm volatile ( "LDM.L     	@SP+, (ER0-ER3)"		);
	asm volatile ( "MOV.L     	@ER7+, ER6"				);
	asm volatile ( "RTE"								);

	/* Should not get here. */
	return pdTRUE;
}
/*-----------------------------------------------------------*/

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

/*
 * Manual context switch.  This is a trap handler.  The "saveall" function
 * attribute is used so the context is saved by the compiler prologue.  All
 * we have to do is save the stack pointer.
 */
void vPortYield( void )
{
	portSAVE_STACK_POINTER();
		vTaskSwitchContext();
	portRESTORE_STACK_POINTER();
}
/*-----------------------------------------------------------*/

/* 
 * The interrupt handler installed for the RTOS tick depends on whether the 
 * preemptive or cooperative scheduler is being used. 
 */
#if( configUSE_PREEMPTION == 1 )

	/* 
	 * The preemptive scheduler is used so the ISR calls vTaskSwitchContext().
	 * The function prologue saves the context so all we have to do is save
	 * the stack pointer.
	 */
	void vTickISR( void ) __attribute__ ( ( saveall, interrupt_handler ) );
	void vTickISR( void )
	{
		portSAVE_STACK_POINTER();
		
		vTaskIncrementTick();
		vTaskSwitchContext();

		/* Clear the interrupt. */
		TSR1 &= ~0x01;

		portRESTORE_STACK_POINTER();
	}

#else

	/*
	 * The cooperative scheduler is being used so all we have to do is 
	 * periodically increment the tick.  This can just be a normal ISR and
	 * the "saveall" attribute is not required.
	 */
	void vTickISR( void ) __attribute__ ( ( interrupt_handler ) );
	void vTickISR( void )
	{
		vTaskIncrementTick();

		/* Clear the interrupt. */
		TSR1 &= ~0x01;
	}

#endif
/*-----------------------------------------------------------*/

/*
 * Setup timer 1 compare match to generate a tick interrupt.
 */
static void prvSetupTimerInterrupt( void )
{
const unsigned portLONG ulCompareMatch = ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) / portCLOCK_DIV;

	/* Turn the module on. */
	MSTPCR &= ~portMSTP13;

	/* Configure timer 1. */
	TCR1 = portCLEAR_ON_TGRA_COMPARE_MATCH | portCLOCK_DIV_64;

	/* Configure the compare match value for a tick of configTICK_RATE_HZ. */
	TGR1A = ulCompareMatch;

	/* Start the timer and enable the interrupt - we can do this here as 
	interrupts are globally disabled when this function is called. */
	TIER1 |= portTGRA_INTERRUPT_ENABLE;
	TSTR |= portTIMER_CHANNEL;
}
/*-----------------------------------------------------------*/



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区四区| 亚洲欧洲av色图| 在线视频一区二区免费| 成人午夜av影视| 波多野结衣中文字幕一区二区三区| 狠狠色丁香久久婷婷综| 麻豆一区二区99久久久久| 日本sm残虐另类| 美女一区二区久久| 国产精品一区二区视频| 亚洲成人av一区二区三区| 日韩在线卡一卡二| 欧美亚洲国产一区二区三区va| 国产日韩av一区| 精品一区二区三区影院在线午夜| 欧美伊人精品成人久久综合97| 国产精品无人区| 国产成人综合精品三级| 欧美xxxx老人做受| 日韩电影在线免费观看| 欧美性猛片aaaaaaa做受| 综合亚洲深深色噜噜狠狠网站| 国产麻豆欧美日韩一区| 精品久久五月天| 久久66热偷产精品| 日韩欧美国产系列| 日韩1区2区3区| 3d成人动漫网站| 成人午夜免费电影| 久久精品夜夜夜夜久久| 激情图片小说一区| 精品国产一二三| 久久99久久久欧美国产| 精品久久人人做人人爽| 国内精品写真在线观看| 久久免费午夜影院| 国产成人精品影视| 国产精品二三区| 91麻豆国产香蕉久久精品| 最新久久zyz资源站| 99re视频这里只有精品| 一区二区三区欧美亚洲| 欧美日韩一卡二卡三卡| 日本特黄久久久高潮| 欧美videofree性高清杂交| 国内国产精品久久| 国产精品免费av| 色呦呦一区二区三区| 亚洲高清视频中文字幕| 日韩一级片在线播放| 国产精品1区2区| 亚洲欧美日韩综合aⅴ视频| 欧美性猛片aaaaaaa做受| 免费一级欧美片在线观看| 久久蜜桃一区二区| av一二三不卡影片| 亚洲成人av中文| 久久久亚洲高清| av电影在线不卡| 日一区二区三区| 国产日韩精品一区二区三区在线| 99久久综合狠狠综合久久| 亚洲国产一二三| 2021中文字幕一区亚洲| 99精品国产视频| 美女一区二区视频| 亚洲日本va在线观看| 91麻豆精品国产91久久久资源速度 | 国产欧美日韩视频一区二区| 成人av午夜电影| 日日欢夜夜爽一区| 中文字幕免费不卡在线| 欧美日韩美女一区二区| 国产精品综合av一区二区国产馆| 亚洲精品一二三| 久久久久久99久久久精品网站| 91福利资源站| 国产91在线|亚洲| 日韩经典中文字幕一区| 亚洲欧洲99久久| 久久婷婷国产综合精品青草| 在线观看成人小视频| 国产精品一区2区| 奇米四色…亚洲| 亚洲综合色在线| 亚洲欧美综合另类在线卡通| 日韩精品中文字幕在线不卡尤物 | 麻豆精品在线播放| 亚洲综合清纯丝袜自拍| 中文乱码免费一区二区| 欧美成人在线直播| 欧美视频一区二区三区四区| 成人中文字幕合集| 久久草av在线| 日本sm残虐另类| 五月天激情综合网| 亚洲制服丝袜av| 亚洲人快播电影网| 国产精品色眯眯| 日本一区二区三区电影| 欧美精品一区二区高清在线观看| 欧美经典一区二区三区| 欧美一区二区三区四区五区 | 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国产尤物一区二区在线| 日韩主播视频在线| 亚洲成a人片在线不卡一二三区| √…a在线天堂一区| 国产精品国产a| 久久美女艺术照精彩视频福利播放| 欧美一级艳片视频免费观看| 欧美人动与zoxxxx乱| 欧美日韩一区二区三区在线看| 91无套直看片红桃| 色综合久久综合| 欧美亚洲禁片免费| 欧美精品久久99| 欧美一区二区精品| 日韩欧美一级二级三级久久久| 日韩一级完整毛片| 337p粉嫩大胆色噜噜噜噜亚洲 | 日本丰满少妇一区二区三区| 99精品国产一区二区三区不卡| 97久久精品人人做人人爽50路 | 国产精品99久久久久久似苏梦涵| 久久66热偷产精品| 国产精品一区二区91| 成人动漫一区二区三区| 99精品欧美一区二区三区综合在线| 99精品偷自拍| 精品视频一区 二区 三区| 欧美一区二区三区在线视频| 欧美成人video| 日本一区免费视频| 亚洲综合久久av| 美腿丝袜亚洲一区| 成人久久视频在线观看| 91丨porny丨国产| 欧美精品 日韩| 国产清纯在线一区二区www| ...av二区三区久久精品| 三级在线观看一区二区| 狠狠色丁香婷婷综合久久片| 高清日韩电视剧大全免费| 91在线国内视频| 91精品国模一区二区三区| 久久丝袜美腿综合| 一区二区三区四区中文字幕| 视频一区欧美精品| 高清不卡一二三区| 欧美高清激情brazzers| 国产日韩欧美制服另类| 亚州成人在线电影| 成人性生交大合| 欧美一区二区三区视频免费播放| 中文字幕精品在线不卡| 婷婷六月综合亚洲| av中文字幕不卡| 国产精品色眯眯| 日本一道高清亚洲日美韩| 成人激情校园春色| 777xxx欧美| 亚洲欧美日本在线| 国产激情一区二区三区| 555www色欧美视频| 亚洲精品老司机| 国产成人精品一区二区三区四区| 91麻豆精品91久久久久同性| 国产精品久久久久影院色老大| 青青草国产精品亚洲专区无| 91在线观看一区二区| 亚洲精品一区二区三区四区高清| 亚洲一区二区精品久久av| 国产成人精品www牛牛影视| 在线成人av影院| 一区二区在线观看av| 成人av资源下载| 久久综合网色—综合色88| 日韩中文字幕不卡| 欧美亚洲一区二区三区四区| 国产亚洲一区二区三区四区| 男人的天堂亚洲一区| 欧美午夜视频网站| 亚洲免费观看在线观看| av色综合久久天堂av综合| 久久久久久9999| 精品中文字幕一区二区| 91精品国产aⅴ一区二区| 亚洲国产欧美日韩另类综合| 99久久婷婷国产综合精品电影 | 国产精品免费av| 国产成人精品影院| 国产视频视频一区| 国产一区二区三区久久悠悠色av| 欧美一激情一区二区三区| 午夜精品福利久久久| 欧美久久一区二区| 日本欧美久久久久免费播放网| 欧美久久婷婷综合色| 国产成人免费网站|