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

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

?? portisr.c

?? freertosV4.40 是一種small的嵌入式系統。利于嵌入式開好者入門學習嵌入式操作系統。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? C
字號:
/*
	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.
	***************************************************************************
*/


/*-----------------------------------------------------------
 * Components that can be compiled to either ARM or THUMB mode are
 * contained in port.c  The ISR routines, which can only be compiled
 * to ARM mode, are contained in this file.
 *----------------------------------------------------------*/

/*
	Changes from V2.5.2
		
	+ The critical section management functions have been changed.  These no
	  longer modify the stack and are safe to use at all optimisation levels.
	  The functions are now also the same for both ARM and THUMB modes.

	Changes from V2.6.0

	+ Removed the 'static' from the definition of vNonPreemptiveTick() to 
	  allow the demo to link when using the cooperative scheduler.

	Changes from V3.2.4

	+ The assembler statements are now included in a single asm block rather
	  than each line having its own asm block.
*/


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

/* Constants required to handle interrupts. */
#define portTIMER_MATCH_ISR_BIT		( ( unsigned portCHAR ) 0x01 )
#define portCLEAR_VIC_INTERRUPT		( ( unsigned portLONG ) 0 )

/* Constants required to handle critical sections. */
#define portNO_CRITICAL_NESTING		( ( unsigned portLONG ) 0 )
volatile unsigned portLONG ulCriticalNesting = 9999UL;

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

/* ISR to handle manual context switches (from a call to taskYIELD()). */
void vPortYieldProcessor( void ) __attribute__((interrupt("SWI"), naked));

/* 
 * The scheduler can only be started from ARM mode, hence the inclusion of this
 * function here.
 */
void vPortISRStartFirstTask( void );
/*-----------------------------------------------------------*/

void vPortISRStartFirstTask( void )
{
	/* Simply start the scheduler.  This is included here as it can only be
	called from ARM mode. */
	portRESTORE_CONTEXT();
}
/*-----------------------------------------------------------*/

/*
 * Called by portYIELD() or taskYIELD() to manually force a context switch.
 *
 * When a context switch is performed from the task level the saved task 
 * context is made to look as if it occurred from within the tick ISR.  This
 * way the same restore context function can be used when restoring the context
 * saved from the ISR or that saved from a call to vPortYieldProcessor.
 */
void vPortYieldProcessor( void )
{
	/* Within an IRQ ISR the link register has an offset from the true return 
	address, but an SWI ISR does not.  Add the offset manually so the same 
	ISR return code can be used in both cases. */
	asm volatile ( "ADD		LR, LR, #4" );

	/* Perform the context switch.  First save the context of the current task. */
	portSAVE_CONTEXT();

	/* Find the highest priority task that is ready to run. */
	vTaskSwitchContext();

	/* Restore the context of the new task. */
	portRESTORE_CONTEXT();	
}
/*-----------------------------------------------------------*/

/* 
 * The ISR used for the scheduler tick depends on whether the cooperative or
 * the preemptive scheduler is being used.
 */

#if configUSE_PREEMPTION == 0

	/* The cooperative scheduler requires a normal IRQ service routine to 
	simply increment the system tick. */
	void vNonPreemptiveTick( void ) __attribute__ ((interrupt ("IRQ")));
	void vNonPreemptiveTick( void )
	{		
		vTaskIncrementTick();
		T0_IR = portTIMER_MATCH_ISR_BIT;
		VICVectAddr = portCLEAR_VIC_INTERRUPT;
	}

#else

	/* The preemptive scheduler is defined as "naked" as the full context is
	saved on entry as part of the context switch. */
	void vPreemptiveTick( void ) __attribute__((naked));
	void vPreemptiveTick( void )
	{
		/* Save the context of the interrupted task. */
		portSAVE_CONTEXT();	

		/* Increment the RTOS tick count, then look for the highest priority 
		task that is ready to run. */
		vTaskIncrementTick();
		vTaskSwitchContext();

		/* Ready for the next interrupt. */
		T0_IR = portTIMER_MATCH_ISR_BIT;
		VICVectAddr = portCLEAR_VIC_INTERRUPT;
		
		/* Restore the context of the new task. */
		portRESTORE_CONTEXT();
	}

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

/*
 * The interrupt management utilities can only be called from ARM mode.  When
 * THUMB_INTERWORK is defined the utilities are defined as functions here to
 * ensure a switch to ARM mode.  When THUMB_INTERWORK is not defined then
 * the utilities are defined as macros in portmacro.h - as per other ports.
 */
