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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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.
*/

/* Standard includes. */
#include <stdlib.h>

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

/* The critical nesting value is initialised to a non zero value to ensure
interrupts don't accidentally become enabled before the scheduler is started. */
#define portINITIAL_CRITICAL_NESTING  (( unsigned portSHORT ) 10)

/* Initial PSW value allocated to a newly created task.
 *   1100011000000000
 *   ||||||||-------------- Fill byte
 *   |||||||--------------- Carry Flag cleared
 *   |||||----------------- In-service priority Flags set to low level
 *   ||||------------------ Register bank Select 0 Flag cleared
 *   |||------------------- Auxiliary Carry Flag cleared
 *   ||-------------------- Register bank Select 1 Flag cleared
 *   |--------------------- Zero Flag set
 *   ---------------------- Global Interrupt Flag set (enabled)
 */
#define portPSW		  (0xc6UL)

/* We require the address of the pxCurrentTCB variable, but don't want to know
any details of its type. */
typedef void tskTCB;
extern volatile tskTCB * volatile pxCurrentTCB;

/* Most ports implement critical sections by placing the interrupt flags on
the stack before disabling interrupts.  Exiting the critical section is then
simply a case of popping the flags from the stack.  As 78K0 IAR does not use
a frame pointer this cannot be done as modifying the stack will clobber all
the stack variables.  Instead each task maintains a count of the critical
section nesting depth.  Each time a critical section is entered the count is
incremented.  Each time a critical section is left the count is decremented -
with interrupts only being re-enabled if the count is zero.

usCriticalNesting will get set to zero when the scheduler starts, but must
not be initialised to zero as this will cause problems during the startup
sequence. */
volatile unsigned portSHORT usCriticalNesting = portINITIAL_CRITICAL_NESTING;
/*-----------------------------------------------------------*/

/*
 * Sets up the periodic ISR used for the RTOS tick.
 */
static void prvSetupTimerInterrupt( void );
/*-----------------------------------------------------------*/

/*
 * Initialise the stack of a task to look exactly as if a call to
 * portSAVE_CONTEXT had been called.
 *
 * See the header file portable.h.
 */
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
unsigned long *pulLocal;

	#if configMEMORY_MODE == 1
	{
		/* Parameters are passed in on the stack, and written using a 32bit value
		hence a space is left for the second two bytes. */
		pxTopOfStack--;

		/* Write in the parameter value. */
		pulLocal =  ( unsigned long * ) pxTopOfStack;
		*pulLocal = ( unsigned long ) pvParameters;
		pxTopOfStack--;

		/* These values are just spacers.  The return address of the function
		would normally be written here. */
		*pxTopOfStack = ( portSTACK_TYPE ) 0xcdcd;
		pxTopOfStack--;
		*pxTopOfStack = ( portSTACK_TYPE ) 0xcdcd;
		pxTopOfStack--;

		/* The start address / PSW value is also written in as a 32bit value,
		so leave a space for the second two bytes. */
		pxTopOfStack--;
	
		/* Task function start address combined with the PSW. */
		pulLocal = ( unsigned long * ) pxTopOfStack;
		*pulLocal = ( ( ( unsigned long ) pxCode ) | ( portPSW << 24UL ) );
		pxTopOfStack--;

		/* An initial value for the AX register. */
		*pxTopOfStack = ( portSTACK_TYPE ) 0x1111;
		pxTopOfStack--;
	}
	#else
	{
		/* Task function address is written to the stack first.  As it is
		written as a 32bit value a space is left on the stack for the second
		two bytes. */
		pxTopOfStack--;

		/* Task function start address combined with the PSW. */
		pulLocal = ( unsigned long * ) pxTopOfStack;
		*pulLocal = ( ( ( unsigned long ) pxCode ) | ( portPSW << 24UL ) );
		pxTopOfStack--;

		/* The parameter is passed in AX. */
		*pxTopOfStack = ( portSTACK_TYPE ) pvParameters;
		pxTopOfStack--;
	}
	#endif

	/* An initial value for the HL register. */
	*pxTopOfStack = ( portSTACK_TYPE ) 0x2222;
	pxTopOfStack--;

	/* CS and ES registers. */
	*pxTopOfStack = ( portSTACK_TYPE ) 0x0F00;
	pxTopOfStack--;

	/* Finally the remaining general purpose registers DE and BC */
	*pxTopOfStack = ( portSTACK_TYPE ) 0xDEDE;
	pxTopOfStack--;
	*pxTopOfStack = ( portSTACK_TYPE ) 0xBCBC;
	pxTopOfStack--;

	/* Finally the critical section nesting count is set to zero when the task
	first starts. */
	*pxTopOfStack = ( portSTACK_TYPE ) portNO_CRITICAL_SECTION_NESTING;	

	/* Return a pointer to the top of the stack we have generated so this can
	be stored in the task control block for the task. */
	return pxTopOfStack;
}
/*-----------------------------------------------------------*/

