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

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

?? port.c

?? FreeRtos Source code Version 4.04
?? C
字號(hào):
/*
	FreeRTOS.org V4.0.4 - Copyright (C) 2003-2006 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.
	***************************************************************************
*/

/*
	Changes between V4.0.0 and V4.0.1

	+ Reduced the code used to setup the initial stack frame.
	+ The kernel no longer has to install or handle the fault interrupt.
*/


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

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

/* Constants required to manipulate the NVIC. */
#define portNVIC_SYSTICK_CTRL		( ( volatile unsigned portLONG *) 0xe000e010 )
#define portNVIC_SYSTICK_LOAD		( ( volatile unsigned portLONG *) 0xe000e014 )
#define portNVIC_INT_CTRL			( ( volatile unsigned portLONG *) 0xe000ed04 )
#define portNVIC_SYSPRI2			( ( volatile unsigned portLONG *) 0xe000ed20 )
#define portNVIC_SYSPRI1			( ( volatile unsigned portLONG *) 0xe000ed1c )
#define portNVIC_SYSTICK_CLK		0x00000004
#define portNVIC_SYSTICK_INT		0x00000002
#define portNVIC_SYSTICK_ENABLE		0x00000001
#define portNVIC_PENDSVSET			0x10000000
#define portNVIC_PENDSV_PRI			0x00ff0000
#define portNVIC_SVCALL_PRI			0xff000000
#define portNVIC_SYSTICK_PRI		0xff000000

/* Constants required to set up the initial stack. */
#define portINITIAL_XPSR			( 0x01000000 )

/* Each task maintains its own interrupt status in the critical nesting
variable. */
unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;

/* 
 * Setup the timer to generate the tick interrupts.
 */
static void prvSetupTimerInterrupt( void );

/*
 * Exception handlers.
 */
void xPortPendSVHandler( void ) __attribute__ (( naked ));
void xPortSysTickHandler( void ) __attribute__ (( naked ));

/*
 * Set the MSP/PSP to a known value.
 */
void prvSetMSP( unsigned long ulValue ) __attribute__ (( naked ));
void prvSetPSP( unsigned long ulValue ) __attribute__ (( naked )); 

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

/* 
 * See header file for description. 
 */
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
	/* Simulate the stack frame as it would be created by a context switch
	interrupt. */
	*pxTopOfStack = portINITIAL_XPSR;	/* xPSR */
	pxTopOfStack--;
	*pxTopOfStack = ( portSTACK_TYPE ) pxCode;	/* PC */
	pxTopOfStack--;
	*pxTopOfStack = 0xfffffffd;	/* LR */
	pxTopOfStack -= 5;	/* R12, R3, R2 and R1. */
	*pxTopOfStack = ( portSTACK_TYPE ) pvParameters;	/* R0 */
	pxTopOfStack -= 9;	/* R11, R10, R9, R8, R7, R6, R5 and R4. */
	*pxTopOfStack = 0x00000000; /* uxCriticalNesting. */

	return pxTopOfStack;
}
/*-----------------------------------------------------------*/

void prvSetPSP( unsigned long ulValue )
{
	asm volatile( "msr psp, r0" );
	asm volatile( "bx lr" );
}
/*-----------------------------------------------------------*/

void prvSetMSP( unsigned long ulValue )
{
	asm volatile( "msr msp, r0" );
	asm volatile( "bx lr" );
}
/*-----------------------------------------------------------*/

/* 
 * See header file for description. 
 */
portBASE_TYPE xPortStartScheduler( void )
{
	/* Make PendSV, CallSV and SysTick the lowest priority interrupts. */
	*(portNVIC_SYSPRI2) |= portNVIC_PENDSV_PRI;
	*(portNVIC_SYSPRI2) |= portNVIC_SYSTICK_PRI;

	/* Start the timer that generates the tick ISR.  Interrupts are disabled
	here already. */
	prvSetupTimerInterrupt();
	
	/* Start the first task. */
	prvSetPSP( 0 );
	prvSetMSP( *((unsigned portLONG *) 0 ) );
	*(portNVIC_INT_CTRL) |= portNVIC_PENDSVSET;

	/* Enable interrupts */
	portENABLE_INTERRUPTS();

	/* Should not get here! */
	return 0;
}
/*-----------------------------------------------------------*/

