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

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

?? port.c

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

/*-----------------------------------------------------------
 * 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 )
{
}





?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品传媒入口麻豆| 日韩一区二区三区在线观看| 日韩精品欧美成人高清一区二区| 国产亚洲欧美在线| 欧美va亚洲va国产综合| 91精品国产日韩91久久久久久| 91视频一区二区| proumb性欧美在线观看| 成人不卡免费av| 国产乱码精品一区二区三区忘忧草| 日韩精品一级二级| 国产成人免费av在线| 日韩欧美久久久| 欧美色涩在线第一页| 在线免费观看日本欧美| 国产一区在线视频| 国产精品热久久久久夜色精品三区 | 一个色综合av| 国产精品正在播放| 欧美一区二区视频在线观看| 一区二区三区四区高清精品免费观看| 免费观看日韩av| 欧美少妇bbb| 1024亚洲合集| 国产a久久麻豆| 日韩精品一区二区三区视频 | 欧美在线色视频| 中文字幕不卡在线观看| 久久精品国产色蜜蜜麻豆| 欧美嫩在线观看| 亚洲一区二区在线播放相泽| 91免费视频观看| 国产精品沙发午睡系列990531| 久久精品国产精品亚洲红杏| 欧美一区二区日韩一区二区| 首页亚洲欧美制服丝腿| 欧美视频在线播放| 亚洲一区在线看| 在线观看成人小视频| 亚洲乱码中文字幕| av电影在线不卡| 国产精品久久精品日日| www.日韩在线| 国产精品久久久久久亚洲毛片| 国产精品一二三区| 国产亚洲综合在线| 国产成人av电影在线观看| 国产拍揄自揄精品视频麻豆| 高清不卡一区二区在线| 欧美国产精品一区| 成人免费黄色在线| 亚洲日本护士毛茸茸| 日本高清不卡一区| 亚洲国产欧美在线| 91麻豆精品国产91久久久久久久久| 午夜精品视频一区| 欧美大片国产精品| 国产夫妻精品视频| 中文字幕高清不卡| 99精品视频一区二区三区| 亚洲自拍偷拍图区| 欧美高清一级片在线| 激情综合色综合久久| 久久久久免费观看| 99久久99久久精品免费观看| 一区二区三区不卡在线观看| 欧美精品免费视频| 国产麻豆精品theporn| 中文字幕一区二区三区四区不卡| 一本色道a无线码一区v| 视频一区视频二区中文字幕| 欧美夫妻性生活| 国产一区二三区| 亚洲情趣在线观看| 日韩欧美一区二区三区在线| 国产91精品在线观看| 亚洲一级二级在线| 久久女同精品一区二区| 91尤物视频在线观看| 人人狠狠综合久久亚洲| 自拍偷拍亚洲激情| 日韩欧美国产一区在线观看| 成人精品视频.| 亚洲大片免费看| 国产校园另类小说区| 欧美精品电影在线播放| 国产99久久久国产精品免费看| 一区二区三区在线观看网站| 欧美电影免费观看高清完整版 | 日韩欧美国产成人一区二区| 不卡av在线免费观看| 美女一区二区在线观看| 亚洲色图欧洲色图婷婷| 久久一区二区视频| 91国偷自产一区二区三区观看| 韩国一区二区三区| 午夜欧美2019年伦理| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 成人欧美一区二区三区视频网页| 在线综合视频播放| 色哟哟国产精品免费观看| 国产一区二区在线观看免费| 香蕉加勒比综合久久| 国产精品卡一卡二卡三| 欧美精品一区二区三区在线 | 韩国欧美国产一区| 五月天欧美精品| 一区二区三区加勒比av| 中文在线一区二区| 久久精品人人做人人爽人人| 日韩视频在线观看一区二区| 欧美主播一区二区三区美女| 97久久人人超碰| 国产成人av一区二区三区在线 | 欧美浪妇xxxx高跟鞋交| 成人免费视频网站在线观看| 国产老女人精品毛片久久| 麻豆一区二区在线| 奇米精品一区二区三区四区| 亚洲午夜av在线| 一区二区高清在线| 亚洲精品视频自拍| 亚洲另类春色校园小说| 亚洲男同性恋视频| 亚洲色图视频网| 亚洲美女在线国产| 一区二区高清在线| 亚洲一区二区视频在线观看| 亚洲精品国产无套在线观| 亚洲精品国产a久久久久久| 亚洲三级久久久| 亚洲永久免费av| 亚洲不卡一区二区三区| 日韩精品成人一区二区在线| 日韩高清电影一区| 六月婷婷色综合| 九九在线精品视频| 国产精品白丝jk黑袜喷水| 成人综合在线观看| av在线不卡观看免费观看| 日本久久电影网| 欧美日韩亚洲国产综合| 日韩欧美一区二区视频| 久久久久国产精品厨房| 亚洲视频一二区| 亚洲电影一级黄| 捆绑紧缚一区二区三区视频| 国产成人久久精品77777最新版本| 国产成人精品免费| 在线视频欧美精品| 欧美一区二区日韩一区二区| 久久免费午夜影院| 亚洲色图在线播放| 美女在线视频一区| 不卡视频一二三四| 欧美日韩高清不卡| 久久久午夜精品| 一区二区欧美国产| 激情亚洲综合在线| 91福利在线观看| 久久综合久久综合久久| 洋洋av久久久久久久一区| 美脚の诱脚舐め脚责91| av一二三不卡影片| 51精品国自产在线| 国产精品毛片久久久久久久| 亚洲va韩国va欧美va| 国产激情视频一区二区在线观看| 91蝌蚪国产九色| 久久综合久久鬼色中文字| 亚洲小说欧美激情另类| 国产丶欧美丶日本不卡视频| 欧美视频一区在线| 国产网站一区二区| 视频一区二区三区入口| 91最新地址在线播放| 精品伦理精品一区| 亚洲国产美女搞黄色| 成人小视频在线观看| 欧美一区二区女人| 亚洲尤物在线视频观看| 成人午夜精品在线| 欧美成人女星排行榜| 亚洲第一精品在线| aa级大片欧美| 久久久久久免费| 日韩av电影免费观看高清完整版 | 91蜜桃传媒精品久久久一区二区| 制服丝袜中文字幕亚洲| 亚洲欧洲成人自拍| 国产精品一区二区视频| 欧美一区二区三区播放老司机| 亚洲精品中文在线影院| av在线不卡网| 国产午夜精品久久久久久久| 日韩av中文字幕一区二区| 欧美日韩三级在线| 亚洲综合在线观看视频| 色婷婷综合久久久中文一区二区| 国产调教视频一区|