亚洲欧美第一页_禁久久精品乱码_粉嫩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 seven co-routines and one task (two 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 controls the transmission 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 seventh and final co-routine.  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 "DriverLib.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 )

/* The priority of the co-routine used to receive characters from the UART. */
#define mainRX_CO_ROUTINE_PRIORITY	( 2 )

/* Only one co-routine is created so its index is not important. */
#define mainTX_CO_ROUTINE_INDEX		( 0 )
#define mainRX_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 error routine that is called if the driver library encounters an error. */
#ifdef DEBUG
void
__error__(char *pcFilename, unsigned long ulLine)
{
}
#endif

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

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

/*
 * The task that receives the characters from UART 0.
 */
static void vCommsRxCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex );

/*
 * 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 co-routine that receives characters from the UART. */
	xCoRoutineCreate( vCommsRxCoRoutine, mainRX_CO_ROUTINE_PRIORITY, mainRX_CO_ROUTINE_INDEX );

	/* Create the LCD task. */
	xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_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( ;; );
	return 0;
}
/*-----------------------------------------------------------*/

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",
											"Two",

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美1区2区3区| 日韩视频在线永久播放| 欧美人妖巨大在线| 日韩一区二区三区免费观看| 久久久久久**毛片大全| 亚洲在线中文字幕| 国产尤物一区二区在线| www.在线欧美| 日韩欧美国产一区二区在线播放| 久久久噜噜噜久久中文字幕色伊伊| 日韩理论在线观看| 免费成人在线观看| 99视频精品免费视频| 91精品国产综合久久久蜜臀图片| 久久精品亚洲麻豆av一区二区| 国产精品久久毛片a| 三级亚洲高清视频| caoporn国产精品| 91精品国产手机| 国产精品久久久久永久免费观看 | 精品国产乱子伦一区| 精品国产成人在线影院| 亚洲精选视频免费看| 国产资源在线一区| 欧美视频在线一区| 国产精品美女久久久久久久| 久久99在线观看| 欧美主播一区二区三区| 日本一区二区视频在线观看| 亚洲精品日韩一| 国产不卡免费视频| 欧美mv和日韩mv国产网站| 伊人婷婷欧美激情| 成人黄色软件下载| 26uuu亚洲综合色欧美| 天天综合网 天天综合色| 91浏览器打开| 欧美视频一二三区| 1000部国产精品成人观看| 一区二区三区av电影| 久久综合九色综合97_久久久| 久久久影视传媒| 亚洲成av人**亚洲成av**| www.日韩在线| 国产精品久久久久aaaa樱花| 国产一区二区福利视频| 日韩欧美激情一区| 国产精品系列在线观看| 亚洲欧美在线视频| 在线观看亚洲a| 日韩精彩视频在线观看| 日韩欧美高清在线| 国产精品一级黄| 亚洲美女在线一区| 欧美日韩久久一区| 精品一区二区久久久| 国产精品久久久久国产精品日日 | 懂色中文一区二区在线播放| 中文字幕在线不卡国产视频| 欧美日韩视频专区在线播放| 美洲天堂一区二卡三卡四卡视频| 欧美日韩一级二级| 国产乱子伦视频一区二区三区| 国产精品夫妻自拍| 911精品国产一区二区在线| 国产一区二区不卡| 伊人性伊人情综合网| 精品国产乱码久久久久久浪潮| 91麻豆成人久久精品二区三区| 蜜臀av一级做a爰片久久| 国产精品丝袜一区| 欧美日韩午夜精品| 大胆亚洲人体视频| 人人狠狠综合久久亚洲| 成人欧美一区二区三区视频网页| 欧美一区二区国产| 日本高清免费不卡视频| 国产麻豆一精品一av一免费| 亚洲超碰97人人做人人爱| 久久嫩草精品久久久精品 | 成人av电影在线| 美女免费视频一区| 亚洲激情在线播放| 日本一区二区三区国色天香| 日韩三级免费观看| 欧美亚洲高清一区二区三区不卡| 国产在线一区二区综合免费视频| 亚洲不卡一区二区三区| 1024成人网| 中文成人综合网| 欧美精品一区二| 日韩欧美一级在线播放| 在线观看日韩高清av| 成人开心网精品视频| 久久爱另类一区二区小说| 亚洲二区视频在线| 亚洲欧洲制服丝袜| 国产日韩av一区二区| 亚洲精品在线三区| 欧美一区二区人人喊爽| 欧美性videosxxxxx| 色诱亚洲精品久久久久久| 国产v日产∨综合v精品视频| 狠狠色综合播放一区二区| 蜜臀久久99精品久久久久宅男| 亚洲最新视频在线观看| 亚洲猫色日本管| 亚洲欧美另类小说| 亚洲免费av在线| 亚洲欧美色图小说| 亚洲欧美国产三级| 一区二区三区自拍| 亚洲午夜精品网| 亚洲va国产天堂va久久en| 亚洲一区av在线| 日日夜夜精品视频天天综合网| 亚洲综合在线第一页| 亚洲午夜精品一区二区三区他趣| 夜夜爽夜夜爽精品视频| 亚洲福利电影网| 奇米精品一区二区三区在线观看一 | 26uuu国产日韩综合| 久久噜噜亚洲综合| 国产欧美va欧美不卡在线| 国产精品久久久久久久久动漫| 国产精品不卡一区| 亚洲自拍偷拍av| 蜜桃视频在线一区| 国产成人在线视频播放| 成人aaaa免费全部观看| 色噜噜久久综合| 日韩午夜激情电影| 国产三级一区二区| 一区二区三区在线观看国产| 亚洲成av人片www| 韩国三级中文字幕hd久久精品| 国产精品18久久久久久久网站| 不卡电影免费在线播放一区| 91视频观看免费| 777亚洲妇女| 日本一区二区成人| 亚洲资源中文字幕| 国产一区视频网站| 日本久久一区二区| 欧美不卡一区二区三区四区| 国产精品久99| 免播放器亚洲一区| 99国产精品久| 91精品国产乱| 亚洲免费电影在线| 久久99精品久久只有精品| av色综合久久天堂av综合| 欧美高清激情brazzers| 国产三区在线成人av| 午夜精品福利一区二区三区av| 国产一区二区精品久久99| 欧美综合亚洲图片综合区| 精品国产伦一区二区三区观看方式| 亚洲欧洲成人自拍| 美女视频黄 久久| 色天天综合色天天久久| 久久久精品综合| 日韩av在线播放中文字幕| 91在线小视频| 久久伊人中文字幕| 日韩精品乱码av一区二区| hitomi一区二区三区精品| 日韩欧美国产小视频| 亚洲午夜精品在线| 99re成人精品视频| 国产无一区二区| 精品一区二区三区免费毛片爱| 91成人在线精品| 国产精品二区一区二区aⅴ污介绍| 久久不见久久见免费视频1| 欧美色图第一页| 自拍偷拍亚洲综合| 成人一道本在线| 国产亚洲综合性久久久影院| 蜜臀av性久久久久蜜臀aⅴ流畅 | 91精品91久久久中77777| 中日韩av电影| 国产乱人伦偷精品视频不卡| 91麻豆精品国产自产在线观看一区| 一区二区在线观看视频在线观看| av动漫一区二区| 国产精品免费视频网站| 国产福利91精品| 国产亚洲一区字幕| 国产一区 二区| 精品国精品国产| 黑人巨大精品欧美黑白配亚洲| 日韩精品在线一区| 久久av资源站| 久久久美女毛片| 成人免费av在线| 亚洲私人影院在线观看| 色综合天天在线| 夜色激情一区二区| 欧美电影在线免费观看|