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

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

?? main.c

?? 最新版FreeRTOS, 包擴多種開發平臺的移植
?? C
?? 第 1 頁 / 共 2 頁
字號:
											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",
											"www.FreeRTOS.org",
											""
									   };

	/* Configure the LCD. */
	uxIndex = 0;
	while( uxIndex < sizeof( ucCFGData ) )
	{
		prvPDCWrite( PDC_LCD_CSR, ucCFGData[ uxIndex ] );
		uxIndex++;
		vTaskDelay( mainCHAR_WRITE_DELAY );
	}

	/* Turn the LCD Backlight on. */
	prvPDCWrite( PDC_CSR, 0x01 );

	/* Clear display. */
	vTaskDelay( mainCHAR_WRITE_DELAY );
	prvPDCWrite( PDC_LCD_CSR, LCD_CLEAR ); 

	uxIndex = 0;
	for( ;; )    
	{
		/* Display the string on the LCD. */
		prvWriteString( pcStringsToDisplay[ uxIndex ] );
		
		/* Move on to the next string - wrapping if necessary. */
		uxIndex++;
		if( *( pcStringsToDisplay[ uxIndex ] ) == 0x00 )
		{
			uxIndex = 0;
			/* Longer pause on the last string to be sent. */
			vTaskDelay( mainSTRING_WRITE_DELAY * 2 );
		}

		/* Wait until it is time to move onto the next string. */
		vTaskDelay( mainSTRING_WRITE_DELAY );
	}
}
/*-----------------------------------------------------------*/

static void vCommsRxCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
{
static portCHAR cRxedChar, cExpectedChar = mainFIRST_TX_CHAR;
portBASE_TYPE xResult;

	crSTART( xHandle );

	for( ;; )
	{
		/* Wait for a character to be received. */
		crQUEUE_RECEIVE( xHandle, xCommsQueue, ( void * ) &cRxedChar, mainCOMMS_RX_DELAY, &xResult );

		/* Was the character recived (if any) the expected character. */
		if( ( cRxedChar != cExpectedChar ) || ( xResult != pdPASS ) )
		{
			/* Got an unexpected character.  This can sometimes occur when
			reseting the system using the debugger leaving characters already
			in the UART regsters. */
			uxErrorStatus = pdFAIL;

			/* Resync by waiting for the end of the current string. */
			while( cRxedChar != mainLAST_TX_CHAR )
			{
				crQUEUE_RECEIVE( xHandle, xCommsQueue, ( void * ) &cRxedChar, mainCOMMS_RX_DELAY, &xResult );
			}

			/* The next expected character is the start of the string again. */
			cExpectedChar = mainFIRST_TX_CHAR;
		}
		else
		{
			if( cExpectedChar == mainLAST_TX_CHAR )
			{
				/* We have reached the end of the string - we now expect to 
				receive the first character in the string again.   The LED is 
				toggled to indicate that the entire string was received without
				error. */
				vParTestToggleLED( mainCOMMS_RX_LED );
				cExpectedChar = mainFIRST_TX_CHAR;
			}
			else
			{
				/* We got the expected character, we now expect to receive the
				next character in the string. */
				cExpectedChar++;
			}
		}
	}

	crEND();
}
/*-----------------------------------------------------------*/

