亚洲欧美第一页_禁久久精品乱码_粉嫩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.
	***************************************************************************
*/

/*
 * Creates the demo application tasks, then starts the scheduler.  The WEB
 * documentation provides more details of the demo application tasks.
 * 
 * Main. c also creates four other tasks:
 * 
 * 1) vErrorChecks()
 * This only executes every few seconds but has the highest priority so is 
 * guaranteed to get processor time.  Its main function is to check that all 
 * the standard demo application tasks are still operational and have not
 * experienced any errors.  vErrorChecks() will toggle the on board LED
 * every mainNO_ERROR_FLASH_PERIOD milliseconds if none of the demo application
 * tasks have reported an error.  Should any task report an error at any time
 * the rate at which the on board LED is toggled is increased to 
 * mainERROR_FLASH_PERIOD - providing visual feedback that something has gone
 * wrong.
 *
 * 2) vRegisterCheck()
 * This is a very simple task that checks that all the registers are always
 * in their expected state.  The task only makes use of the A register, so
 * all the other registers should always contain their initial values.
 * An incorrect value indicates an error in the context switch mechanism.
 * The task operates at the idle priority so will be preempted regularly.
 * Any error will cause the toggle rate of the on board LED to increase to
 * mainERROR_FLASH_PERIOD milliseconds.
 *
 * 3 and 4) vFLOPCheck1() and vFLOPCheck2()
 * These are very basic versions of the standard FLOP tasks.  They are good
 * at detecting errors in the context switch mechanism, and also check that
 * the floating point libraries are correctly built to be re-enterant.  The
 * stack restrictions of the 8051 prevent the use of the standard FLOP demo
 * tasks.
 */

/* Standard includes. */
#include <stdlib.h>

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

/* Demo application includes. */
#include "partest.h"
#include "flash.h"
#include "integer.h"
#include "PollQ.h"
#include "comtest2.h"
#include "semtest.h"

/* Demo task priorities. */
#define mainLED_TASK_PRIORITY		( tskIDLE_PRIORITY + 1 )
#define mainQUEUE_POLL_PRIORITY		( tskIDLE_PRIORITY + 2 )
#define mainCOM_TEST_PRIORITY		( tskIDLE_PRIORITY + 2 )
#define mainCHECK_TASK_PRIORITY		( tskIDLE_PRIORITY + 3 )
#define mainSEM_TEST_PRIORITY		( tskIDLE_PRIORITY + 2 )
#define mainINTEGER_PRIORITY		tskIDLE_PRIORITY

/* Constants required to disable the watchdog. */
#define mainDISABLE_BYTE_1			( ( unsigned portCHAR ) 0xde )
#define mainDISABLE_BYTE_2			( ( unsigned portCHAR ) 0xad )

/* Constants to setup and use the on board LED. */
#define ucLED_BIT					( ( unsigned portCHAR ) 0x40 )
#define mainPORT_1_BIT_6			( ( unsigned portCHAR ) 0x40 )
#define mainENABLE_CROSS_BAR		( ( unsigned portCHAR ) 0x40 )

/* Constants to set the clock frequency. */
#define mainSELECT_INTERNAL_OSC		( ( unsigned portCHAR ) 0x80 )
#define mainDIVIDE_CLOCK_BY_1		( ( unsigned portCHAR ) 0x03 )
#define mainPLL_USES_INTERNAL_OSC	( ( unsigned portCHAR ) 0x04 )
#define mainFLASH_READ_TIMING		( ( unsigned portCHAR ) 0x30 )
#define mainPLL_POWER_ON			( ( unsigned portCHAR ) 0x01 )
#define mainPLL_NO_PREDIVIDE		( ( unsigned portCHAR ) 0x01 )
#define mainPLL_FILTER				( ( unsigned portCHAR ) 0x01 )
#define mainPLL_MULTIPLICATION		( ( unsigned portCHAR ) 0x04 )
#define mainENABLE_PLL				( ( unsigned portCHAR ) 0x02 )
#define mainPLL_LOCKED				( ( unsigned portCHAR ) 0x10 )
#define mainSELECT_PLL_AS_SOURCE	( ( unsigned portCHAR ) 0x02 )