#ifdef THUMB_INTERWORK

	void vPortDisableInterruptsFromThumb( void ) __attribute__ ((naked));
	void vPortEnableInterruptsFromThumb( void ) __attribute__ ((naked));

	void vPortDisableInterruptsFromThumb( void )
	{
		asm volatile ( 
			"STMDB	SP!, {R0}		\n\t"	/* Push R0.									*/
			"MRS	R0, CPSR		\n\t"	/* Get CPSR.								*/
			"ORR	R0, R0, #0xC0	\n\t"	/* Disable IRQ, FIQ.						*/
			"MSR	CPSR, R0		\n\t"	/* Write back modified value.				*/
			"LDMIA	SP!, {R0}		\n\t"	/* Pop R0.									*/
			"BX		R14" );					/* Return back to thumb.					*/
	}
			
	void vPortEnableInterruptsFromThumb( void )
	{
		asm volatile ( 
			"STMDB	SP!, {R0}		\n\t"	/* Push R0.									*/	
			"MRS	R0, CPSR		\n\t"	/* Get CPSR.								*/	
			"BIC	R0, R0, #0xC0	\n\t"	/* Enable IRQ, FIQ.							*/	
			"MSR	CPSR, R0		\n\t"	/* Write back modified value.				*/	
			"LDMIA	SP!, {R0}		\n\t"	/* Pop R0.									*/
			"BX		R14" );					/* Return back to thumb.					*/
	}

#endif /* THUMB_INTERWORK */

/* The code generated by the GCC compiler uses the stack in different ways at
different optimisation levels.  The interrupt flags can therefore not always
be saved to the stack.  Instead the critical section nesting level is stored
in a variable, which is then saved as part of the stack context. */
void vPortEnterCritical( void )
{
	/* Disable interrupts as per portDISABLE_INTERRUPTS(); 							*/
	asm volatile ( 
		"STMDB	SP!, {R0}			\n\t"	/* Push R0.								*/
		"MRS	R0, CPSR			\n\t"	/* Get CPSR.							*/
		"ORR	R0, R0, #0xC0		\n\t"	/* Disable IRQ, FIQ.					*/
		"MSR	CPSR, R0			\n\t"	/* Write back modified value.			*/
		"LDMIA	SP!, {R0}" );				/* Pop R0.								*/

	/* Now interrupts are disabled ulCriticalNesting can be accessed 
	directly.  Increment ulCriticalNesting to keep a count of how many times
	portENTER_CRITICAL() has been called. */
	ulCriticalNesting++;
}

