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

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

?? port.c

?? FreeRTOS V4.2.1,增加了AVR32 UC3 和 LPC2368 的支持
?? C
字號:
/*
	FreeRTOS.org V4.2.1 - Copyright (C) 2003-2007 Richard Barry.

	This file is part of the FreeRTOS distribution.

	FreeRTOS 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 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; 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, 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.
	***************************************************************************
*/

/*-----------------------------------------------------------
 * Implementation of functions defined in portable.h for the ST STR91x ARM7
 * port.
 *----------------------------------------------------------*/

/* Library includes. */
#include "91x_lib.h"

/* Standard includes. */
#include <stdlib.h>

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

/* Constants required to setup the initial stack. */
#ifndef _RUN_TASK_IN_ARM_MODE_
	#define portINITIAL_SPSR			( ( portSTACK_TYPE ) 0x3f ) /* System mode, THUMB mode, interrupts enabled. */
#else
	#define portINITIAL_SPSR 			( ( portSTACK_TYPE ) 0x1f ) /* System mode, ARM mode, interrupts enabled. */
#endif
#define portINSTRUCTION_SIZE			( ( portSTACK_TYPE ) 4 )

/* Constants required to handle critical sections. */
#define portNO_CRITICAL_NESTING 		( ( unsigned portLONG ) 0 )


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

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

/* ulCriticalNesting will get set to zero when the first task starts.  It
cannot be initialised to 0 as this will cause interrupts to be enabled
during the kernel initialisation process. */
unsigned portLONG ulCriticalNesting = ( unsigned portLONG ) 9999;

/* Tick interrupt routines for cooperative and preemptive operation
respectively.  The preemptive version is not defined as __irq as it is called
from an asm wrapper function. */
__arm __irq void vPortNonPreemptiveTick( void );
void WDG_IRQHandler( void );

/* VIC interrupt default handler. */
static void prvDefaultHandler( void );

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

/*
 * Initialise the stack of a task to look exactly as if a call to
 * portSAVE_CONTEXT had been called.
 *
 * See header file for description.
 */
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
	portSTACK_TYPE *pxOriginalTOS;

	pxOriginalTOS = pxTopOfStack;

	/* Setup the initial stack of the task.  The stack is set exactly as
	expected by the portRESTORE_CONTEXT() macro. */

	/* First on the stack is the return address - which in this case is the
	start of the task.  The offset is added to make the return address appear
	as it would within an IRQ ISR. */
	*pxTopOfStack = ( portSTACK_TYPE ) pxCode + portINSTRUCTION_SIZE;		
	pxTopOfStack--;

	*pxTopOfStack = ( portSTACK_TYPE ) 0xaaaaaaaa;	/* R14 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) pxOriginalTOS; /* Stack used when task starts goes in R13. */
	pxTopOfStack--;
	*pxTopOfStack = ( portSTACK_TYPE ) 0x12121212;	/* R12 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x11111111;	/* R11 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x10101010;	/* R10 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x09090909;	/* R9 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x08080808;	/* R8 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x07070707;	/* R7 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x06060606;	/* R6 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x05050505;	/* R5 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x04040404;	/* R4 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x03030303;	/* R3 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x02020202;	/* R2 */
	pxTopOfStack--;	
	*pxTopOfStack = ( portSTACK_TYPE ) 0x01010101;	/* R1 */
	pxTopOfStack--;	

	/* When the task starts is will expect to find the function parameter in
	R0. */
	*pxTopOfStack = ( portSTACK_TYPE ) pvParameters; /* R0 */
	pxTopOfStack--;

	/* The status register is set for system mode, with interrupts enabled. */
	*pxTopOfStack = ( portSTACK_TYPE ) portINITIAL_SPSR;
	pxTopOfStack--;

	/* Interrupt flags cannot always be stored on the stack and will
	instead be stored in a variable, which is then saved as part of the
	tasks context. */
	*pxTopOfStack = portNO_CRITICAL_NESTING;

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

