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

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

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

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

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

/* For backward compatibility, ensure configKERNEL_INTERRUPT_PRIORITY is
defined.  The value should also ensure backward compatibility.
FreeRTOS.org versions prior to V4.4.0 did not include this definition. */
#ifndef configKERNEL_INTERRUPT_PRIORITY
	#define configKERNEL_INTERRUPT_PRIORITY 255
#endif

/* 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_SYSTICK_CLK		0x00000004
#define portNVIC_SYSTICK_INT		0x00000002
#define portNVIC_SYSTICK_ENABLE		0x00000001
#define portNVIC_PENDSVSET			0x10000000
#define portNVIC_PENDSV_PRI			( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 16 )
#define portNVIC_SYSTICK_PRI		( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 24 )

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

/* The priority used by the kernel is assigned to a variable to make access
from inline assembler easier. */
const unsigned portLONG ulKernelPriority = configKERNEL_INTERRUPT_PRIORITY;

/* Each task maintains its own interrupt status in the critical nesting
variable. */
static 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 );
void vPortSVCHandler( void ) __attribute__ (( naked ));

/*
 * Start first task is a separate function so it can be tested in isolation.
 */
void vPortStartFirstTask( void ) __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 = 0;	/* LR */
	pxTopOfStack -= 5;	/* R12, R3, R2 and R1. */
	*pxTopOfStack = ( portSTACK_TYPE ) pvParameters;	/* R0 */
	pxTopOfStack -= 8;	/* R11, R10, R9, R8, R7, R6, R5 and R4. */

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

void vPortSVCHandler( void )
{
	asm volatile (
					"	ldr	r3, pxCurrentTCBConst2		\n" /* Restore the context. */
					"	ldr r1, [r3]					\n" /* Use pxCurrentTCBConst to get the pxCurrentTCB address. */
					"	ldr r0, [r1]					\n" /* The first item in pxCurrentTCB is the task top of stack. */
					"	ldmia r0!, {r4-r11}				\n" /* Pop the registers that are not automatically saved on exception entry and the critical nesting count. */
					"	msr psp, r0						\n" /* Restore the task stack pointer. */
					"	mov r0, #0 						\n"
					"	msr	basepri, r0					\n"
					"	orr r14, #0xd					\n"
					"	bx r14							\n"
					"									\n"
					"	.align 2						\n"
					"pxCurrentTCBConst2: .word pxCurrentTCB				\n"
				);
}
/*-----------------------------------------------------------*/

void vPortStartFirstTask( void )
{
	asm volatile(
					" ldr r0, =0xE000ED08 	\n" /* Use the NVIC offset register to locate the stack. */
					" ldr r0, [r0] 			\n"
					" ldr r0, [r0] 			\n"
					" msr msp, r0			\n" /* Set the msp back to the start of the stack. */
					" svc 0					\n" /* System call to start first task. */
				);
}
/*-----------------------------------------------------------*/

/*
 * See header file for description.
 */
portBASE_TYPE xPortStartScheduler( void )
{
	/* Make PendSV, CallSV and SysTick the same priroity as the kernel. */
	*(portNVIC_SYSPRI2) |= portNVIC_PENDSV_PRI;
	*(portNVIC_SYSPRI2) |= portNVIC_SYSTICK_PRI;

	/* Start the timer that generates the tick ISR.  Interrupts are disabled
	here already. */
	prvSetupTimerInterrupt();

	/* Initialise the critical nesting count ready for the first task. */
	uxCriticalNesting = 0;

	/* Start the first task. */
	vPortStartFirstTask();

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

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

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

void xPortPendSVHandler( void )
{
	/* This is a naked function. */

	__asm volatile
	(
	"	mrs r0, psp							\n"
	"										\n"
	"	ldr	r3, pxCurrentTCBConst			\n" /* Get the location of the current TCB. */
	"	ldr	r2, [r3]						\n"
	"										\n"
	"	stmdb r0!, {r4-r11}					\n" /* Save the remaining registers. */
	"	str r0, [r2]						\n" /* Save the new top of stack into the first member of the TCB. */
	"										\n"
	"	stmdb sp!, {r3, r14}				\n"
	"	mov r0, %0							\n"
	"	msr basepri, r0						\n"
	"	bl vTaskSwitchContext				\n"
	"	mov r0, #0							\n"
	"	msr basepri, r0						\n"			
	"	ldmia sp!, {r3, r14}				\n"
	"										\n"	/* Restore the context, including the critical nesting count. */
	"	ldr r1, [r3]						\n"
	"	ldr r0, [r1]						\n" /* The first item in pxCurrentTCB is the task top of stack. */
	"	ldmia r0!, {r4-r11}					\n" /* Pop the registers. */
	"	msr psp, r0							\n"
	"	bx r14								\n"
	"										\n"
	"	.align 2							\n"
	"pxCurrentTCBConst: .word pxCurrentTCB	\n"
	::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY)
	);
}
/*-----------------------------------------------------------*/

