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

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

?? main.c

?? 最新版FreeRTOS, 包擴多種開發平臺的移植
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
	FreeRTOS.org V4.1.1 - Copyright (C) 2003-2006 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.
	***************************************************************************
*/

/* 
 * This demo application creates six co-routines and two tasks (three including 
 * the idle task).  The co-routines execute as part of the idle task hook.
 *
 * Five of the created co-routines are the standard 'co-routine flash' 
 * co-routines contained within the Demo/Common/Minimal/crflash.c file and 
 * documented on the FreeRTOS.org WEB site.  
 *
 * The 'LCD Task' rotates a string on the LCD, delaying between each character
 * as necessitated by the slow interface, and delaying between each string just
 * long enough to enable the text to be read.
 *
 * The sixth co-routine and final task control the transmission and reception
 * of a string to UART 0.  The co-routine periodically sends the first 
 * character of the string to the UART, with the UART's TxEnd interrupt being
 * used to transmit the remaining characters.  The UART's RxEnd interrupt 
 * receives the characters and places them on a queue to be processed by the 
 * 'COMs Rx' task.  An error is latched should an unexpected character be 
 * received, or any character be received out of sequence.  
 *
 * A loopback connector is required to ensure that each character transmitted 
 * on the UART is also received on the same UART.  For test purposes the UART
 * FIFO's are not utalised in order to maximise the interrupt overhead.  Also
 * a pseudo random interval is used between the start of each transmission in 
 * order that the resultant interrupts are more randomly distributed and 
 * therefore more likely to highlight any problems.
 *
 * The flash co-routines control LED's zero to four.  LED five is toggled each
 * time the string is transmitted on the UART.  LED six is toggled each time
 * the string is CORRECTLY received on the UART.  LED seven is latched on should
 * an error be detected in any task or co-routine.
 *
 * In addition the idle task makes repetative calls to 
 * prvSetAndCheckRegisters().  This simply loads the general purpose registers 
 * with a known value, then checks each register to ensure the held value is 
 * still correct.  As a low priority task this checking routine is likely to 
 * get repeatedly swapped in and out.  A register being found to contain an 
 * incorrect value is therefore indicative of an error in the task switching 
 * mechansim.
 *
 */

/* Scheduler include files. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "croutine.h"

/* Demo application include files. */
#include "partest.h"
#include "crflash.h"

/* Library include files. */
#include "LM3Sxxx.h"
#include "pdc.h"

/* The time to delay between writing each character to the LCD. */
#define mainCHAR_WRITE_DELAY		( 2 / portTICK_RATE_MS )

/* The time to delay between writing each string to the LCD. */
#define mainSTRING_WRITE_DELAY		( 400 / portTICK_RATE_MS )

/* The number of flash co-routines to create. */
#define mainNUM_FLASH_CO_ROUTINES	( 5 )

/* The length of the queue used to pass received characters to the Comms Rx
task. */
#define mainRX_QUEUE_LEN			( 5 )

/* The priority of the co-routine used to initiate the transmission of the 
string on UART 0. */
#define mainTX_CO_ROUTINE_PRIORITY	( 1 )

/* Only one co-routine is created so its index is not important. */
#define mainTX_CO_ROUTINE_INDEX		( 0 )

/* The time between transmissions of the string on UART 0.   This is pseudo
random in order to generate a bit or randomness to when the interrupts occur.*/
#define mainMIN_TX_DELAY			( 40 / portTICK_RATE_MS )
#define mainMAX_TX_DELAY			( ( portTickType ) 0x7f )
#define mainOFFSET_TIME				( ( portTickType ) 3 )

/* The time the Comms Rx task should wait to receive a character.  This should
be slightly longer than the time between transmissions.  If we do not receive
a character after this time then there must be an error in the transmission or
the timing of the transmission. */
#define mainCOMMS_RX_DELAY			( mainMAX_TX_DELAY + 20 )

/* The task priorites. */
#define mainLCD_TASK_PRIORITY		( tskIDLE_PRIORITY )
#define mainCOMMS_RX_TASK_PRIORITY	( tskIDLE_PRIORITY + 1 )