portBASE_TYPE xPortStartScheduler( void )
{
extern void vPortStartFirstTask( void );

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

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

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

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

/* This function is called from an asm wrapper, so does not require the __irq
keyword. */
void WDG_IRQHandler( void )
{
	/* Increment the tick counter. */
	vTaskIncrementTick();

	#if configUSE_PREEMPTION == 1
		/* The new tick value might unblock a task.  Ensure the highest task that
		is ready to execute is the task that will execute when the tick ISR
		exits. */
		vTaskSwitchContext();
	#endif
		
	/* Clear the interrupt in the watchdog. */
	WDG->SR &= ~0x0001;
}
/*-----------------------------------------------------------*/

#ifndef abs
	#define abs(x) ((x)>0 ? (x) : -(x))
#endif

static void prvFindFactors(u32 n, u16 *a, u32 *b)
{
	/* This function is copied from the ST STR7 library and is
	copyright STMicroelectronics.  Reproduced with permission. */

	u32 b0;
	u16 a0;
	long err, err_min=n;

	*a = a0 = ((n-1)/65536ul) + 1;
	*b = b0 = n / *a;

	for (; *a <= 256; (*a)++)
	{
		*b = n / *a;
		err = (long)*a * (long)*b - (long)n;
		if (abs(err) > (*a / 2))
		{
			(*b)++;
			err = (long)*a * (long)*b - (long)n;
		}
		if (abs(err) < abs(err_min))
		{
			err_min = err;
			a0 = *a;
			b0 = *b;
			if (err == 0) break;
		}
	}

	*a = a0;
	*b = b0;
}
/*-----------------------------------------------------------*/

static void prvSetupTimerInterrupt( void )
{
WDG_InitTypeDef xWdg;
unsigned portSHORT a;
unsigned portLONG n = configCPU_PERIPH_HZ / configTICK_RATE_HZ, b;

	/* Configure the watchdog as a free running timer that generates a
	periodic interrupt. */

	SCU_APBPeriphClockConfig( __WDG, ENABLE );
	WDG_DeInit();
	WDG_StructInit(&xWdg);
	prvFindFactors( n, &a, &b );
	xWdg.WDG_Prescaler = a - 1;
	xWdg.WDG_Preload = b - 1;
	WDG_Init( &xWdg );
	WDG_ITConfig(ENABLE);
	
	/* Configure the VIC for the WDG interrupt. */
	VIC_Config( WDG_ITLine, VIC_IRQ, 10 );
	VIC_ITCmd( WDG_ITLine, ENABLE );
	
	/* Install the default handlers for both VIC's. */
	VIC0->DVAR = ( unsigned portLONG ) prvDefaultHandler;
	VIC1->DVAR = ( unsigned portLONG ) prvDefaultHandler;
	
	WDG_Cmd(ENABLE);
}

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

__arm __interwork void vPortEnterCritical( void )
{
	/* Disable interrupts first! */
	portDISABLE_INTERRUPTS();

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

__arm __interwork 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 )
		{
			portENABLE_INTERRUPTS();
		}
	}
}
/*-----------------------------------------------------------*/

static void prvDefaultHandler( void )
{
}





