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

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

?? port.c

?? freertosV4.40 是一種small的嵌入式系統(tǒng)。利于嵌入式開好者入門學(xué)習(xí)嵌入式操作系統(tǒng)。通過對于源碼的學(xué)習(xí)可以很好的掌握freertos的運(yùn)行機(jī)制。
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/*
	FreeRTOS.org V4.4.0 - Copyright (C) 2003-2007 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.

	Also see http://www.SafeRTOS.com for an IEC 61508 compliant version along
	with commercial development and support options.
	***************************************************************************
*/

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

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

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

/* Constants required to setup timer 2 to produce the RTOS tick. */
#define portCLOCK_DIVISOR				( ( unsigned portLONG ) 12 )
#define portMAX_TIMER_VALUE				( ( unsigned portLONG ) 0xffff )
#define portENABLE_TIMER				( ( unsigned portCHAR ) 0x04 )
#define portTIMER_2_INTERRUPT_ENABLE	( ( unsigned portCHAR ) 0x20 )

/* The value used in the IE register when a task first starts. */
#define portGLOBAL_INTERRUPT_BIT	( ( portSTACK_TYPE ) 0x80 )

/* The value used in the PSW register when a task first starts. */
#define portINITIAL_PSW				( ( portSTACK_TYPE ) 0x00 )

/* Macro to clear the timer 2 interrupt flag. */
#define portCLEAR_INTERRUPT_FLAG()	TMR2CN &= ~0x80;

/* Used during a context switch to store the size of the stack being copied
to or from XRAM. */
data static unsigned portCHAR ucStackBytes;

/* Used during a context switch to point to the next byte in XRAM from/to which
a RAM byte is to be copied. */
xdata static portSTACK_TYPE * data pxXRAMStack;

/* Used during a context switch to point to the next byte in RAM from/to which
an XRAM byte is to be copied. */
data static portSTACK_TYPE * data pxRAMStack;

/* 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;

/*
 * Setup the hardware to generate an interrupt off timer 2 at the required 
 * frequency.
 */
static void prvSetupTimerInterrupt( void );

/*-----------------------------------------------------------*/
/*
 * Macro that copies the current stack from internal RAM to XRAM.  This is 
 * required as the 8051 only contains enough internal RAM for a single stack, 
 * but we have a stack for every task.
 */
#define portCOPY_STACK_TO_XRAM()																\
{																								\
	/* pxCurrentTCB points to a TCB which itself points to the location into					\
	which the first	stack byte should be copied.  Set pxXRAMStack to point						\
	to the location into which the first stack byte is to be copied. */							\
	pxXRAMStack = ( xdata portSTACK_TYPE * ) *( ( xdata portSTACK_TYPE ** ) pxCurrentTCB );		\
																								\
	/* Set pxRAMStack to point to the first byte to be coped from the stack. */					\
	pxRAMStack = ( data portSTACK_TYPE * data ) configSTACK_START;								\
																								\
	/* Calculate the size of the stack we are about to copy from the current					\
	stack pointer value. */																		\
	ucStackBytes = SP - ( configSTACK_START - 1 );												\
																								\
	/* Before starting to copy the stack, store the calculated stack size so					\
	the stack can be restored when the task is resumed. */										\
	*pxXRAMStack = ucStackBytes;																\
																								\
	/* Copy each stack byte in turn.  pxXRAMStack is incremented first as we					\
	have already stored the stack size into XRAM. */											\
	while( ucStackBytes )																		\
	{																							\
		pxXRAMStack++;																			\
		*pxXRAMStack = *pxRAMStack;																\
		pxRAMStack++;																			\
		ucStackBytes--;																			\
	}																							\
}
/*-----------------------------------------------------------*/

/*
 * Macro that copies the stack of the task being resumed from XRAM into 
 * internal RAM.
 */
#define portCOPY_XRAM_TO_STACK()																\
{																								\
	/* Setup the pointers as per portCOPY_STACK_TO_XRAM(), but this time to						\
	copy the data back out of XRAM and into the stack. */										\
	pxXRAMStack = ( xdata portSTACK_TYPE * ) *( ( xdata portSTACK_TYPE ** ) pxCurrentTCB );		\
	pxRAMStack = ( data portSTACK_TYPE * data ) ( configSTACK_START - 1 );						\
																								\
	/* The first value stored in XRAM was the size of the stack - i.e. the						\
	number of bytes we need to copy back. */													\
	ucStackBytes = pxXRAMStack[ 0 ];															\
																								\
	/* Copy the required number of bytes back into the stack. */								\
	do																							\
	{																							\
		pxXRAMStack++;																			\
		pxRAMStack++;																			\
		*pxRAMStack = *pxXRAMStack;																\
		ucStackBytes--;																			\
	} while( ucStackBytes );																	\
																								\
	/* Restore the stack pointer ready to use the restored stack. */							\
	SP = ( unsigned portCHAR ) pxRAMStack;														\
}
/*-----------------------------------------------------------*/