/* The LED's toggled by the various tasks. */
#define mainCOMMS_FAIL_LED			( 7 )
#define mainCOMMS_RX_LED			( 6 )
#define mainCOMMS_TX_LED			( 5 )

/* The baud rate used by the UART comms tasks/co-routine. */
#define mainBAUD_RATE				( 57600 )

/* FIFO setting for the UART.  The FIFO is not used to create a better test. */
#define mainFIFO_SET				( 0x10 )

/* The string that is transmitted on the UART contains sequentially the 
characters from mainFIRST_TX_CHAR to mainLAST_TX_CHAR. */
#define mainFIRST_TX_CHAR '0'
#define mainLAST_TX_CHAR 'z'

/* Just used to walk through the program memory in order that some random data
can be generated. */
#define mainTOTAL_PROGRAM_MEMORY ( ( unsigned portLONG * ) ( 8 * 1024 ) )
#define mainFIRST_PROGRAM_BYTES ( ( unsigned portLONG * ) 4 )

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

/*
 * The task that rotates text on the LCD.
 */
static void vLCDTask( void * pvParameters );

/*
 * The task that receives the characters from UART 0.
 */
static void vCommsRxTask( void * pvParameters );

/*
 * The co-routine that periodically initiates the transmission of the string on
 * the UART.
 */
static void vSerialTxCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex );

/* 
 * Writes a string the the LCD.
 */
static void prvWriteString( const portCHAR *pcString );

/*
 * Initialisation routine for the UART.
 */
static void vSerialInit( void );

/*
 * Thread safe write to the PDC.
 */
static void prvPDCWrite( portCHAR cAddress, portCHAR cData );

/*
 * Function to simply set a known value into the general purpose registers
 * then read them back to ensure they remain set correctly.  An incorrect value
 * being indicative of an error in the task switching mechanism.
 */
void prvSetAndCheckRegisters( void );

/*
 * Latch the LED that indicates that an error has occurred. 
 */
void vSetErrorLED( void );

/*
 * Sets up the PLL and ports used by the demo.
 */
static void prvSetupHardware( void );

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

/* Error flag set to pdFAIL if an error is encountered in the tasks/co-routines
defined within this file. */
unsigned portBASE_TYPE uxErrorStatus = pdPASS;

/* The next character to transmit. */
static portCHAR cNextChar;

/* The queue used to transmit characters from the interrupt to the Comms Rx
task. */
static xQueueHandle xCommsQueue;

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

int main( void )
{
	/* Create the queue used to communicate between the UART ISR and the Comms
	Rx task. */
	xCommsQueue = xQueueCreate( mainRX_QUEUE_LEN, sizeof( portCHAR ) );

	/* Setup the ports used by the demo and the clock. */
	prvSetupHardware();

	/* Create the co-routines that flash the LED's. */
	vStartFlashCoRoutines( mainNUM_FLASH_CO_ROUTINES );

	/* Create the co-routine that initiates the transmission of characters
	on the UART. */
	xCoRoutineCreate( vSerialTxCoRoutine, mainTX_CO_ROUTINE_PRIORITY, mainTX_CO_ROUTINE_INDEX );

	/* Create the LCD and Comms Rx tasks. */
	xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );
	xTaskCreate( vCommsRxTask, "CMS", configMINIMAL_STACK_SIZE, NULL, mainCOMMS_RX_TASK_PRIORITY, NULL );

	/* Start the scheduler running the tasks and co-routines just created. */
	vTaskStartScheduler();

	/* Should not get here unless we did not have enough memory to start the
	scheduler. */
	for( ;; );
}
/*-----------------------------------------------------------*/

static void prvSetupHardware( void )
{
	/* Setup the PLL. */
	SysCtlClockSet( SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_6MHZ );

	/* Initialise the hardware used to talk to the LCD, LED's and UART. */
	PDCInit();
	vParTestInitialise();
	vSerialInit();
}
/*-----------------------------------------------------------*/