void xPortSysTickHandler( void )
{
unsigned portLONG ulDummy;

	/* If using preemption, also force a context switch. */
	#if configUSE_PREEMPTION == 1
		*(portNVIC_INT_CTRL) = portNVIC_PENDSVSET;
	#endif

	ulDummy = portSET_INTERRUPT_MASK_FROM_ISR();
	{
		vTaskIncrementTick();
	}
	portCLEAR_INTERRUPT_MASK_FROM_ISR( ulDummy );
}
/*-----------------------------------------------------------*/

/*
 * 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 ) - 1UL;
	*(portNVIC_SYSTICK_CTRL) = portNVIC_SYSTICK_CLK | portNVIC_SYSTICK_INT | portNVIC_SYSTICK_ENABLE;
}
/*-----------------------------------------------------------*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜乳av一区二区| 国产宾馆实践打屁股91| 五月天激情综合| 国产毛片精品视频| 日本电影亚洲天堂一区| 精品国产凹凸成av人网站| 亚洲特级片在线| 国产精品中文欧美| 欧美日韩精品一二三区| 国产精品欧美久久久久一区二区| 日韩影院在线观看| 色综合久久九月婷婷色综合| 精品久久免费看| 一区二区三区美女| 成人黄色国产精品网站大全在线免费观看| 欧美日韩国产123区| 中文字幕日韩欧美一区二区三区| 黑人巨大精品欧美一区| 欧美日韩高清一区二区不卡| 亚洲视频在线观看三级| 国产一区999| 日韩女优制服丝袜电影| 亚洲一区二区偷拍精品| 色香蕉成人二区免费| 日本一区二区三区在线不卡| 精品一区二区三区免费| 91精品国产一区二区三区蜜臀| 亚洲精品一二三| 色综合中文字幕国产 | 图片区小说区区亚洲影院| 99r国产精品| 国产精品福利av| 丁香另类激情小说| 国产欧美一区二区精品性色 | 日本视频中文字幕一区二区三区 | 国产九色sp调教91| 欧美精品一区二区三区久久久 | 国产欧美日韩精品在线| 国内外成人在线| 久久先锋影音av| 国产一区二区在线免费观看| 精品国产一区二区三区不卡| 国产一区二区三区在线观看免费视频| 91精品国产综合久久福利| www.久久久久久久久| 国产精品青草综合久久久久99| 国产成人综合亚洲91猫咪| 久久久久久久精| 成人激情小说网站| 最新不卡av在线| 欧美影视一区在线| 午夜精品久久久久影视| 日韩一级成人av| 国产一区二区三区四区在线观看| 国产亚洲va综合人人澡精品| 国产91精品精华液一区二区三区 | 欧美一区二区三区公司| 奇米精品一区二区三区在线观看| 日韩欧美www| 国产成人av福利| 亚洲女同ⅹxx女同tv| 欧美日韩免费观看一区三区| 美女视频网站黄色亚洲| 久久精品一区八戒影视| 97国产精品videossex| 亚洲成人tv网| 久久久午夜电影| 99久久夜色精品国产网站| 亚洲chinese男男1069| 精品国产伦一区二区三区观看体验| 国产sm精品调教视频网站| 亚洲另类春色校园小说| 欧美α欧美αv大片| 波波电影院一区二区三区| 亚洲成av人片观看| 国产欧美综合色| 911精品国产一区二区在线| 韩国v欧美v亚洲v日本v| 亚洲人成人一区二区在线观看 | 国产乱人伦精品一区二区在线观看| 日韩美女啊v在线免费观看| 91精品国产91久久久久久最新毛片| 国产福利一区二区三区视频在线 | 日韩二区三区四区| 国产精品午夜在线观看| 在线不卡一区二区| 成人av在线播放网址| 婷婷开心久久网| 亚洲欧洲另类国产综合| 欧美va天堂va视频va在线| 色www精品视频在线观看| 九九热在线视频观看这里只有精品| 综合色天天鬼久久鬼色| 精品国产百合女同互慰| 欧美日韩国产小视频| k8久久久一区二区三区| 国内久久婷婷综合| 日日摸夜夜添夜夜添国产精品| 国产精品毛片无遮挡高清| 日韩欧美视频在线| 欧美影院午夜播放| 色综合久久综合| 成人精品鲁一区一区二区| 美国十次了思思久久精品导航| 亚洲影视资源网| 18欧美乱大交hd1984| 国产日韩精品久久久| 精品欧美一区二区三区精品久久| 在线播放91灌醉迷j高跟美女 | 99久久精品免费看国产免费软件| 精品影院一区二区久久久| 亚洲第一主播视频| 洋洋成人永久网站入口| 亚洲色图视频网| 亚洲视频综合在线| 国产精品麻豆视频| 国产欧美精品区一区二区三区 | 亚洲成人av中文| 亚洲精品乱码久久久久久久久 | 99精品视频在线播放观看| 国产成人精品免费网站| 国内成+人亚洲+欧美+综合在线| 日精品一区二区| 婷婷亚洲久悠悠色悠在线播放| 亚洲v中文字幕| 日韩电影在线观看电影| 日本不卡视频在线观看| 美女一区二区三区在线观看| 精品中文字幕一区二区| 国产真实精品久久二三区| 国产在线播放一区| 国产91精品露脸国语对白| 成人免费不卡视频| 91麻豆免费观看| 欧美日韩在线不卡| 91精品国产免费| 亚洲精品一区二区三区在线观看| 久久久无码精品亚洲日韩按摩| 中文字幕va一区二区三区| 综合激情成人伊人| 亚洲一区二区三区视频在线播放| 肉肉av福利一精品导航| 精品一区二区三区在线播放视频 | 亚洲激情网站免费观看| 亚洲第四色夜色| 久久精品国产一区二区| 国产成人精品免费视频网站| 色综合久久精品| 欧美一区二区在线看| 久久精品一区二区| 夜夜爽夜夜爽精品视频| 精品一区二区三区视频在线观看| 国产98色在线|日韩| 欧美在线啊v一区| 欧美电视剧免费全集观看| 国产视频视频一区| 亚洲二区在线观看| 国产又粗又猛又爽又黄91精品| 一本高清dvd不卡在线观看| 91精品中文字幕一区二区三区| 国产日韩欧美制服另类| 依依成人精品视频| 精品在线一区二区| 日本精品一区二区三区高清 | 豆国产96在线|亚洲| 欧美性大战久久久久久久蜜臀| 337p日本欧洲亚洲大胆精品| 中文字幕视频一区二区三区久| 日韩电影在线看| aaa亚洲精品| 337p粉嫩大胆噜噜噜噜噜91av | 91麻豆精品91久久久久久清纯| 国产精品午夜春色av| 日韩有码一区二区三区| av亚洲产国偷v产偷v自拍| 91精品欧美久久久久久动漫| 自拍视频在线观看一区二区| 精品午夜一区二区三区在线观看| 色综合激情五月| 欧美国产综合色视频| 亚洲超碰97人人做人人爱| 波多野结衣中文字幕一区二区三区| 日韩欧美另类在线| 亚洲一区二区三区激情| 丰满白嫩尤物一区二区| 日韩一区二区三| 亚洲第一狼人社区| 91免费版在线| 中文字幕不卡三区| 国产精品资源站在线| 欧美大片一区二区| 日韩电影在线看| 欧美久久久久久久久久| 一区二区三区不卡视频在线观看| 大桥未久av一区二区三区中文| 久久综合色婷婷| 99精品视频中文字幕| 日本一区免费视频| 国产精品自在欧美一区| 久久久久久久av麻豆果冻|