static void vSerialTxCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
{
portTickType xDelayPeriod;
static unsigned portLONG *pulRandomBytes = mainFIRST_PROGRAM_BYTES;

	/* Co-routine MUST start with a call to crSTART. */
	crSTART( xHandle );

	for(;;)
    {	
		/* Was the previously transmitted string received correctly? */
		if( uxErrorStatus != pdPASS )
		{
			/* An error was encountered so set the error LED. */
			vSetErrorLED();
		}

		/* The next character to Tx is the first in the string. */
		cNextChar = mainFIRST_TX_CHAR;

		UARTIntDisable( UART0_BASE, UART_INT_TX );
		{
			/* Send the first character. */
			if( !( HWREG( UART0_BASE + UART_O_FR ) & UART_FR_TXFF ) )
			{
				HWREG( UART0_BASE + UART_O_DR ) = cNextChar;
			}

			/* Move the variable to the char to Tx on so the ISR transmits
			the next character in the string once this one has completed. */
			cNextChar++;
		}
		UARTIntEnable(UART0_BASE, UART_INT_TX);

		/* Toggle the LED to show a new string is being transmitted. */
        vParTestToggleLED( mainCOMMS_TX_LED );

		/* Delay before we start the string off again.  A pseudo-random delay
		is used as this will provide a better test. */
		xDelayPeriod = xTaskGetTickCount() + ( *pulRandomBytes );

		pulRandomBytes++;
		if( pulRandomBytes > mainTOTAL_PROGRAM_MEMORY )
		{
			pulRandomBytes = mainFIRST_PROGRAM_BYTES;
		}

		/* Make sure we don't wait too long... */
		xDelayPeriod &= mainMAX_TX_DELAY;

		/* ...but we do want to wait. */
		if( xDelayPeriod < mainMIN_TX_DELAY )
		{
			xDelayPeriod = mainMIN_TX_DELAY;
		}

		/* Block for the random(ish) time. */
		crDELAY( xHandle, xDelayPeriod );
    }

	/* Co-routine MUST end with a call to crEND. */
	crEND();
}
/*-----------------------------------------------------------*/

static void vSerialInit( void )
{
	/* Enable the UART.  GPIOA has already been initialised. */
	SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

	/* Set GPIO A0 and A1 as peripheral function.  They are used to output the
	UART signals. */
	GPIODirModeSet( GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1, GPIO_DIR_MODE_HW );

	/* Configure the UART for 8-N-1 operation. */
	UARTConfigSet( UART0_BASE, mainBAUD_RATE, UART_CONFIG_WLEN_8 | UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE );

	/* We dont want to use the fifo.  This is for test purposes to generate
	as many interrupts as possible. */
	HWREG( UART0_BASE + UART_O_LCR_H ) &= ~mainFIFO_SET;

	/* Enable both Rx and Tx interrupts. */
	HWREG( UART0_BASE + UART_O_IM ) |= ( UART_INT_TX | UART_INT_RX );
	IntEnable( INT_UART0 );
}
/*-----------------------------------------------------------*/

void vUART_ISR(void)
{
unsigned portLONG ulStatus;
portCHAR cRxedChar;
portBASE_TYPE xTaskWokenByPost = pdFALSE;

	/* What caused the interrupt. */
	ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );

	/* Clear the interrupt. */
	UARTIntClear( UART0_BASE, ulStatus );

	/* Was an Rx interrpt pending? */
	if( ulStatus & UART_INT_RX )
	{
		if( ( HWREG(UART0_BASE + UART_O_FR ) & UART_FR_RXFF ) )
		{
			/* Get the char from the buffer and post it onto the queue of
			Rxed chars.  Posting the character should wake the task that is 
			blocked on the queue waiting for characters. */
			cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
			xTaskWokenByPost = crQUEUE_SEND_FROM_ISR( xCommsQueue, &cRxedChar, xTaskWokenByPost );
		}		
	}

	/* Was a Tx interrupt pending? */
	if( ulStatus & UART_INT_TX )
	{
		/* Send the next character in the string.  We are not using the FIFO. */
		if( cNextChar <= mainLAST_TX_CHAR )
		{
			if( !( HWREG( UART0_BASE + UART_O_FR ) & UART_FR_TXFF ) )
			{
				HWREG( UART0_BASE + UART_O_DR ) = cNextChar;
			}
			cNextChar++;
		}
	}
	
	if( xTaskWokenByPost )
	{
		/* We are posting to a co-routine rather than a task so don't bother
		causing a task switch. */
	}
}
/*-----------------------------------------------------------*/

static void prvPDCWrite( portCHAR cAddress, portCHAR cData )
{
	vTaskSuspendAll();
	{
		PDCWrite( cAddress, cData );
	}
	xTaskResumeAll();
}
/*-----------------------------------------------------------*/

void vSetErrorLED( void )
{
	vParTestSetLED( mainCOMMS_FAIL_LED, pdTRUE );
}
/*-----------------------------------------------------------*/

