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

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

?? port.c

?? freertosV4.40 是一種small的嵌入式系統(tǒng)。利于嵌入式開好者入門學(xué)習(xí)嵌入式操作系統(tǒng)。通過對于源碼的學(xué)習(xí)可以很好的掌握freertos的運(yùn)行機(jī)制。
?? 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.
	***************************************************************************
*/

/*
	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
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久一| 99精品欧美一区二区三区小说 | 91亚洲精品一区二区乱码| 国产亚洲一区二区三区在线观看| 国产在线精品一区二区不卡了| 欧美tk丨vk视频| 国产在线播放一区三区四| 国产亚洲精品久| 92国产精品观看| 亚洲va欧美va人人爽| 日韩欧美高清dvd碟片| 国产剧情一区二区| 亚洲女与黑人做爰| 欧美一区二区免费视频| 国产一区二区精品久久99| 国产精品三级电影| 欧美午夜影院一区| 久久99精品久久久久久国产越南| 国产三级久久久| 在线观看视频91| 极品少妇xxxx精品少妇| 中文字幕综合网| 日韩三级中文字幕| 粉嫩av一区二区三区在线播放 | 97久久人人超碰| 一区二区三区美女视频| 精品少妇一区二区三区日产乱码 | 久久久精品国产99久久精品芒果| av亚洲产国偷v产偷v自拍| 午夜天堂影视香蕉久久| 国产午夜精品久久| 在线播放91灌醉迷j高跟美女| 国产综合色产在线精品| 亚洲午夜久久久久久久久电影网 | 精品久久五月天| 91精品办公室少妇高潮对白| 韩国中文字幕2020精品| 一区二区三区中文字幕电影| 精品国精品自拍自在线| 在线免费观看日本一区| 国产激情视频一区二区在线观看 | 蜜臀av性久久久久av蜜臀妖精| 国产精品女主播av| 欧美一二三四区在线| 色狠狠一区二区| 成人午夜私人影院| 精品亚洲porn| 午夜精品久久一牛影视| 亚洲男女毛片无遮挡| 国产女人水真多18毛片18精品视频 | 国产精品电影一区二区三区| 69堂成人精品免费视频| 色诱亚洲精品久久久久久| 成人午夜电影久久影院| 欧美aa在线视频| 天天综合色天天| 亚洲综合久久久| 亚洲欧美一区二区视频| 久久精品人人做人人综合| 国产精品国产三级国产普通话99| 日韩免费视频线观看| 欧美日韩国产影片| 在线视频一区二区三| 99国产一区二区三精品乱码| 国产精品综合二区| 国模冰冰炮一区二区| 日韩中文字幕91| 天天操天天干天天综合网| 亚洲图片一区二区| 亚洲一区中文在线| 一区二区三区中文字幕精品精品 | 一区二区三区不卡视频| 专区另类欧美日韩| 亚洲乱码中文字幕综合| 中文字幕中文在线不卡住| 国产精品国产三级国产专播品爱网| 2023国产一二三区日本精品2022| 日韩欧美国产一区在线观看| 欧美一区二区三区系列电影| 欧美精品高清视频| 日韩欧美国产综合在线一区二区三区| 56国语精品自产拍在线观看| 日韩一区二区三区在线观看| 欧美一级国产精品| 久久亚洲影视婷婷| 欧美国产亚洲另类动漫| 国产精品超碰97尤物18| 亚洲欧美国产三级| 亚洲电影一级片| 婷婷成人激情在线网| 人人精品人人爱| 精品系列免费在线观看| 国产剧情一区在线| 91丨porny丨蝌蚪视频| 精品视频一区三区九区| 欧美一卡二卡在线观看| 精品处破学生在线二十三| 国产午夜精品一区二区三区视频 | 国产精品中文欧美| 99热在这里有精品免费| 欧美日韩亚洲另类| 日韩欧美成人一区| 国产精品美女久久久久久久网站| 亚洲日本在线a| 天天av天天翘天天综合网| 免费在线观看日韩欧美| 国产成人精品一区二| 91黄视频在线| 精品国产乱码久久久久久闺蜜| 中文在线一区二区| 五月激情丁香一区二区三区| 国产一区二区免费看| 日本二三区不卡| 欧美一级精品大片| 国产精品二三区| 美女尤物国产一区| 不卡在线视频中文字幕| 欧美日韩视频不卡| 中文av字幕一区| 日韩激情av在线| 97超碰欧美中文字幕| 日韩午夜av电影| 一区二区三区在线观看动漫| 经典三级在线一区| 欧美性一级生活| 欧美国产精品久久| 日韩福利视频网| 色中色一区二区| 国产清纯在线一区二区www| 性欧美疯狂xxxxbbbb| 成人av网站免费| 日韩欧美你懂的| 亚洲综合久久av| 91精品视频网| 亚洲欧美色图小说| 国产精品一区二区在线观看不卡 | 欧美大白屁股肥臀xxxxxx| 亚洲人成人一区二区在线观看 | 欧美一级片在线看| 一区二区三区国产豹纹内裤在线| 国内精品久久久久影院色| 欧美日韩综合不卡| 成人欧美一区二区三区在线播放| 久久99精品国产| 91精品蜜臀在线一区尤物| 一二三区精品视频| voyeur盗摄精品| 国产日韩欧美精品在线| 韩国女主播一区| 51精品秘密在线观看| 亚洲高清视频在线| 在线精品视频免费观看| 亚洲视频小说图片| 成人激情文学综合网| 国产视频一区在线播放| 韩国一区二区在线观看| 精品少妇一区二区三区免费观看 | 久久亚洲影视婷婷| 久久精品国产第一区二区三区| 欧美欧美欧美欧美首页| 亚洲一级片在线观看| 欧美色国产精品| 亚洲午夜精品17c| 欧美色图12p| 婷婷开心激情综合| 欧美精品tushy高清| 视频一区二区中文字幕| 欧美精品精品一区| 日本欧美肥老太交大片| 91精品国产综合久久久久久| 婷婷六月综合网| 日韩欧美aaaaaa| 国产在线精品一区二区三区不卡| 精品毛片乱码1区2区3区| 九色|91porny| 久久久亚洲精品石原莉奈| 国产成人综合亚洲91猫咪| 欧美国产乱子伦| 91亚洲大成网污www| 一区二区高清免费观看影视大全| 欧美亚洲综合网| 日本午夜一区二区| 精品欧美乱码久久久久久1区2区| 狠狠色狠狠色综合日日91app| 久久久蜜桃精品| 972aa.com艺术欧美| 亚洲二区视频在线| 欧美成人video| 不卡一卡二卡三乱码免费网站 | 亚洲一区二区三区四区在线| 欧美精品自拍偷拍| 韩国精品主播一区二区在线观看| 国产免费久久精品| 色呦呦网站一区| 美女视频第一区二区三区免费观看网站| 日韩亚洲欧美在线| 成人午夜免费av| 亚洲大片一区二区三区| 26uuu欧美| 欧美综合在线视频|