/* Toggle rate for the on board LED - which is dependent on whether or not
an error has been detected. */
#define mainNO_ERROR_FLASH_PERIOD	( ( portTickType ) 5000 )
#define mainERROR_FLASH_PERIOD		( ( portTickType ) 250 )

/* Baud rate used by the serial port tasks. */
#define mainCOM_TEST_BAUD_RATE		( ( unsigned portLONG ) 115200 )

/* Pass an invalid LED number to the COM test task as we don't want it to flash
an LED.  There are only 8 LEDs (excluding the on board LED) wired in and these
are all used by the flash tasks. */
#define mainCOM_TEST_LED			( 200 )

/* We want the Cygnal to act as much as possible as a standard 8052. */
#define mainAUTO_SFR_OFF			( ( unsigned portCHAR ) 0 )

/* Constants required to setup the IO pins for serial comms. */
#define mainENABLE_COMS 			( ( unsigned portCHAR ) 0x04 )
#define mainCOMS_LINES_TO_PUSH_PULL ( ( unsigned portCHAR ) 0x03 )

/* Pointer passed as a parameter to vRegisterCheck() just so it has some know
values to check for in the DPH, DPL and B registers. */
#define mainDUMMY_POINTER		( ( xdata void * ) 0xabcd )

/* Macro that lets vErrorChecks() know that one of the tasks defined in
main. c has detected an error.  A critical region is used around xLatchError
as it is accessed from vErrorChecks(), which has a higher priority. */ 
#define mainLATCH_ERROR()			\
{									\
	portENTER_CRITICAL();			\
		xLatchedError = pdTRUE;		\
	portEXIT_CRITICAL();			\
}

/*
 * Setup the Cygnal microcontroller for its fastest operation. 
 */
static void prvSetupSystemClock( void );

/*
 * Setup the peripherals, including the on board LED. 
 */
static void prvSetupHardware( void );

/*
 * Toggle the state of the on board LED. 
 */
static void prvToggleOnBoardLED( void );

/*
 * See comments at the top of the file for details. 
 */
static void vErrorChecks( void *pvParameters );

/*
 * See comments at the top of the file for details. 
 */
static void vRegisterCheck( void *pvParameters );

/*
 * See comments at the top of the file for details. 
 */
static void vFLOPCheck1( void *pvParameters );

/*
 * See comments at the top of the file for details. 
 */
static void vFLOPCheck2( void *pvParameters );

/* File scope variable used to communicate the occurrence of an error between
tasks. */
static portBASE_TYPE xLatchedError = pdFALSE;

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

/*
 * Starts all the other tasks, then starts the scheduler. 
 */
void main( void )
{
	/* Initialise the hardware including the system clock and on board
	LED. */
	prvSetupHardware();

	/* Initialise the port that controls the external LED's utilized by the
	flash tasks. */
	vParTestInitialise();

	/* Start the used standard demo tasks. */
	vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
	vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
	vStartIntegerMathTasks( mainINTEGER_PRIORITY );
	vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
	vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );

	/* Start the tasks defined in this file.  The first three never block so
	must not be used with the co-operative scheduler. */
	#if configUSE_PREEMPTION == 1
	{
		xTaskCreate( vRegisterCheck, "RegChck", configMINIMAL_STACK_SIZE, mainDUMMY_POINTER, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );
		xTaskCreate( vFLOPCheck1, "FLOP", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );
		xTaskCreate( vFLOPCheck2, "FLOP", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );
	}
	#endif 

	xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, ( xTaskHandle * ) NULL );

	/* Finally kick off the scheduler.  This function should never return. */
	vTaskStartScheduler();

	/* Should never reach here as the tasks will now be executing under control
	of the scheduler. */
}
/*-----------------------------------------------------------*/

/*
 * Setup the hardware prior to using the scheduler.  Most of the Cygnal
 * specific initialisation is performed here leaving standard 8052 setup
 * only in the driver code.
 */