void vPortEndScheduler( void )
{
	/* It is unlikely that the CM3 port will require this function as there
	is nothing to return to.  */
}
/*-----------------------------------------------------------*/

void vPortYieldFromISR( void )
{
	/* Set a PendSV to request a context switch. */
	*(portNVIC_INT_CTRL) |= portNVIC_PENDSVSET;

	/* This function is also called in response to a Yield(), so we want
	the yield to occur immediately. */
	portENABLE_INTERRUPTS();
}
/*-----------------------------------------------------------*/

void vPortEnterCritical( void )
{
	portDISABLE_INTERRUPTS();
	uxCriticalNesting++;
}
/*-----------------------------------------------------------*/

void vPortExitCritical( void )
{
	uxCriticalNesting--;
	if( uxCriticalNesting == 0 )
	{
		portENABLE_INTERRUPTS();
	}
}
/*-----------------------------------------------------------*/

void xPortPendSVHandler( void )
{
	/* Start first task if the stack has not yet been setup. */
	__asm volatile
	( 
	"	mrs r0, psp						\n"
	"	cbz r0, no_save					\n"
	"									\n"	/* Save the context into the TCB. */					
	"	sub r0, #0x20					\n"
	"	stm r0, {r4-r11}				\n"
	"	nop								\n"
	"	sub r0, #0x04					\n"
	"	ldr r1, uxCriticalNestingConst	\n"
	"	ldr r1, [r1]					\n"
	"	stm r0, {r1}					\n"
	"	ldr r1, pxCurrentTCBConst		\n"
	"	ldr r1, [r1]					\n"
	"	str r0, [r1]					\n"
	"									\n"
	"no_save:\n"	
	"	ldr r0, vTaskSwitchContextConst	\n"	/* Find the task to execute. */
	"	push {r14}						\n"
	"	cpsid i							\n"
	"	blx r0							\n"
	"	cpsie i							\n"
	"	pop {r14}						\n"
	"									\n"	/* Restore the context. */	
	"	ldr r1, pxCurrentTCBConst		\n"
	"	ldr r1, [r1]					\n"
	"	ldr r0, [r1]					\n"
	"	ldm r0, {r1, r4-r11}			\n"
	"	nop								\n"
	"	ldr r2, uxCriticalNestingConst	\n"
	"	str r1, [r2]					\n"
	"	add r0, #0x24					\n"
	"	msr psp, r0						\n"
	"	orr r14, #0xd					\n"
	"									\n"	/* Exit with interrupts in the state required by the task. */	
	"	cbnz r1, sv_disable_interrupts	\n"
	"	bx r14							\n"
	"									\n"
	"sv_disable_interrupts:				\n"
	"	cpsid i							\n"
	"	bx r14							\n"
	"									\n"
	"	.align 2						\n"
	"vTaskSwitchContextConst: .word vTaskSwitchContext	\n"
	"pxCurrentTCBConst: .word pxCurrentTCB				\n"
	"uxCriticalNestingConst: .word uxCriticalNesting	\n"
	);
}
/*-----------------------------------------------------------*/

void xPortSysTickHandler( void )
{
	extern void vTaskIncrementTick( void );
	extern void vPortYieldFromISR( void );

	/* Call the scheduler tick function. */
	__asm volatile
	( 
	"	ldr r0, vTaskIncrementTickConst		\n"
	"	push {r14}							\n"
	"	cpsid i								\n"
	"	blx r0								\n"
	"	cpsie i								\n"
	"	pop {r14}" 
	);

	/* If using preemption, also force a context switch. */
	#if configUSE_PREEMPTION == 1
	__asm volatile
	( 
	"	push {r14}							\n"
	"	ldr r0, vPortYieldFromISRConst2		\n"
	"	blx r0								\n"
	"	pop {r14}" 
	);
	#endif

	/* Exit with interrupts in the correct state. */
	__asm volatile
	(
	"    ldr r2, uxCriticalNestingConst2	\n" 
	"    ldr r2, [r2]						\n"
	"    cbnz r2, tick_disable_interrupts	\n"
	"    bx r14" 
	);

   __asm volatile
   (
	"tick_disable_interrupts:				\n"
	"    cpsid i							\n"
	"    bx r14								\n"
	"										\n"
	"	.align 2							\n"
	"vPortYieldFromISRConst2: .word vPortYieldFromISR\n"
	"vTaskIncrementTickConst: .word vTaskIncrementTick\n" 
	"uxCriticalNestingConst2: .word uxCriticalNesting"
	);
}
/*-----------------------------------------------------------*/