void vPortExitCritical( void )
{
	if( ulCriticalNesting > portNO_CRITICAL_NESTING )
	{
		/* Decrement the nesting count as we are leaving a critical section. */
		ulCriticalNesting--;

		/* If the nesting level has reached zero then interrupts should be
		re-enabled. */
		if( ulCriticalNesting == portNO_CRITICAL_NESTING )
		{
			/* Enable interrupts as per portEXIT_CRITICAL().					*/
			asm volatile ( 
				"STMDB	SP!, {R0}		\n\t"	/* Push R0.						*/	
				"MRS	R0, CPSR		\n\t"	/* Get CPSR.					*/	
				"BIC	R0, R0, #0xC0	\n\t"	/* Enable IRQ, FIQ.				*/	
				"MSR	CPSR, R0		\n\t"	/* Write back modified value.	*/	
				"LDMIA	SP!, {R0}" );			/* Pop R0.						*/
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人av在线电影| 欧美日韩国产高清一区| 国产调教视频一区| 成人免费视频一区二区| 综合中文字幕亚洲| 色偷偷一区二区三区| 亚洲国产另类精品专区| 欧美人牲a欧美精品| 久久精品免费观看| 久久精品亚洲一区二区三区浴池| 粉嫩久久99精品久久久久久夜| 中文字幕欧美区| 日本精品裸体写真集在线观看 | 日韩高清在线观看| 日韩亚洲欧美综合| 国产成人超碰人人澡人人澡| 中文字幕综合网| 制服丝袜中文字幕一区| 国产一区二区免费看| 成人欧美一区二区三区小说| 欧美日韩一区二区三区四区| 蜜臀精品久久久久久蜜臀| 久久精品这里都是精品| 日本久久电影网| 久草在线在线精品观看| 国产精品久久久久久妇女6080| 国产精品福利影院| 欧美亚洲一区二区在线| 国产一区二区在线看| 日韩理论片一区二区| 91精品视频网| www.欧美亚洲| 青青草精品视频| 18欧美乱大交hd1984| 日韩一区二区三区免费看| 不卡的电影网站| 麻豆成人久久精品二区三区红| 亚洲丝袜美腿综合| 精品国产一区二区三区av性色| 色婷婷综合久久久久中文| 蜜臀av性久久久久av蜜臀妖精 | 欧美一卡二卡在线观看| 成人高清视频免费观看| 三级久久三级久久| 国产精品网曝门| 欧美α欧美αv大片| 色综合天天综合网天天狠天天| 黄网站免费久久| 丝袜美腿一区二区三区| 亚洲欧洲中文日韩久久av乱码| 精品福利一区二区三区| 欧美老女人第四色| 91视频xxxx| 国产不卡在线一区| 精一区二区三区| 亚洲成人午夜影院| 一区二区三区精品| 国产精品国产馆在线真实露脸| 日韩免费一区二区三区在线播放| 色国产精品一区在线观看| 国产成人午夜99999| 美美哒免费高清在线观看视频一区二区 | 日韩极品在线观看| 一级做a爱片久久| 国产精品二三区| 欧美激情综合在线| 久久精品视频一区二区三区| 精品99一区二区| 欧美va亚洲va| 精品免费国产二区三区| 欧美一级艳片视频免费观看| 欧美日韩国产综合久久 | 亚洲在线免费播放| 亚洲人妖av一区二区| 中文字幕制服丝袜一区二区三区| 国产调教视频一区| 中文字幕精品综合| 国产精品不卡在线观看| 国产精品久久影院| 亚洲图片欧美激情| 一区二区三区影院| 亚洲综合图片区| 亚洲成人www| 美女性感视频久久| 国产在线精品一区二区| 国内成人精品2018免费看| 韩国理伦片一区二区三区在线播放| 麻豆中文一区二区| 国产乱一区二区| 不卡的看片网站| 91在线码无精品| 欧美日韩精品欧美日韩精品| 制服丝袜中文字幕一区| 亚洲香肠在线观看| 婷婷开心激情综合| 久久se精品一区二区| 国产自产高清不卡| 不卡av电影在线播放| 色综合夜色一区| 欧美日韩激情一区| 欧美成人精品二区三区99精品| 久久精品男人天堂av| ...xxx性欧美| 午夜精品福利久久久| 麻豆91在线播放免费| 高清国产一区二区三区| 91官网在线观看| 欧美电视剧在线看免费| 欧美—级在线免费片| 一区二区成人在线观看| 奇米精品一区二区三区在线观看一 | 精品久久国产97色综合| 欧美激情一区二区三区在线| 一区二区三区.www| 麻豆国产精品777777在线| 成人av在线影院| 欧美一级二级三级蜜桃| 亚洲欧洲国产日本综合| 日本不卡高清视频| 91污在线观看| 日韩一级片在线观看| 国产精品色呦呦| 日本在线不卡视频| 99久久777色| 欧美精品一区二区精品网| 樱花草国产18久久久久| 麻豆精品一区二区综合av| 99久久国产免费看| 精品福利一区二区三区免费视频| 一区二区三区在线观看视频| 久久99精品久久久久久国产越南 | 一区二区三区四区在线播放| 久久精品国产久精国产爱| 91久久精品国产91性色tv| www欧美成人18+| 午夜精品一区在线观看| 国产成人aaa| 日韩限制级电影在线观看| 玉足女爽爽91| 成人免费高清视频| 精品久久久久久综合日本欧美| 一区二区激情小说| 99久久综合色| 久久久久久久网| 久久精品国产亚洲5555| 欧美日韩1234| 尤物在线观看一区| 99久久久精品免费观看国产蜜| www成人在线观看| 日本美女视频一区二区| 91福利在线导航| 亚洲天堂久久久久久久| 懂色av噜噜一区二区三区av| 精品国产一区二区在线观看| 美腿丝袜一区二区三区| 欧美日韩一级视频| 一区二区免费在线播放| 色综合久久久久网| 亚洲精品中文在线观看| 成人美女视频在线观看| 久久久久久久久久久久电影| 蜜臀国产一区二区三区在线播放| 欧美日韩免费在线视频| 亚洲一区在线视频| 在线观看不卡一区| 亚洲精品福利视频网站| 色老综合老女人久久久| 夜夜夜精品看看| 欧美性xxxxxxxx| 午夜精品影院在线观看| 欧美电影一区二区三区| 午夜精品福利一区二区蜜股av | 日韩毛片精品高清免费| 不卡的av在线播放| 亚洲品质自拍视频网站| 91黄色免费观看| 亚洲图片自拍偷拍| 欧美巨大另类极品videosbest| 日韩精品一级中文字幕精品视频免费观看 | 日本伊人午夜精品| 欧美xxxx在线观看| 国产精品综合av一区二区国产馆| 久久久美女艺术照精彩视频福利播放| 国模一区二区三区白浆| 国产农村妇女毛片精品久久麻豆 | 欧美va亚洲va| 成人丝袜18视频在线观看| 国产精品美女一区二区| 91日韩在线专区| 亚洲高清在线精品| 精品噜噜噜噜久久久久久久久试看 | 香蕉乱码成人久久天堂爱免费| 欧美日本韩国一区二区三区视频| 蜜臀av在线播放一区二区三区| 精品福利在线导航| 99re亚洲国产精品| 日韩电影网1区2区| 亚洲国产精品99久久久久久久久| 91美女蜜桃在线| 欧美aⅴ一区二区三区视频|