static void prvSetupHardware( void )
{
unsigned portCHAR ucOriginalSFRPage;

	/* Remember the SFR page before it is changed so it can get set back
	before the function exits. */
	ucOriginalSFRPage = SFRPAGE;

	/* Setup the SFR page to access the config SFR's. */
	SFRPAGE = CONFIG_PAGE;

	/* Don't allow the microcontroller to automatically switch SFR page, as the
	SFR page is not stored as part of the task context. */
	SFRPGCN = mainAUTO_SFR_OFF;

	/* Disable the watchdog. */
	WDTCN = mainDISABLE_BYTE_1;
	WDTCN = mainDISABLE_BYTE_2;

	/* Set the on board LED to push pull. */
	P1MDOUT |= mainPORT_1_BIT_6;

	/* Setup the cross bar to enable serial comms here as it is not part of the 
	standard 8051 setup and therefore is not in the driver code. */
	XBR0 |= mainENABLE_COMS;
	P0MDOUT |= mainCOMS_LINES_TO_PUSH_PULL;

	/* Enable the cross bar so our hardware setup takes effect. */
	XBR2 = mainENABLE_CROSS_BAR;

	/* Setup a fast system clock. */
	prvSetupSystemClock();

	/* Return the SFR page. */
	SFRPAGE = ucOriginalSFRPage;
}
/*-----------------------------------------------------------*/