void prvSetAndCheckRegisters( void )
{
	/* Fill the general purpose registers with known values. */
	__asm volatile( "    mov r11, #10\n"
                  "    add r0, r11, #1\n"
                  "    add r1, r11, #2\n"
	                "    add r2, r11, #3\n"
	                "    add r3, r11, #4\n"
	                "    add r4, r11, #5\n"
	                "    add r5, r11, #6\n"
	                "    add r6, r11, #7\n"
	                "    add r7, r11, #8\n"
	                "    add r12, r11, #12" );

	/* Check the values are as expected. */
	__asm volatile( "    cmp r11, #10\n"
	                "    bne set_error_led\n"
	                "    cmp r0, #11\n"
	                "    bne set_error_led\n"
	                "    cmp r1, #12\n"
	                "    bne set_error_led\n"
	                "    cmp r2, #13\n"
	                "    bne set_error_led\n"
	                "    cmp r3, #14\n"
	                "    bne set_error_led\n"
	                "    cmp r4, #15\n"
	                "    bne set_error_led\n"
	                "    cmp r5, #16\n"
	                "    bne set_error_led\n"
	                "    cmp r6, #17\n"
	                "    bne set_error_led\n"
	                "    cmp r7, #18\n"
	                "    bne set_error_led\n"
	                "    cmp r12, #22\n"
	                "    bne set_error_led\n"
	                "    bx lr" );

  __asm volatile( "set_error_led:\n"
	                "    push {r14}\n"
	                "    ldr r1, =vSetErrorLED\n"
	                "    blx r1\n"
	                "    pop {r14}\n"
	                "    bx lr" );
}
/*-----------------------------------------------------------*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产综合久久小美女| 亚洲色图欧洲色图| 亚洲美女区一区| 久久99精品国产91久久来源| 在线欧美一区二区| 欧美极品aⅴ影院| 亚洲成精国产精品女| 成人av网址在线观看| 精品国产麻豆免费人成网站| 亚洲成人免费观看| 在线亚洲欧美专区二区| 欧美国产一区在线| 国模少妇一区二区三区| 欧美一级在线视频| 天涯成人国产亚洲精品一区av| 不卡的av电影| 中文字幕不卡一区| 成人午夜电影小说| 国产偷国产偷亚洲高清人白洁| 免费成人在线网站| 9191精品国产综合久久久久久| 亚洲女人****多毛耸耸8| 成人av在线电影| 日本一二三不卡| 成人午夜精品一区二区三区| 久久久午夜精品理论片中文字幕| 免费成人美女在线观看.| 欧美日本免费一区二区三区| 亚洲精品欧美二区三区中文字幕| 不卡一区二区中文字幕| 国产精品国产自产拍在线| 国产高清无密码一区二区三区| 亚洲精品在线免费观看视频| 精品一区二区三区免费播放 | 成人丝袜18视频在线观看| 精品精品国产高清a毛片牛牛| 午夜影院在线观看欧美| 欧美美女一区二区在线观看| 天天影视网天天综合色在线播放| 欧美日本一区二区三区| 青青草91视频| 久久综合九色综合97婷婷女人| 国产一区在线看| 国产精品久久久久国产精品日日| 99久久伊人久久99| 亚洲综合精品久久| 4438亚洲最大| 国产一区在线视频| 最新国产の精品合集bt伙计| 欧美影视一区在线| 日韩国产在线观看一区| 久久久美女毛片| av在线一区二区三区| 一区二区三区四区亚洲| 日韩视频不卡中文| 成人av综合一区| 午夜精品在线看| 欧美激情资源网| 欧美日韩一区视频| 国产精选一区二区三区| 亚洲男女毛片无遮挡| 9191成人精品久久| 成人国产精品视频| 日日摸夜夜添夜夜添亚洲女人| 精品免费国产一区二区三区四区| 国产成人精品影视| 石原莉奈一区二区三区在线观看| 欧美成人艳星乳罩| 91国在线观看| 国产精品一二三四五| 一区二区三区 在线观看视频| 精品欧美乱码久久久久久| 99精品热视频| 免费精品视频最新在线| 成人欧美一区二区三区在线播放| 欧美精品丝袜久久久中文字幕| 国产乱码精品一品二品| 亚洲高清视频在线| 国产亚洲短视频| 91精品国产麻豆国产自产在线| 国产99精品视频| 久久国产麻豆精品| 亚洲一二三四在线| 亚洲欧美在线观看| 亚洲精品在线观| 欧美一区二区三区思思人| 94-欧美-setu| 国产大陆a不卡| 久久国产尿小便嘘嘘尿| 亚洲6080在线| 亚洲狠狠丁香婷婷综合久久久| 久久天堂av综合合色蜜桃网| 777xxx欧美| 欧美日韩一区二区三区视频| 91在线porny国产在线看| 国产精品小仙女| 国产在线麻豆精品观看| 美女国产一区二区三区| 日韩国产一二三区| 亚洲成国产人片在线观看| 夜夜爽夜夜爽精品视频| 亚洲三级在线看| 自拍偷自拍亚洲精品播放| 国产欧美日韩在线观看| 精品欧美久久久| 久久综合av免费| 久久众筹精品私拍模特| 日韩免费电影网站| 日韩欧美国产综合在线一区二区三区 | 一二三区精品视频| 亚洲天堂福利av| ...中文天堂在线一区| 国产精品久久久久影院| 日韩一区在线播放| 亚洲人成7777| 亚洲一级二级在线| 亚洲一区二区av电影| 首页欧美精品中文字幕| 青椒成人免费视频| 美日韩一区二区| 国产一区二区美女诱惑| 国产精品一区久久久久| 成人一区二区三区视频在线观看 | 毛片av一区二区三区| 蜜桃在线一区二区三区| 久久电影网电视剧免费观看| 国产精品综合一区二区| 岛国一区二区三区| 色噜噜偷拍精品综合在线| 欧美日韩久久一区| 欧美本精品男人aⅴ天堂| 久久久久久久综合色一本| 国产精品国产三级国产普通话99 | 久久99日本精品| 国产乱码精品一区二区三| av午夜一区麻豆| 欧美三级乱人伦电影| 精品国产91久久久久久久妲己| 国产亚洲短视频| 亚洲一区中文日韩| 麻豆精品精品国产自在97香蕉| 国产成人日日夜夜| 91国偷自产一区二区开放时间| 91精品国产综合久久香蕉麻豆| 久久亚洲一区二区三区四区| 国产精品美日韩| 日韩成人伦理电影在线观看| 国产99久久精品| 欧美一区午夜视频在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 亚洲第四色夜色| 成人午夜电影久久影院| 在线91免费看| 亚洲天堂中文字幕| 激情五月婷婷综合网| 色哟哟一区二区在线观看| 欧美一级爆毛片| 1024精品合集| 国产一二精品视频| 欧美日韩久久不卡| 国产精品美女久久久久久2018| 亚洲一区二区三区小说| 国产乱码精品1区2区3区| 欧美日韩免费观看一区二区三区| 精品处破学生在线二十三| 午夜精品福利久久久| 国产成人亚洲综合a∨婷婷 | 午夜亚洲福利老司机| 国产高清久久久久| 欧美大胆人体bbbb| 亚洲国产精品一区二区久久| 国产精品91xxx| 欧美成人激情免费网| 亚洲一区二区欧美激情| aaa欧美大片| 久久久久久久久伊人| 免费在线观看日韩欧美| 欧美探花视频资源| 亚洲你懂的在线视频| 成人久久视频在线观看| 精品国产精品网麻豆系列| 日本不卡中文字幕| 欧美日韩国产综合视频在线观看| 亚洲日本在线看| 99国产一区二区三精品乱码| 中文字幕精品一区| 大桥未久av一区二区三区中文| 日韩欧美在线观看一区二区三区| 伊人一区二区三区| 91久久奴性调教| 伊人性伊人情综合网| 色欧美片视频在线观看在线视频| 国产精品色在线| av影院午夜一区| 中文字幕亚洲综合久久菠萝蜜| 成人av网站免费观看| 亚洲欧洲精品天堂一级| 色综合久久久网| 亚洲在线成人精品| 欧美日韩中文另类|