/*
 * Macro to push the current execution context onto the stack, before the stack 
 * is moved to XRAM. 
 */
#define portSAVE_CONTEXT()																		\
{																								\
	_asm																						\
		/* Push ACC first, as when restoring the context it must be restored					\
		last (it is used to set the IE register). */											\
		push	ACC																				\
		/* Store the IE register then disable interrupts. */									\
		push	IE																				\
		clr		_EA																				\
		push	DPL																				\
		push	DPH																				\
		push	b																				\
		push	ar2																				\
		push	ar3																				\
		push	ar4																				\
		push	ar5																				\
		push	ar6																				\
		push	ar7																				\
		push	ar0																				\
		push	ar1																				\
		push	PSW																				\
	_endasm;																					\
		PSW = 0;																				\
	_asm																						\
		push	_bp																				\
	_endasm;																					\
}
/*-----------------------------------------------------------*/

/*
 * Macro that restores the execution context from the stack.  The execution 
 * context was saved into the stack before the stack was copied into XRAM.
 */
#define portRESTORE_CONTEXT()																	\
{																								\
	_asm																						\
		pop		_bp																				\
		pop		PSW																				\
		pop		ar1																				\
		pop		ar0																				\
		pop		ar7																				\
		pop		ar6																				\
		pop		ar5																				\
		pop		ar4																				\
		pop		ar3																				\
		pop		ar2																				\
		pop		b																				\
		pop		DPH																				\
		pop		DPL																				\
		/* The next byte of the stack is the IE register.  Only the global						\
		enable bit forms part of the task context.  Pop off the IE then set						\
		the global enable bit to match that of the stored IE register. */						\
		pop		ACC																				\
		JB		ACC.7,0098$																		\
		CLR		IE.7																			\
		LJMP	0099$																			\
	0098$:																						\
		SETB	IE.7																			\
	0099$:																						\
		/* Finally pop off the ACC, which was the first register saved. */						\
		pop		ACC																				\
		reti																					\
	_endasm;																					\

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃免费网站一区二区三区| 久久99精品国产麻豆婷婷| 制服丝袜中文字幕亚洲| 黄色精品一二区| 一区二区三区.www| 国产色综合一区| 91精品一区二区三区久久久久久| bt欧美亚洲午夜电影天堂| 久久99精品一区二区三区| 亚洲国产婷婷综合在线精品| 国产午夜精品久久久久久久| 欧美日韩一区二区三区四区五区 | 欧美精品久久天天躁| 国产成人av电影免费在线观看| 亚洲3atv精品一区二区三区| 国产精品久久久久7777按摩| 日韩欧美在线1卡| 欧美视频一区二区三区| 99久久精品99国产精品| 国产精品一区免费视频| 丝袜亚洲精品中文字幕一区| 亚洲色图在线视频| 国产婷婷一区二区| 久久在线免费观看| 久久综合丝袜日本网| 日韩色视频在线观看| 欧美日韩视频第一区| 色999日韩国产欧美一区二区| 国产成人aaa| 国产精品996| 国内成人自拍视频| 精品亚洲porn| 国产在线国偷精品免费看| 日韩国产精品91| 青青草伊人久久| 日本成人在线一区| 日本成人在线网站| 麻豆免费看一区二区三区| 日韩专区欧美专区| 日韩高清不卡一区二区| 免费成人在线影院| 久久疯狂做爰流白浆xx| 美洲天堂一区二卡三卡四卡视频| 丝袜a∨在线一区二区三区不卡| 亚洲高清在线精品| 视频一区视频二区中文字幕| 亚洲成人免费视| 日本不卡一区二区三区 | 国内精品伊人久久久久影院对白| 日本人妖一区二区| 国内精品嫩模私拍在线| 东方aⅴ免费观看久久av| 成人av免费观看| 一本大道久久a久久精品综合| 99re6这里只有精品视频在线观看| 99r精品视频| 欧美吞精做爰啪啪高潮| 91精品国产综合久久香蕉麻豆| 日韩亚洲欧美在线观看| xnxx国产精品| 亚洲人xxxx| 同产精品九九九| 久久精品国产99久久6| 国产成人鲁色资源国产91色综| 懂色av中文字幕一区二区三区| 91污片在线观看| 欧美一区二区三区免费在线看| 精品国产髙清在线看国产毛片| 国产欧美中文在线| 一区二区三区四区蜜桃| 免费在线一区观看| 国产99久久精品| 欧美视频在线一区二区三区 | 一区二区三区在线免费视频| 日韩不卡一区二区三区| 国产精品69毛片高清亚洲| 色婷婷综合五月| 精品免费日韩av| 国产精品福利影院| 日韩国产欧美在线观看| 成人国产亚洲欧美成人综合网| 在线日韩av片| 久久久久久久久久看片| 亚洲一区日韩精品中文字幕| 精品一区二区三区蜜桃| 91色综合久久久久婷婷| 欧美电视剧在线观看完整版| 亚洲人成精品久久久久| 精品亚洲成a人| 欧美综合亚洲图片综合区| 亚洲精品在线三区| 亚洲与欧洲av电影| 国产福利精品一区二区| 欧美日韩综合一区| 欧美国产丝袜视频| 久久精品99久久久| 在线视频国内一区二区| 国产婷婷精品av在线| 日韩国产成人精品| 一本色道a无线码一区v| 精品国产网站在线观看| 夜色激情一区二区| 成人午夜精品在线| 欧美大度的电影原声| 亚洲国产三级在线| 91免费看片在线观看| 久久午夜羞羞影院免费观看| 三级不卡在线观看| 欧洲一区在线电影| 国产精品久久久久久久久免费相片 | 久久影视一区二区| 日韩avvvv在线播放| 在线日韩一区二区| 亚洲欧美日韩国产手机在线| 国产成人精品影院| 欧美精品一区男女天堂| 首页国产欧美久久| 欧美日韩一区二区在线观看视频 | 国产成人激情av| 日韩视频123| 美腿丝袜亚洲一区| 欧美伦理电影网| 午夜不卡av免费| 欧美日韩高清一区二区三区| 亚洲宅男天堂在线观看无病毒| 97精品超碰一区二区三区| 中文字幕在线免费不卡| 成人免费视频一区| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 色综合久久天天综合网| 亚洲一区二区三区在线看| 91猫先生在线| 伊人开心综合网| 色综合欧美在线| 亚洲人成精品久久久久久| 91视频在线观看| 亚洲欧美日韩电影| 色哟哟国产精品免费观看| 亚洲人精品一区| 欧美日韩日日骚| 蜜臀精品一区二区三区在线观看 | 亚洲美女少妇撒尿| 91久久精品一区二区三| 亚洲一区在线观看视频| 欧美日韩免费一区二区三区视频| 亚洲资源中文字幕| 欧美另类高清zo欧美| 美女脱光内衣内裤视频久久影院| 日韩一级片网站| 国内外成人在线视频| 欧美国产欧美亚州国产日韩mv天天看完整| 国产麻豆午夜三级精品| 中文在线资源观看网站视频免费不卡 | 精品国精品国产| 成人免费高清视频在线观看| 亚洲色图另类专区| 9191国产精品| 精品影视av免费| 中文字幕在线不卡视频| 在线精品亚洲一区二区不卡| 日日夜夜一区二区| 久久亚洲一级片| 91久久精品一区二区三区| 日本午夜精品一区二区三区电影| 精品国产在天天线2019| eeuss鲁片一区二区三区在线观看| 一区二区三区四区不卡在线 | 国产中文一区二区三区| 国产精品久久久久天堂| 欧美美女一区二区| 精品一区二区三区香蕉蜜桃| 国产精品亲子伦对白| 欧美在线高清视频| 美女视频第一区二区三区免费观看网站| 久久久久国产精品免费免费搜索| 成人黄色在线网站| 午夜精品福利一区二区蜜股av| 精品国产一区二区三区忘忧草 | 欧美a级理论片| 国产精品少妇自拍| 欧美精品粉嫩高潮一区二区| 国产成人午夜精品影院观看视频| 亚洲蜜桃精久久久久久久| 亚洲精品在线网站| 欧美伊人精品成人久久综合97| 国产精品影视在线| 午夜精品影院在线观看| 亚洲国产精品成人综合| 7777精品伊人久久久大香线蕉完整版| 国产精品 欧美精品| 首页国产丝袜综合| 日韩毛片在线免费观看| 精品久久久久久久久久久久包黑料 | 国产精品一区免费在线观看| 国内久久婷婷综合| 亚洲一区二区在线观看视频| 久久精品人人做人人爽97| 欧美日韩成人一区| 91免费精品国自产拍在线不卡| 国产一区在线观看麻豆|