static void prvSetupSystemClock( void )
{
volatile unsigned portSHORT usWait;
const unsigned portSHORT usWaitTime = ( unsigned portSHORT ) 0x2ff;
unsigned portCHAR ucOriginalSFRPage;

	/* Remember the SFR page so we can set it back at the end. */
	ucOriginalSFRPage = SFRPAGE;
	SFRPAGE = CONFIG_PAGE;

	/* Use the internal oscillator set to its fasted frequency. */
	OSCICN = mainSELECT_INTERNAL_OSC | mainDIVIDE_CLOCK_BY_1;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人女星排名| 99精品一区二区| 午夜精品久久久久久久99水蜜桃 | 福利电影一区二区| 久久99国内精品| 狠狠色丁香婷综合久久| 久久国产精品99精品国产 | www.av精品| 成人精品鲁一区一区二区| 粗大黑人巨茎大战欧美成人| 福利一区二区在线| 99综合电影在线视频| 日本丶国产丶欧美色综合| 欧美综合亚洲图片综合区| 欧美日韩色一区| 3d动漫精品啪啪1区2区免费| 日韩欧美成人午夜| 久久久久久久国产精品影院| 国产精品不卡在线观看| 伊人性伊人情综合网| 天堂久久一区二区三区| 免费一级片91| 粗大黑人巨茎大战欧美成人| 91久久奴性调教| 欧美一级黄色片| 中文一区二区在线观看| 夜色激情一区二区| 久热成人在线视频| www.亚洲精品| 91精品久久久久久蜜臀| 久久久久久免费网| 一区二区三区高清在线| 六月丁香婷婷色狠狠久久| 成人免费看视频| 欧美日韩精品高清| 久久日一线二线三线suv| 国产精品国产精品国产专区不片| 亚洲www啪成人一区二区麻豆| 国内精品嫩模私拍在线| 在线免费不卡视频| 久久嫩草精品久久久精品一| 一区二区在线免费| 国产精品中文有码| 欧美丰满少妇xxxxx高潮对白| 国产亚洲精品aa| 日韩专区欧美专区| 99精品一区二区| 2023国产精品视频| 亚洲国产一区视频| 91丝袜国产在线播放| 国产亚洲精品资源在线26u| 日韩电影在线一区| 日本久久电影网| 亚洲欧洲成人精品av97| 久久se这里有精品| 91精品国产色综合久久| 一区二区在线免费| 色综合一个色综合| 国产精品嫩草影院com| 国产资源在线一区| 日韩片之四级片| 日韩在线一区二区| 欧美人与禽zozo性伦| 一区二区在线免费观看| 91原创在线视频| 国产精品久久久久久亚洲毛片| 国产一区在线观看麻豆| 91精品国产色综合久久不卡电影 | 欧美成人伊人久久综合网| 国产精品五月天| 久久国产精品色| 欧美日韩国产精选| 亚洲精品一区二区三区精华液| 天使萌一区二区三区免费观看| 91丨九色丨蝌蚪富婆spa| 精品国产乱码久久久久久久| 亚洲第一综合色| 日本韩国欧美在线| 国产精品视频免费看| 国产福利一区二区| 久久免费的精品国产v∧| 捆绑紧缚一区二区三区视频| 欧美日韩大陆一区二区| 中文字幕乱码久久午夜不卡| 日本va欧美va精品| 欧美sm美女调教| 久久99精品视频| 欧美一激情一区二区三区| 亚洲综合自拍偷拍| 欧美中文字幕一二三区视频| 亚洲免费av高清| 91视视频在线观看入口直接观看www| 国产欧美一区视频| 国产精品自拍在线| 日本一区免费视频| 高清成人在线观看| 国产精品久久午夜| 99精品视频在线观看| 亚洲国产电影在线观看| 国产精品影视在线观看| 国产精品看片你懂得| 99久久伊人久久99| 亚洲同性gay激情无套| 9人人澡人人爽人人精品| 综合色天天鬼久久鬼色| 色久综合一二码| 午夜电影网亚洲视频| 欧美日韩精品一区二区三区四区| 精品一区二区免费| 国产亚洲精品福利| 91亚洲国产成人精品一区二区三 | 国产乱对白刺激视频不卡| 久久众筹精品私拍模特| 国产成人精品免费网站| 日韩美女精品在线| 精品国产电影一区二区| 国产成人免费视频| 亚洲欧洲成人精品av97| 欧美另类高清zo欧美| 国内精品免费在线观看| 成人欧美一区二区三区视频网页| 色婷婷狠狠综合| 亚洲成av人影院| 亚洲视频在线观看一区| 在线欧美日韩国产| 捆绑调教美女网站视频一区| 国产精品视频一区二区三区不卡| 欧美在线免费观看亚洲| 韩国毛片一区二区三区| 国产精品免费丝袜| 久久综合中文字幕| 色八戒一区二区三区| 久久国产精品72免费观看| 中文字幕亚洲视频| 日韩一区二区精品在线观看| 不卡一区中文字幕| 蜜臀av亚洲一区中文字幕| 国产精品久久久久久久浪潮网站| 欧美精品少妇一区二区三区 | 日韩av一二三| 国产精品女主播av| 欧美电视剧免费全集观看| 91在线一区二区三区| 国产在线乱码一区二区三区| 亚洲国产欧美在线| 国产精品人妖ts系列视频| 91精品啪在线观看国产60岁| 欧美丰满少妇xxxxx高潮对白| 成人av手机在线观看| 精品夜夜嗨av一区二区三区| 亚洲免费资源在线播放| 欧美经典一区二区三区| 日韩亚洲欧美高清| 99久久精品免费看| 91在线精品一区二区| 国产在线视频一区二区| 蜜芽一区二区三区| 日韩精品一区第一页| 亚洲码国产岛国毛片在线| 中文字幕国产一区二区| 最新国产成人在线观看| 欧美国产日本韩| 久久免费美女视频| 日韩视频在线一区二区| 在线播放日韩导航| 欧美日韩一区国产| 91视频观看视频| 91视频你懂的| 99久久国产综合精品麻豆| 成人影视亚洲图片在线| 高清视频一区二区| 成人av资源下载| 91丨porny丨蝌蚪视频| 99久久伊人久久99| 91精品国产入口| 欧美一级电影网站| 日韩欧美国产小视频| 日韩欧美精品在线视频| 日韩你懂的在线观看| 91精品国产欧美一区二区成人 | 日韩欧美一二三| 日韩精品一区国产麻豆| 欧美视频一区二区三区在线观看| 日韩欧美www| 久久久不卡网国产精品一区| 中文成人av在线| 亚洲欧美另类久久久精品| 一区二区三区.www| 日韩中文字幕不卡| 久久国产精品99久久人人澡| 国产精品18久久久久久久网站| 丁香啪啪综合成人亚洲小说| 99久久久久免费精品国产 | 欧美aaaaaa午夜精品| 免费成人在线影院| 国产成人亚洲精品青草天美| www.日韩在线| 在线一区二区视频| 2020日本不卡一区二区视频| 国产精品国产三级国产a|