/*
 * Setup the systick timer to generate the tick interrupts at the required
 * frequency.
 */
void prvSetupTimerInterrupt( void )
{
	/* Configure SysTick to interrupt at the requested rate. */
	*(portNVIC_SYSTICK_LOAD) = configCPU_CLOCK_HZ / configTICK_RATE_HZ;
	*(portNVIC_SYSTICK_CTRL) = portNVIC_SYSTICK_CLK | portNVIC_SYSTICK_INT | portNVIC_SYSTICK_ENABLE;
}


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线中文字幕一区二区| 成人激情动漫在线观看| 国产女主播在线一区二区| 91福利国产精品| 麻豆精品久久久| 日韩毛片精品高清免费| 久久综合久久99| 欧美高清视频在线高清观看mv色露露十八 | 亚洲欧美色一区| 精品欧美一区二区在线观看| 91蝌蚪porny九色| 国产精品中文字幕一区二区三区| 亚洲一区精品在线| 中文字幕一区二区三区乱码在线 | 欧美欧美午夜aⅴ在线观看| 成人免费高清视频| 极品尤物av久久免费看| 日韩中文字幕一区二区三区| 中文字幕在线不卡视频| 国产亚洲视频系列| 日韩一区二区三区视频| 欧美日韩精品一区二区天天拍小说| 成人激情免费视频| 大胆亚洲人体视频| 国模一区二区三区白浆| 麻豆高清免费国产一区| 日本午夜精品视频在线观看| 亚洲成人动漫精品| 亚洲激情在线播放| 亚洲日本在线a| 中文字幕一区二区三| 国产精品免费免费| 国产精品色在线| 中文字幕亚洲在| 国产精品无圣光一区二区| 中文字幕国产一区| 国产精品情趣视频| 成人免费在线视频观看| 亚洲欧洲韩国日本视频| 一区在线中文字幕| 亚洲日本护士毛茸茸| 亚洲色大成网站www久久九九| 日韩毛片精品高清免费| 亚洲免费三区一区二区| 亚洲一区二区在线免费观看视频| 亚洲一区二区三区四区在线观看| 亚洲午夜一区二区| 天天色综合成人网| 麻豆91在线播放| 精品一区二区三区的国产在线播放| 久久丁香综合五月国产三级网站| 经典三级在线一区| 国产电影一区二区三区| 国产成人福利片| 91麻豆福利精品推荐| 欧美三日本三级三级在线播放| 欧美在线短视频| 91精品久久久久久久91蜜桃| 日韩免费成人网| 久久久蜜桃精品| 欧美性色黄大片| 欧美老肥妇做.爰bbww| 91精品国产福利在线观看| 精品国产一二三区| 国产精品视频第一区| 亚洲一区二区成人在线观看| 青青草伊人久久| 成人做爰69片免费看网站| 91亚洲精华国产精华精华液| 欧美日韩精品系列| 久久影音资源网| 亚洲少妇屁股交4| 日本欧美肥老太交大片| 国产91高潮流白浆在线麻豆 | 91精品国产麻豆国产自产在线| 欧美电影免费观看完整版| 亚洲国产精品成人综合| 亚洲影院免费观看| 国产一级精品在线| 日本高清成人免费播放| 欧美mv和日韩mv国产网站| 国产精品成人一区二区三区夜夜夜| 亚洲一区二区三区四区的 | 日本视频免费一区| 久久国产夜色精品鲁鲁99| 青青草精品视频| 国产精品资源站在线| 99精品欧美一区二区三区小说| 欧美精品第1页| 中文字幕在线观看不卡| 五月天中文字幕一区二区| 国产成人啪午夜精品网站男同| 在线这里只有精品| 精品88久久久久88久久久| 一区二区在线电影| 国产精品一级片在线观看| 欧美日韩三级在线| 中文字幕乱码久久午夜不卡| 日产欧产美韩系列久久99| 91在线观看视频| 久久综合狠狠综合久久激情| 亚洲午夜成aⅴ人片| 成人动漫在线一区| 欧美zozo另类异族| 污片在线观看一区二区| 91麻豆福利精品推荐| 久久久99免费| 免费视频最近日韩| 欧美日韩免费在线视频| 亚洲欧洲精品一区二区精品久久久| 亚洲自拍另类综合| 亚洲图片欧美激情| 狠狠色伊人亚洲综合成人| 色狠狠一区二区| 中文一区二区完整视频在线观看| 奇米在线7777在线精品| 欧美综合在线视频| 国产精品第四页| 国产 欧美在线| 久久青草欧美一区二区三区| 日本不卡123| 欧美日本精品一区二区三区| 亚洲激情五月婷婷| 99久久精品国产毛片| 日本一区二区三区四区在线视频| 久久精品国产第一区二区三区| 欧美日韩国产综合久久| 亚洲一区二区三区在线看| 色综合久久久久综合| 中文字幕一区二区在线播放| 波多野结衣视频一区| 欧美国产精品劲爆| 成人福利视频网站| 中文字幕在线不卡一区二区三区| 成人精品国产福利| 日韩理论片在线| 色偷偷一区二区三区| 亚洲精品乱码久久久久久日本蜜臀| 99视频精品免费视频| 欧美一卡二卡三卡| 国产精品色呦呦| 成人精品一区二区三区中文字幕 | 欧美午夜免费电影| 亚洲一二三四在线| 欧美日韩国产一二三| 亚洲成人黄色小说| 51精品视频一区二区三区| 日韩高清不卡一区二区三区| 欧美一区二区日韩一区二区| 麻豆成人在线观看| 久久久久综合网| 9人人澡人人爽人人精品| 亚洲男人的天堂一区二区| 色哟哟日韩精品| 亚洲成av人**亚洲成av**| 91麻豆精品国产91久久久久久 | 国产91精品一区二区| 国产精品久久久久婷婷| 色天天综合色天天久久| 午夜久久电影网| 久久亚洲一区二区三区四区| 成人午夜视频在线观看| 亚洲精品久久久蜜桃| 欧美放荡的少妇| 国产自产v一区二区三区c| 国产精品私人影院| 欧美色欧美亚洲另类二区| 久久99热这里只有精品| 国产精品久久网站| 欧美日韩一二区| 国产成人夜色高潮福利影视| 亚洲欧美日韩国产综合在线| 91麻豆精品91久久久久同性| 国产成人精品一区二区三区四区 | 亚洲欧洲一区二区三区| 欧美日韩另类一区| 国产美女精品人人做人人爽| 久久99深爱久久99精品| 国产精品麻豆99久久久久久| 欧美群妇大交群的观看方式| 国产一区二区三区蝌蚪| 一区二区三区产品免费精品久久75| 3d动漫精品啪啪一区二区竹菊| 国产成人日日夜夜| 午夜精品福利久久久| 欧美国产综合一区二区| 欧美电影在哪看比较好| 夫妻av一区二区| 日本欧美一区二区三区乱码| 中文字幕一区av| 精品国产在天天线2019| 91国产视频在线观看| 国产精品一区二区视频| 亚洲成人黄色小说| 一色屋精品亚洲香蕉网站| 26uuu另类欧美亚洲曰本| 欧美午夜影院一区| 不卡av电影在线播放| 黑人巨大精品欧美黑白配亚洲| 亚洲午夜影视影院在线观看|