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

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

?? port.c

?? 超好的嵌入式操作系統學習代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*This file has been prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
 *
 * \brief FreeRTOS port source for AVR32 UC3.
 *
 * - Compiler:           GNU GCC for AVR32
 * - Supported devices:  All AVR32 devices can be used.
 * - AppNote:
 *
 * \author               Atmel Corporation: http://www.atmel.com \n
 *                       Support and FAQ: http://support.atmel.no/
 *
 *****************************************************************************/

/*
	FreeRTOS.org V4.5.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.
	***************************************************************************
*/


/* Standard includes. */
#include <sys/cpu.h>
#include <sys/usart.h>
#include <malloc.h>

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

/* AVR32 UC3 includes. */
#include <avr32/io.h>
#include "gpio.h"
#if( configTICK_USE_TC==1 )
	#include "tc.h"
#endif


/* Constants required to setup the task context. */
#define portINITIAL_SR            ( ( portSTACK_TYPE ) 0x00400000 ) /* AVR32 : [M2:M0]=001 I1M=0 I0M=0, GM=0 */
#define portINSTRUCTION_SIZE      ( ( portSTACK_TYPE ) 0 )

/* Each task maintains its own critical nesting variable. */
#define portNO_CRITICAL_NESTING   ( ( unsigned portLONG ) 0 )
volatile unsigned portLONG ulCriticalNesting = 9999UL;

#if( configTICK_USE_TC==0 )
	static void prvScheduleNextTick( void );
#else
	static void prvClearTcInt( void );
#endif

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

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

/*
 * Low-level initialization routine called during startup, before the main
 * function.
 * This version comes in replacement to the default one provided by Newlib.
 * Newlib's _init_startup only calls init_exceptions, but Newlib's exception
 * vectors are not compatible with the SCALL management in the current FreeRTOS
 * port. More low-level initializations are besides added here.
 */
void _init_startup(void)
{
	/* Import the Exception Vector Base Address. */
	extern void _evba;

	#if configHEAP_INIT
		extern void __heap_start__;
		extern void __heap_end__;
		portBASE_TYPE *pxMem;
	#endif

	/* Load the Exception Vector Base Address in the corresponding system register. */
	Set_system_register( AVR32_EVBA, ( int ) &_evba );

	/* Enable exceptions. */
	ENABLE_ALL_EXCEPTIONS();

	/* Initialize interrupt handling. */
	INTC_init_interrupts();

	#if configHEAP_INIT

		/* Initialize the heap used by malloc. */
		for( pxMem = &__heap_start__; pxMem < ( portBASE_TYPE * )&__heap_end__; )
		{
			*pxMem++ = 0xA5A5A5A5;
		}

	#endif

	/* Give the used CPU clock frequency to Newlib, so it can work properly. */
	set_cpu_hz( configCPU_CLOCK_HZ );

	/* Code section present if and only if the debug trace is activated. */
	#if configDBG
	{
		static const gpio_map_t DBG_USART_GPIO_MAP =
		{
			{ configDBG_USART_RX_PIN, configDBG_USART_RX_FUNCTION },
			{ configDBG_USART_TX_PIN, configDBG_USART_TX_FUNCTION }
		};

		/* Initialize the USART used for the debug trace with the configured parameters. */
		set_usart_base( ( void * ) configDBG_USART );
		gpio_enable_module( DBG_USART_GPIO_MAP,
		                    sizeof( DBG_USART_GPIO_MAP ) / sizeof( DBG_USART_GPIO_MAP[0] ) );
		usart_init( configDBG_USART_BAUDRATE );
	}
	#endif
}
/*-----------------------------------------------------------*/

/*
 * malloc, realloc and free are meant to be called through respectively
 * pvPortMalloc, pvPortRealloc and vPortFree.
 * The latter functions call the former ones from within sections where tasks
 * are suspended, so the latter functions are task-safe. __malloc_lock and
 * __malloc_unlock use the same mechanism to also keep the former functions
 * task-safe as they may be called directly from Newlib's functions.
 * However, all these functions are interrupt-unsafe and SHALL THEREFORE NOT BE
 * CALLED FROM WITHIN AN INTERRUPT, because __malloc_lock and __malloc_unlock do
 * not call portENTER_CRITICAL and portEXIT_CRITICAL in order not to disable
 * interrupts during memory allocation management as this may be a very time-
 * consuming process.
 */