portBASE_TYPE xPortStartScheduler( void )
{
	/* Setup the hardware to generate the tick.  Interrupts are disabled when
	this function is called. */
	prvSetupTimerInterrupt();

	/* Restore the context of the first task that is going to run. */
	vPortStart();

	/* Should not get here as the tasks are now running! */
	return pdTRUE;
}
/*-----------------------------------------------------------*/

void vPortEndScheduler( void )
{
	/* It is unlikely that the 78K0R port will get stopped.  If required simply
	disable the tick interrupt here. */
}
/*-----------------------------------------------------------*/

static void prvSetupTimerInterrupt( void )
{
	/* Setup channel 5 of the TAU to generate the tick interrupt. */

	/* First the Timer Array Unit has to be enabled. */
	TAU0EN = 1;

	/* To configure the Timer Array Unit all Channels have to first be stopped. */
	TT0 = 0xff;

	/* Interrupt of Timer Array Unit Channel 5 is disabled to set the interrupt
	priority. */
	TMMK05 = 1;

	/* Clear Timer Array Unit Channel 5 interrupt flag. */	
	TMIF05 = 0;

	/* Set Timer Array Unit Channel 5 interrupt priority */
	TMPR005 = 0;
	TMPR105 = 0;

	/* Set Timer Array Unit Channel 5 Mode as interval timer. */
	TMR05 = 0x0000;

	/* Set the compare match value according to the tick rate we want. */
	TDR05 = ( portTickType ) ( configCPU_CLOCK_HZ / configTICK_RATE_HZ );

	/* Set Timer Array Unit Channel 5 output mode */
	TOM0 &= ~0x0020;

	/* Set Timer Array Unit Channel 5 output level */	
	TOL0 &= ~0x0020;

	/* Set Timer Array Unit Channel 5 output enable */	
	TOE0 &= ~0x0020;

	/* Interrupt of Timer Array Unit Channel 5 enabled */
	TMMK05 = 0;

	/* Start Timer Array Unit Channel 5.*/
	TS0 |= 0x0020;
}
/*-----------------------------------------------------------*/

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区免费在线播放| 韩国一区二区三区| 精品亚洲porn| 欧美在线免费观看视频| 国产免费久久精品| 美洲天堂一区二卡三卡四卡视频 | 日本不卡一区二区三区高清视频| 国产精品中文字幕一区二区三区| 欧美三级韩国三级日本三斤| 欧美国产激情二区三区| 国产伦精品一区二区三区在线观看| 色婷婷激情综合| 国产精品色哟哟| 国产电影一区二区三区| 精品国产精品一区二区夜夜嗨| 亚洲va欧美va天堂v国产综合| 97久久超碰精品国产| 中文字幕欧美区| 国产一区免费电影| 久久综合一区二区| 美女视频黄 久久| 欧美一区午夜视频在线观看| 一区二区三区在线视频观看| www.欧美亚洲| 亚洲日本一区二区三区| aaa亚洲精品| 最新不卡av在线| 99久久99久久久精品齐齐| 中文在线资源观看网站视频免费不卡| 国产一区激情在线| 久久综合色天天久久综合图片| 久久精品国产在热久久| 精品国产一区二区亚洲人成毛片 | 欧美一区二区女人| 婷婷久久综合九色综合绿巨人 | 91免费视频网址| 成人欧美一区二区三区黑人麻豆 | 亚洲国产精品久久不卡毛片 | 欧美网站一区二区| 亚洲成人资源网| 91麻豆精品国产91久久久资源速度 | 国产精品国产三级国产专播品爱网 | 日韩在线一区二区| 91麻豆精品91久久久久同性| 日本不卡一区二区| 久久免费偷拍视频| 99久久综合99久久综合网站| 18成人在线视频| 欧美视频三区在线播放| 蜜臀av亚洲一区中文字幕| 久久久久国产成人精品亚洲午夜| 国产成人精品影院| 夜夜爽夜夜爽精品视频| 欧美电影免费提供在线观看| 国产又黄又大久久| 亚洲人成网站影音先锋播放| 欧美高清视频不卡网| 紧缚奴在线一区二区三区| 中文幕一区二区三区久久蜜桃| 91丝袜美女网| 麻豆国产精品视频| 亚洲美女淫视频| 欧美一级欧美三级| 99riav一区二区三区| 美脚の诱脚舐め脚责91| 国产精品国产三级国产aⅴ原创| 欧美日韩三级一区二区| 国产精品456| 亚洲va天堂va国产va久| 国产精品乱人伦| 777午夜精品免费视频| 懂色av中文字幕一区二区三区| 亚洲国产综合色| 国产日韩欧美精品一区| 欧美精品在欧美一区二区少妇| 国产大片一区二区| 五月婷婷久久综合| 国产精品久久久久四虎| 日韩精品一区二区三区在线观看| 99久久久久久| 狠狠色2019综合网| 亚洲成人自拍一区| 亚洲三级电影网站| 日本一区二区免费在线观看视频| 欧美精品一二三四| 91伊人久久大香线蕉| 国产乱子伦一区二区三区国色天香| 一区二区在线看| 欧美激情综合五月色丁香| 日韩三级中文字幕| 欧美男同性恋视频网站| 一本色道久久综合狠狠躁的推荐| 国产乱色国产精品免费视频| 青青国产91久久久久久| 亚洲午夜视频在线观看| 中文字幕在线播放不卡一区| 国产三级精品三级| 久久久久久久电影| 26uuu精品一区二区| 日韩精品一区二区三区四区| 欧美疯狂性受xxxxx喷水图片| 91欧美一区二区| 91理论电影在线观看| 99久久国产综合精品色伊| 成人丝袜18视频在线观看| 久久69国产一区二区蜜臀| 久久精品av麻豆的观看方式| 理论电影国产精品| 精品一区二区免费视频| 黄色日韩网站视频| 国产九色精品成人porny| 国产一本一道久久香蕉| 国产福利电影一区二区三区| 国产成人精品一区二区三区四区 | 国产精品电影一区二区| 国产精品色噜噜| 中文久久乱码一区二区| 国产精品美女视频| 国产精品久久久久久亚洲毛片 | 三级在线观看一区二区 | 亚洲国产美女搞黄色| 亚洲已满18点击进入久久| 亚洲精品国产视频| 午夜视黄欧洲亚洲| 奇米色一区二区| 国产一区二区精品在线观看| 国产精品自拍av| 成人黄动漫网站免费app| 99精品视频在线播放观看| 欧洲一区在线电影| 日韩午夜小视频| 欧美国产激情一区二区三区蜜月 | 日韩成人一级片| 国产乱对白刺激视频不卡| 成人教育av在线| 91成人国产精品| 欧美v日韩v国产v| 国产精品国产成人国产三级 | 亚洲欧洲99久久| 亚洲国产精品一区二区久久恐怖片 | 亚洲一区av在线| 激情丁香综合五月| 91在线免费播放| 精品卡一卡二卡三卡四在线| 国产精品久久99| 日韩国产成人精品| 粉嫩一区二区三区在线看| 一本色道久久加勒比精品 | 欧美日韩精品一区二区天天拍小说 | 亚洲午夜精品网| 国产精品88av| 欧美性做爰猛烈叫床潮| 欧美成人福利视频| 一区二区三区在线免费视频 | 日本一二三不卡| 五月天久久比比资源色| 国产精品99精品久久免费| 欧美日韩免费视频| 国产欧美一区二区在线| 日本亚洲一区二区| 91丨porny丨户外露出| 日韩午夜小视频| 亚洲国产精品一区二区www | 国产自产高清不卡| 欧美日韩卡一卡二| 亚洲欧洲精品一区二区三区| 蜜臀av亚洲一区中文字幕| 91在线国产福利| 久久精品夜色噜噜亚洲aⅴ| 亚洲国产一区二区在线播放| av一区二区三区在线| 日韩精品一区二区三区视频| 有码一区二区三区| 成人av网址在线观看| 精品国产乱码久久久久久夜甘婷婷| 亚洲美女视频一区| 成人性生交大片免费看中文 | 精品视频全国免费看| 国产精品少妇自拍| 国产盗摄一区二区三区| 日韩免费高清av| 日韩精品欧美精品| 欧美色国产精品| 夜夜嗨av一区二区三区四季av| 成人福利在线看| 久久久久久久免费视频了| 久久精品国产一区二区三| 欧美精品18+| 人人狠狠综合久久亚洲| 欧美精品三级日韩久久| 亚洲观看高清完整版在线观看 | 午夜精品久久久久久不卡8050| 91片黄在线观看| 一区二区三区国产精华| 色综合久久久久综合体桃花网| 中文字幕中文字幕一区| thepron国产精品| 国产精品美女久久久久久2018| 国产东北露脸精品视频| 欧美国产激情二区三区|