?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品在线网站| 日韩一区精品视频| 色婷婷精品久久二区二区蜜臀av | 91传媒视频在线播放| 一区二区三区成人在线视频| 欧美日韩国产一级片| 日本v片在线高清不卡在线观看| 美洲天堂一区二卡三卡四卡视频| 日韩欧美国产综合一区| 国产精品一区二区久久不卡 | 欧美视频一区二区三区四区| 亚洲va韩国va欧美va精品| 日韩欧美视频在线| 国产成人aaa| 一区二区在线观看视频在线观看| 欧美日韩高清在线播放| 精品亚洲国产成人av制服丝袜| 国产农村妇女精品| 色综合一个色综合亚洲| 日韩av一区二区在线影视| 久久日一线二线三线suv| av激情综合网| 视频一区二区欧美| 国产日产欧美一区二区视频| 在线日韩一区二区| 激情五月婷婷综合| 91视频xxxx| 日韩av中文字幕一区二区三区| 久久久青草青青国产亚洲免观| 91亚洲精华国产精华精华液| 日韩在线一二三区| 欧美国产日本视频| 欧美日韩一区二区三区视频| 国产一区二区三区视频在线播放| 亚洲丝袜精品丝袜在线| 欧美一区二区三区性视频| 粉嫩一区二区三区性色av| 亚洲国产精品久久久久婷婷884 | 亚洲一区二区3| 久久先锋影音av鲁色资源网| 日本久久电影网| 美女一区二区三区| 亚洲靠逼com| 久久这里只精品最新地址| 在线观看日韩高清av| 国产精品一区二区x88av| 亚洲五码中文字幕| 成人一区二区三区视频| 日韩成人午夜精品| 中文字幕一区二区三区av| 日韩一区二区电影| 色婷婷一区二区| 国产精品系列在线观看| 亚洲国产sm捆绑调教视频 | 日韩精品免费视频人成| 中文字幕av资源一区| 欧美一区二区三区小说| 色综合一区二区| 国产成人在线色| 秋霞电影网一区二区| 亚洲欧美国产毛片在线| 国产丝袜欧美中文另类| 日韩一区二区中文字幕| 在线观看日韩av先锋影音电影院| 国产不卡在线一区| 蜜桃久久久久久久| 亚洲国产va精品久久久不卡综合| 国产精品免费久久久久| 欧美大片拔萝卜| av午夜一区麻豆| 久久成人av少妇免费| 一区二区三区在线免费| 国产目拍亚洲精品99久久精品| 91精品国产aⅴ一区二区| 91在线观看美女| 国产精品一区三区| 蜜桃久久久久久| 婷婷久久综合九色综合绿巨人 | 琪琪久久久久日韩精品| 伊人夜夜躁av伊人久久| 国产精品免费看片| 国产欧美精品日韩区二区麻豆天美| 欧美大片顶级少妇| 日韩一区二区精品在线观看| 欧美日韩国产成人在线91| 91国产视频在线观看| 91在线高清观看| 99久久久国产精品| 白白色 亚洲乱淫| 成人一区二区三区视频| 国产91精品入口| 国产成人精品亚洲日本在线桃色| 国产麻豆成人精品| 国产一区二区三区最好精华液| 久久国产三级精品| 麻豆精品久久精品色综合| 日韩成人免费电影| 日韩av在线播放中文字幕| 欧美疯狂性受xxxxx喷水图片| 欧美性大战久久久| 欧美在线观看禁18| 一本久久a久久精品亚洲| 中文在线一区二区| 久久综合视频网| 精品国产乱码久久久久久1区2区| 91精品一区二区三区久久久久久 | 色一情一乱一乱一91av| 99re6这里只有精品视频在线观看| 风流少妇一区二区| 不卡一区在线观看| 91在线一区二区| 色一情一乱一乱一91av| 欧美亚洲动漫精品| 欧美日韩亚洲丝袜制服| 欧美日本在线播放| 6080国产精品一区二区| 欧美一级黄色录像| 精品久久99ma| 国产亚洲1区2区3区| 亚洲国产精品ⅴa在线观看| 亚洲欧洲在线观看av| 亚洲欧美日韩电影| 欧美三级韩国三级日本一级| 欧美福利视频导航| 精品久久国产字幕高潮| 国产日韩欧美精品电影三级在线| 中文一区在线播放| 亚洲欧美日韩国产成人精品影院| 亚洲综合成人网| 无码av免费一区二区三区试看 | 亚洲一区二区3| 日韩在线一区二区| 国产一区视频在线看| 成人精品在线视频观看| 日本久久电影网| 欧美一区二区免费观在线| 久久伊99综合婷婷久久伊| 国产精品九色蝌蚪自拍| 亚洲一区二区av电影| 老司机精品视频线观看86| 国产成a人亚洲精品| 色先锋资源久久综合| 欧美一区二区三区免费| 国产日韩欧美综合一区| 一区二区三区在线观看网站| 免费在线欧美视频| 国产iv一区二区三区| 91成人看片片| 精品少妇一区二区三区在线视频| 国产精品网曝门| 亚洲成人免费视| 国内精品在线播放| 91色|porny| 91精品久久久久久久91蜜桃| 日本一区二区三区视频视频| 一区二区三区91| 激情欧美一区二区| 91官网在线观看| 久久99久久99精品免视看婷婷| 成人激情免费电影网址| 欧美男女性生活在线直播观看| 2021中文字幕一区亚洲| 亚洲精品午夜久久久| 精品在线播放免费| 色香色香欲天天天影视综合网| 日韩视频在线一区二区| 国产精品国产精品国产专区不片| 五月婷婷综合网| 成人av小说网| 91精品国产麻豆| 亚洲私人黄色宅男| 国产自产高清不卡| 欧美三级电影网| 中文字幕av一区二区三区免费看 | 免费成人av资源网| 97久久精品人人做人人爽50路| 日韩欧美国产不卡| 一区二区三区日韩在线观看| 国产一区二区不卡| 欧美三日本三级三级在线播放| 国产日韩欧美精品在线| 日韩福利电影在线| 99精品黄色片免费大全| 精品处破学生在线二十三| 一区二区成人在线| 成人免费毛片片v| 日韩欧美高清在线| 欧美日本韩国一区二区三区视频| 中文字幕高清一区| 久久精品国产秦先生| 在线观看区一区二| 国产精品久久网站| 久久99精品国产.久久久久久| 欧美亚洲国产一区二区三区va| 国产精品美女久久久久久| 久久99精品国产麻豆婷婷洗澡| 欧美三级蜜桃2在线观看| 亚洲视频免费在线观看| 国产成人精品免费在线| 日韩三级在线观看|