/*
 * Lock routine called by Newlib on malloc / realloc / free entry to guarantee a
 * safe section as memory allocation management uses global data.
 * See the aforementioned details.
 */
void __malloc_lock(struct _reent *ptr)
{
	vTaskSuspendAll();
}

/*
 * Unlock routine called by Newlib on malloc / realloc / free exit to guarantee
 * a safe section as memory allocation management uses global data.
 * See the aforementioned details.
 */
void __malloc_unlock(struct _reent *ptr)
{
	xTaskResumeAll();
}
/*-----------------------------------------------------------*/

/* Added as there is no such function in FreeRTOS. */
void *pvPortRealloc( void *pv, size_t xWantedSize )
{
void *pvReturn;

	vTaskSuspendAll();
	{
		pvReturn = realloc( pv, xWantedSize );
	}
	xTaskResumeAll();

	return pvReturn;
}
/*-----------------------------------------------------------*/

/* The cooperative scheduler requires a normal IRQ service routine to
simply increment the system tick. */
/* The preemptive scheduler is defined as "naked" as the full context is saved
on entry as part of the context switch. */
__attribute__((__naked__)) static void vTick( void )
{
	/* Save the context of the interrupted task. */
	portSAVE_CONTEXT_OS_INT();

	#if( configTICK_USE_TC==1 )
		/* Clear the interrupt flag. */
		prvClearTcInt();
	#else
		/* Schedule the COUNT&COMPARE match interrupt in (configCPU_CLOCK_HZ/configTICK_RATE_HZ)
		clock cycles from now. */
		prvScheduleNextTick();
	#endif

	/* Because FreeRTOS is not supposed to run with nested interrupts, put all OS
	calls in a critical section . */
	portENTER_CRITICAL();
		vTaskIncrementTick();
	portEXIT_CRITICAL();

	/* Restore the context of the "elected task". */
	portRESTORE_CONTEXT_OS_INT();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区二区在线| 成人精品鲁一区一区二区| 免费成人在线观看视频| 狠狠色狠狠色合久久伊人| 成人自拍视频在线| 欧美撒尿777hd撒尿| 日韩一区二区精品葵司在线| 欧美激情综合五月色丁香小说| 国产精品久久久一本精品| 亚洲第一二三四区| 久久精工是国产品牌吗| 成人精品国产一区二区4080| 欧美日韩视频专区在线播放| 欧美精品一区在线观看| 一区二区在线观看av| 激情综合色丁香一区二区| 99精品欧美一区二区三区小说 | 亚洲欧洲一区二区在线播放| 亚洲成人av资源| 国产91高潮流白浆在线麻豆| 欧美网站一区二区| 久久久久久久久伊人| 一区二区高清在线| 国产成人在线免费观看| 欧美日韩成人在线一区| 日本一区二区高清| 日韩avvvv在线播放| 不卡欧美aaaaa| 欧美电视剧免费观看| 亚洲黄色片在线观看| 国模一区二区三区白浆| 欧美亚州韩日在线看免费版国语版| 欧美精品一区二区高清在线观看| 一区二区三区欧美视频| 国产69精品久久777的优势| 欧美精品日韩一本| 亚洲三级在线看| 国产综合色在线视频区| 欧美精三区欧美精三区| 18成人在线观看| 国产在线视视频有精品| 欧美吞精做爰啪啪高潮| 亚洲欧洲中文日韩久久av乱码| 韩国一区二区三区| 91精品国产91久久综合桃花| 一区二区三区鲁丝不卡| eeuss影院一区二区三区| 久久影院视频免费| 蜜臀91精品一区二区三区| 欧美三级在线播放| 亚洲女同一区二区| 成人h精品动漫一区二区三区| 精品久久久久久久久久久久久久久| 亚洲线精品一区二区三区八戒| 成人激情视频网站| 国产三级欧美三级| 国模一区二区三区白浆| 欧美成人激情免费网| 日韩高清一区在线| 欧美日韩二区三区| 亚洲午夜电影网| 日本高清不卡一区| 亚洲精品一二三| 91啦中文在线观看| 亚洲日本va午夜在线影院| 成人av资源在线观看| 国产精品天天摸av网| 国产999精品久久久久久绿帽| 精品女同一区二区| 久草热8精品视频在线观看| 欧美一区二区精品| 美国三级日本三级久久99| 日韩一级黄色片| 捆绑紧缚一区二区三区视频| 欧美大黄免费观看| 久久99国内精品| 久久亚区不卡日本| 国产成都精品91一区二区三 | 国产高清亚洲一区| 久久久久免费观看| 丁香婷婷深情五月亚洲| 国产精品天美传媒| 色av成人天堂桃色av| 亚洲成人精品影院| 制服丝袜国产精品| 久久国产夜色精品鲁鲁99| 久久综合精品国产一区二区三区| 国产在线播放一区三区四| 国产日韩欧美综合一区| 成人h动漫精品一区二区| 亚洲欧美日本韩国| 欧美无砖专区一中文字| 日本一不卡视频| 日韩欧美另类在线| 粉嫩av亚洲一区二区图片| 成人欧美一区二区三区| 欧美视频日韩视频在线观看| 婷婷夜色潮精品综合在线| 欧美电影免费观看高清完整版| 国产精品自拍av| 亚洲日本在线视频观看| 欧美日韩亚洲综合在线| 激情图片小说一区| 中文字幕一区二区在线播放| 欧美亚洲国产一区二区三区| 日韩av网站在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 欧洲激情一区二区| 美女精品一区二区| 亚洲欧洲无码一区二区三区| 欧美日韩精品三区| 国产一区二区三区在线看麻豆| 中文字幕一区二区三区乱码在线| 欧美在线三级电影| 激情亚洲综合在线| 亚洲男人的天堂av| 日韩视频一区二区在线观看| 成人精品视频一区二区三区尤物| 亚洲一区二区精品久久av| 精品福利av导航| 色婷婷激情一区二区三区| 蜜臀av性久久久久av蜜臀妖精| 久久伊人中文字幕| 在线观看免费成人| 国产剧情在线观看一区二区| 亚洲激情五月婷婷| 久久久久久免费| 欧美体内she精高潮| 国产精品2024| 石原莉奈一区二区三区在线观看| 欧美国产日产图区| 这里只有精品视频在线观看| 成人成人成人在线视频| 美国毛片一区二区三区| 亚洲精品乱码久久久久| 久久久久国产精品麻豆ai换脸| 欧美性生活久久| 成人毛片视频在线观看| 日本一区中文字幕| 亚洲一区在线视频| 中文字幕国产一区| 欧美大片在线观看| 欧美日高清视频| 成人激情免费电影网址| 久久se精品一区二区| 亚洲成人免费观看| 亚洲色图欧美偷拍| 国产日韩欧美不卡| 欧美成人一区二区三区片免费| 欧美亚洲高清一区二区三区不卡| 成人激情综合网站| 国产精品中文有码| 免费在线一区观看| 亚洲成人av资源| 亚洲一区在线看| 亚洲免费伊人电影| 国产精品你懂的在线欣赏| xnxx国产精品| 日韩一区二区三区高清免费看看| 欧洲激情一区二区| 一本到一区二区三区| av中文字幕一区| 成人一区二区三区在线观看| 麻豆精品精品国产自在97香蕉| 亚洲国产成人va在线观看天堂| 亚洲天堂2014| 中文字幕亚洲视频| 国产女同性恋一区二区| 久久色.com| 欧美mv和日韩mv国产网站| 欧美一区二区三级| 欧美理论电影在线| 欧美日韩成人在线一区| 欧美日韩国产美女| 欧美日韩精品免费| 欧美日韩中文国产| 欧美吞精做爰啪啪高潮| 欧美制服丝袜第一页| 欧美在线高清视频| 91福利精品视频| 欧美亚男人的天堂| 欧美剧在线免费观看网站 | 亚洲国产综合人成综合网站| 亚洲精品美腿丝袜| 亚洲激情校园春色| 亚洲午夜久久久久久久久电影网 | 91精品免费观看| 欧美一区二区三区四区久久| 欧美一区二区在线不卡| 欧美肥胖老妇做爰| 欧美一二三区在线| 精品久久久久久久久久久久久久久久久| 日韩免费成人网| 久久影音资源网| 国产精品伦理在线| 亚洲精品美国一| 午夜成人在线视频| 麻豆精品一二三| 精品无码三级在线观看视频| 国产成人免费在线观看不卡|