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

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

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


/*-----------------------------------------------------------
 * 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 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 portCLEAR_AIC_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 )
	{		
	static volatile unsigned portLONG ulDummy;

		/* Clear tick timer interrupt indication. */
		ulDummy = portTIMER_REG_BASE_PTR->TC_SR;  

		vTaskIncrementTick();

		/* Acknowledge the interrupt at AIC level... */
		AT91C_BASE_AIC->AIC_EOICR = portCLEAR_AIC_INTERRUPT;
	}

#else  /* else preemption is turned on */

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

		/* WARNING - Do not use local (stack) variables here.  Use globals
					 if you must! */
		static volatile unsigned portLONG ulDummy;

		/* Clear tick timer interrupt indication. */
		ulDummy = portTIMER_REG_BASE_PTR->TC_SR;  

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

		/* Acknowledge the interrupt at AIC level... */
		AT91C_BASE_AIC->AIC_EOICR = portCLEAR_AIC_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在线| 亚洲乱码日产精品bd| 欧美国产日韩一二三区| 国产欧美日韩在线看| 欧美电影免费观看高清完整版| 日韩欧美一级精品久久| 日韩一级精品视频在线观看| 日韩欧美一级二级三级| 久久综合狠狠综合久久综合88 | 亚洲午夜久久久久中文字幕久| 中文字幕一区不卡| 亚洲手机成人高清视频| 亚洲女厕所小便bbb| 亚洲免费在线观看视频| 一区二区免费在线播放| 视频一区视频二区中文| 国模冰冰炮一区二区| 顶级嫩模精品视频在线看| 99国产精品久久| 在线亚洲一区观看| 欧美一二三四区在线| 国产婷婷精品av在线| 亚洲丝袜美腿综合| 午夜成人免费电影| 国产精品77777| 色偷偷一区二区三区| 欧美高清激情brazzers| 久久久高清一区二区三区| 亚洲精品成人天堂一二三| 日韩中文欧美在线| 成人一区二区三区中文字幕| 日本精品视频一区二区| 欧美变态凌虐bdsm| 最新中文字幕一区二区三区| 爽爽淫人综合网网站| 丁香桃色午夜亚洲一区二区三区| 91激情五月电影| 精品精品国产高清一毛片一天堂| 亚洲女人小视频在线观看| 美女在线视频一区| 91免费版pro下载短视频| 日韩一区二区在线观看视频 | 中文字幕日韩一区| 日本sm残虐另类| 99九九99九九九视频精品| 91精品国产免费| 亚洲免费伊人电影| 国产精品18久久久久| 欧美撒尿777hd撒尿| 国产亚洲综合在线| 视频在线观看一区二区三区| 成人免费视频视频在线观看免费| 欧美一区二区人人喊爽| 亚洲人成网站色在线观看| 韩国女主播一区| 91麻豆精品国产无毒不卡在线观看| 国产精品国产精品国产专区不蜜| 精品系列免费在线观看| 欧美精品日韩一区| 亚洲国产一区二区视频| 91麻豆.com| 国产精品视频yy9299一区| 国模套图日韩精品一区二区 | 日韩欧美第一区| 亚洲成国产人片在线观看| 91在线你懂得| 亚洲人成网站色在线观看| 成人免费av资源| 国产精品网站一区| 成人毛片视频在线观看| 久久久www成人免费无遮挡大片| 日本成人中文字幕| 欧美一级片在线| 亚洲综合激情小说| 91免费版在线| 亚洲免费av高清| 91亚洲精品久久久蜜桃网站| 国产精品久久久久久久裸模| 成人精品视频一区二区三区尤物| 国产欧美一区二区精品性| 国产91对白在线观看九色| 国产目拍亚洲精品99久久精品| 国产99久久久精品| 国产精品九色蝌蚪自拍| 91免费视频网| 午夜在线成人av| 日韩一区二区高清| 精品一二三四在线| 国产精品美日韩| 一本大道久久精品懂色aⅴ| 亚洲与欧洲av电影| 欧美一区二区三区视频免费| 久久国产剧场电影| 中日韩免费视频中文字幕| 成人性生交大片免费看在线播放| 国产精品久久久爽爽爽麻豆色哟哟| av动漫一区二区| 亚洲综合在线免费观看| 91精品国产91久久久久久一区二区| 久久av资源站| 一区二区中文视频| 欧美日韩国产高清一区二区| 麻豆中文一区二区| 国产精品成人免费| 欧美日韩高清影院| 国产夫妻精品视频| 一区二区三区欧美| 精品福利在线导航| 色婷婷久久久亚洲一区二区三区| 麻豆精品在线播放| 国产精品高潮呻吟久久| 91精品国产综合久久久久久漫画| 国产精品88av| 天堂成人免费av电影一区| 国产欧美日韩在线看| 欧美色图一区二区三区| 国产精品系列在线观看| 亚洲成人自拍一区| 国产精品伦理在线| 欧美电影免费观看高清完整版在线 | 一区二区三区资源| 欧美精品一区二区蜜臀亚洲| 欧美亚洲精品一区| 国产成人免费视频网站| 天堂久久久久va久久久久| 最好看的中文字幕久久| 精品久久久网站| 69堂精品视频| 色哟哟一区二区| 成人免费毛片a| 韩国欧美一区二区| 五月激情六月综合| 亚洲精品视频自拍| 国产精品无圣光一区二区| 欧美一级二级在线观看| 欧美性猛交xxxxxxxx| 不卡一区二区中文字幕| 黑人巨大精品欧美黑白配亚洲| 亚洲国产一区视频| 亚洲一区二区三区精品在线| 国产精品成人一区二区艾草| 国产欧美日韩精品一区| 久久免费偷拍视频| 精品久久国产老人久久综合| 91精品国产综合久久久久久漫画| 欧美日韩一级片在线观看| 91视频.com| 91社区在线播放| 91日韩一区二区三区| yourporn久久国产精品| 国产成人精品亚洲777人妖| 激情综合亚洲精品| 国内精品视频一区二区三区八戒| 美女在线视频一区| 久草在线在线精品观看| 精品亚洲国内自在自线福利| 国产一区久久久| 国产成人夜色高潮福利影视| 国产成人在线观看| 成人深夜福利app| 91麻豆免费在线观看| 91视频com| www一区二区| 国产无遮挡一区二区三区毛片日本| 久久午夜羞羞影院免费观看| 国产欧美精品国产国产专区| 欧美韩国日本综合| 亚洲三级视频在线观看| 亚洲午夜免费电影| 美女精品一区二区| 国产乱码字幕精品高清av| 波多野结衣在线一区| 色婷婷综合久久久久中文 | 精品国产一区二区三区四区四| 精品福利二区三区| 中文字幕第一页久久| 一区二区三区国产豹纹内裤在线 | 欧美福利电影网| 精品少妇一区二区三区在线视频| 国产午夜亚洲精品羞羞网站| 日韩理论片中文av| 日本少妇一区二区| 国产露脸91国语对白| 91网上在线视频| 欧美成人乱码一区二区三区| 日本一二三不卡| 亚洲一区二区三区不卡国产欧美| 日韩国产欧美在线观看| 懂色av一区二区三区免费观看| 91丨九色丨蝌蚪丨老版| 欧美老年两性高潮| 中文字幕的久久| 丝袜a∨在线一区二区三区不卡| 国产成人av资源| 91精品国产乱| 亚洲欧美在线视频观看| 黄一区二区三区| 欧美日韩亚州综合| 中文字幕一区二区三区不卡|