void vApplicationIdleHook( void )
{
	/* The co-routines are executed in the idle task using the idle task 
	hook. */
	for( ;; )
	{
		/* Schedule the co-routines. */
		vCoRoutineSchedule();

		/* Run the register check function between each co-routine. */
		prvSetAndCheckRegisters();
	}
}
/*-----------------------------------------------------------*/

static void prvWriteString( const portCHAR *pcString )
{
	/* Write pcString to the LED, pausing between each character. */
	prvPDCWrite(PDC_LCD_CSR, LCD_CLEAR);        
	while( *pcString )
	{
		vTaskDelay( mainCHAR_WRITE_DELAY );
		prvPDCWrite( PDC_LCD_RAM, *pcString );
		pcString++;
	}
}
/*-----------------------------------------------------------*/

void vLCDTask( void * pvParameters )
{
unsigned portBASE_TYPE uxIndex;
const unsigned portCHAR ucCFGData[] = {	
											0x30,   /* Set data bus to 8-bits. */
											0x30,
											0x30,
											0x3C,   /* Number of lines/font. */
											0x08,   /* Display off. */
											0x01,   /* Display clear. */
											0x06,   /* Entry mode [cursor dir][shift]. */
											0x0C	/* Display on [display on][curson on][blinking on]. */
									  };  

/* The strings that are written to the LCD. */
const portCHAR *pcStringsToDisplay[] = {										
											"Stellaris",
											"Demo",
											"One",
											"www.FreeRTOS.org",
											""

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产又粗又猛又爽又黄91精品| 色综合久久久久综合体| 粉嫩aⅴ一区二区三区四区| 成人毛片视频在线观看| 欧美日韩精品电影| 中文一区二区在线观看| 亚洲国产综合色| 国产乱妇无码大片在线观看| 成人一区二区三区| 制服丝袜亚洲精品中文字幕| 久久精品一区二区三区av| 亚洲一区二区三区四区在线| 国产在线一区二区综合免费视频| 91高清视频在线| 国产亚洲成av人在线观看导航| 一区2区3区在线看| 国产不卡一区视频| 日韩欧美视频一区| 亚洲综合色噜噜狠狠| 精品亚洲porn| 91精品国产欧美日韩| 国产精品水嫩水嫩| 免费成人在线观看视频| 在线观看区一区二| 国产精品国产三级国产三级人妇| 九九久久精品视频| 欧美一区二区私人影院日本| 中文字幕一区二区不卡| 日韩中文字幕亚洲一区二区va在线| 精品影院一区二区久久久| 欧美日韩性生活| 一区二区三区欧美久久| 成人小视频在线| 国产亚洲欧美日韩日本| 国产在线视频精品一区| 精品日韩在线观看| 久久精品国产在热久久| 欧美精品v日韩精品v韩国精品v| 亚洲天堂2016| av不卡免费在线观看| 国产精品国产自产拍高清av王其 | 亚洲精品伦理在线| 不卡的电视剧免费网站有什么| 久久伊人蜜桃av一区二区| 久久99九九99精品| 欧美精品一区男女天堂| 国产伦理精品不卡| 国产欧美一区二区精品婷婷| 依依成人综合视频| 欧美撒尿777hd撒尿| 亚洲国产婷婷综合在线精品| 在线免费亚洲电影| 午夜国产精品一区| 日韩亚洲欧美一区二区三区| 六月丁香综合在线视频| 久久久久久久久免费| 黑人巨大精品欧美一区| 欧美一区二区女人| 激情小说亚洲一区| 国产精品人成在线观看免费| 成人h动漫精品| 亚洲精品免费在线播放| 欧美日韩国产一级| 精品亚洲成a人| 国产偷国产偷精品高清尤物| 美女视频免费一区| 国产欧美日本一区视频| 在线观看欧美精品| 日韩精品一二三区| 久久久777精品电影网影网 | 久久久99精品免费观看| 成人白浆超碰人人人人| 一区二区三区在线播放| 91精品在线免费| 国产精品88888| 亚洲男同性恋视频| 91视频免费播放| 日韩电影一区二区三区| 欧美高清在线一区| 欧美精品123区| 国产白丝精品91爽爽久久| 亚洲欧美一区二区三区久本道91| 欧美精品aⅴ在线视频| 国产91在线看| 亚洲一区二区三区四区在线 | 成人手机电影网| 一区二区国产盗摄色噜噜| 久久一区二区三区四区| 欧美性猛交xxxxxxxx| 国产高清精品久久久久| 亚洲国产精品影院| 中日韩免费视频中文字幕| 在线电影院国产精品| 91在线丨porny丨国产| 日韩精品每日更新| 综合欧美亚洲日本| 久久影院午夜论| 欧美日韩国产不卡| 91丨九色丨蝌蚪富婆spa| 国产一区二区h| 日韩精品欧美成人高清一区二区| 中文字幕一区二区5566日韩| 欧美人与禽zozo性伦| 99精品黄色片免费大全| 国产黑丝在线一区二区三区| 日韩成人伦理电影在线观看| 一区二区三区在线看| 中日韩免费视频中文字幕| 亚洲精品在线三区| 欧美一级二级在线观看| 欧美日韩一区二区不卡| 91蝌蚪porny九色| 国产一区999| 国内国产精品久久| 免费一级片91| 日本伊人午夜精品| 午夜精品久久久久| 亚洲国产精品综合小说图片区| 亚洲三级在线观看| 国产精品国产三级国产普通话蜜臀| 日韩一区二区三| 91精品国产欧美日韩| 91无套直看片红桃| 韩国一区二区视频| 蜜桃传媒麻豆第一区在线观看| 亚洲国产中文字幕在线视频综合| 一区二区三区日韩| 亚洲国产成人91porn| 亚洲午夜久久久久中文字幕久| 最新成人av在线| 午夜视频一区在线观看| 麻豆精品久久精品色综合| 国产成人免费视| 色丁香久综合在线久综合在线观看| 欧美色中文字幕| 欧美一区二区三区色| 久久久久久久久蜜桃| 亚洲免费观看视频| 男男成人高潮片免费网站| 国产精品自产自拍| 色婷婷综合久久久久中文一区二区| 欧美日韩成人一区| 国产日韩欧美综合一区| 亚洲一区二区视频在线| 精品一区二区三区在线观看| av在线这里只有精品| 欧美老年两性高潮| 久久精品一二三| 亚洲国产综合在线| 国产成人亚洲综合色影视| 欧美丝袜自拍制服另类| 久久人人爽爽爽人久久久| 亚洲一区免费在线观看| 国产一区激情在线| 欧美特级限制片免费在线观看| 精品国产一区久久| 亚洲最新视频在线播放| 国产电影一区在线| 337p亚洲精品色噜噜| 中文字幕一区三区| 激情六月婷婷久久| 欧美体内she精视频| 中文字幕巨乱亚洲| 琪琪一区二区三区| 欧美丝袜丝交足nylons图片| 久久久国产午夜精品| 日韩 欧美一区二区三区| 在线这里只有精品| 中文字幕va一区二区三区| 蜜臀va亚洲va欧美va天堂| 色94色欧美sute亚洲线路二| 久久久久久久电影| 精品在线你懂的| 欧美一级二级在线观看| 一区二区三区波多野结衣在线观看| 国产精品亚洲а∨天堂免在线| 91精品欧美综合在线观看最新| 亚洲精品免费一二三区| 成人精品视频一区二区三区| 精品福利在线导航| 久久99精品久久久久久久久久久久| 在线观看亚洲专区| 亚洲精品一二三四区| 99视频国产精品| 国产精品美女久久久久久久久 | 免费观看一级欧美片| 在线亚洲一区二区| 中文字幕在线不卡一区| 成人小视频在线| 国产精品美女久久久久久久久久久| 狠狠色丁香婷综合久久| 欧美成人激情免费网| 日韩精品1区2区3区| 91精品在线免费| 免费一级欧美片在线观看| 日韩欧美中文字幕精品| 另类小说综合欧美亚洲| 精品国产乱码久久久久久牛牛| 久久精品国产免费| 久久亚洲春色中文字幕久久久|