亚洲欧美第一页_禁久久精品乱码_粉嫩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.
*/

/* 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 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			\n\t"
					"MOV.L		@ER6, ER7					\n\t"
					"LDM.L     	@SP+, (ER4-ER5)				\n\t"
					"LDM.L     	@SP+, (ER0-ER3)				\n\t"
					"MOV.L     	@ER7+, ER6					\n\t"
					"RTE									\n\t"
				);

	( void ) pxCurrentTCB;

	/* 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一区二区在线影视| 宅男噜噜噜66一区二区66| 国产精品一二一区| 五月综合激情网| 亚洲色图视频网站| 久久一区二区三区四区| 欧美专区日韩专区| 成人av先锋影音| 美女视频黄久久| 丝袜脚交一区二区| 亚洲欧美日韩国产综合在线| 亚洲精品一区二区三区在线观看| 在线观看不卡一区| 97精品久久久午夜一区二区三区 | 免费成人av在线| 亚洲天堂成人在线观看| 久久久亚洲精华液精华液精华液| 欧美偷拍一区二区| 91免费国产在线观看| 国产老妇另类xxxxx| 日本成人在线不卡视频| 亚洲第一精品在线| 一区二区久久久| 亚洲女同一区二区| 中文字幕一区二区三区视频| 精品国产精品一区二区夜夜嗨| 91精品欧美福利在线观看| 91国产精品成人| 91香蕉视频黄| 91亚洲国产成人精品一区二区三| 国产精品99久| 国产麻豆视频一区| 国产精品一区二区在线播放| 麻豆成人免费电影| 免费人成精品欧美精品| 日韩va欧美va亚洲va久久| 三级欧美韩日大片在线看| 亚洲电影第三页| 天堂在线亚洲视频| 日韩精品欧美精品| 男人的天堂久久精品| 美女精品一区二区| 精品伊人久久久久7777人| 国内成人精品2018免费看| 狠狠色丁香久久婷婷综合_中| 久久99精品国产| 国产成人免费在线视频| 国产成人免费在线观看不卡| www.亚洲色图.com| 色婷婷精品大在线视频| 欧美综合视频在线观看| 欧美亚洲综合另类| 555夜色666亚洲国产免| 日韩免费在线观看| 久久久国际精品| 中文字幕亚洲在| 午夜在线电影亚洲一区| 免费在线看成人av| 国产精品888| 色欧美乱欧美15图片| 欧美精品日韩综合在线| 精品免费视频.| 中文字幕乱码久久午夜不卡| 亚洲综合激情网| 看片网站欧美日韩| 成人黄色一级视频| 欧美久久一二三四区| 精品国产网站在线观看| 国产日韩欧美精品在线| 一区二区三区在线视频免费观看| 香蕉成人啪国产精品视频综合网| 久久精品久久精品| gogo大胆日本视频一区| 欧美精品色一区二区三区| 久久久精品人体av艺术| 亚洲国产美女搞黄色| 久久99精品国产91久久来源| aaa欧美色吧激情视频| 欧美日本免费一区二区三区| 久久婷婷综合激情| 夜夜嗨av一区二区三区网页 | 91精品国产91久久久久久一区二区| 欧美一区二区三区白人| 国产精品福利一区二区三区| 亚洲成人资源网| 国产精品99久久不卡二区| 在线观看三级视频欧美| 久久久久久久久久久黄色| 亚洲黄色片在线观看| 激情av综合网| 欧美日韩在线播放一区| 国产欧美日本一区二区三区| 午夜国产精品影院在线观看| 国产成人综合自拍| 正在播放一区二区| 亚洲啪啪综合av一区二区三区| 日本中文一区二区三区| 91色九色蝌蚪| 国产天堂亚洲国产碰碰| 日日嗨av一区二区三区四区| av电影在线不卡| 精品国产第一区二区三区观看体验 | 国产不卡高清在线观看视频| 欧美日韩一区三区| 成人欧美一区二区三区小说| 精品一区二区三区在线观看| 欧美日韩视频在线第一区 | 色综合久久中文综合久久97| 欧美成人一区二区三区在线观看 | 经典三级视频一区| 欧美高清dvd| 一区二区三区日本| 99久久伊人久久99| 精品国产乱码久久久久久牛牛| 亚洲一二三四久久| 99国产精品久久久久久久久久| 精品国产自在久精品国产| 婷婷久久综合九色综合绿巨人| 色视频欧美一区二区三区| 国产精品久久久久久久久免费相片| 精品影院一区二区久久久| 欧美一区二区三区在线观看视频| 亚洲综合清纯丝袜自拍| 91首页免费视频| 亚洲欧洲日产国产综合网| 大胆欧美人体老妇| 欧美激情在线看| 国产成人av一区二区三区在线| 精品奇米国产一区二区三区| 免费成人美女在线观看| 日韩一区二区三区在线| 视频一区在线播放| 欧美精品在线视频| 日韩二区在线观看| 日韩精品中午字幕| 久久国产精品色婷婷| 欧美xxxx在线观看| 国产麻豆精品95视频| 国产日韩欧美精品电影三级在线 | 欧美高清一级片在线| 午夜电影网一区| 日韩欧美一区在线观看| 精品在线观看视频| 国产色产综合色产在线视频| 国产成人av电影在线播放| 欧美激情资源网| 99久久精品国产毛片| 亚洲一二三区视频在线观看| 91精品国产欧美一区二区18 | 自拍偷拍国产精品| 在线观看中文字幕不卡| 日韩国产欧美在线观看| 日韩欧美国产成人一区二区| 精品一区二区免费视频| 欧美激情综合网| 在线日韩一区二区| 午夜精品久久久久久| 精品国产三级a在线观看| 成人性生交大合| 亚洲精品欧美专区| 欧美一级在线视频| 国产不卡视频在线观看| 亚洲裸体在线观看| 91麻豆精品国产综合久久久久久| 裸体歌舞表演一区二区| 国产精品午夜在线| 欧美喷水一区二区| 久久草av在线| 亚洲日本护士毛茸茸| 欧美精品vⅰdeose4hd| 国产一区二区三区黄视频| 中文字幕亚洲欧美在线不卡| 欧美日韩免费视频| 国产夫妻精品视频| 亚洲高清视频在线| 国产亚洲人成网站| 91黄色免费看| 韩国欧美国产1区| 一区二区三区视频在线看| 精品国产免费视频| 91免费国产在线| 久久国产免费看| 亚洲一区电影777| 国产欧美一区二区在线| 欧美三级午夜理伦三级中视频| 国产在线视频精品一区| 亚洲超碰97人人做人人爱| 欧美经典一区二区| 日韩午夜在线观看视频| 99riav一区二区三区| 经典三级一区二区| 天天综合色天天综合| 国产精品久久夜| 精品精品国产高清a毛片牛牛| 色94色欧美sute亚洲13| 国产毛片精品国产一区二区三区| 午夜伊人狠狠久久| 亚洲欧美日韩人成在线播放| 久久精品一区二区三区不卡牛牛|