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

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

?? main.c

?? 最新版FreeRTOS, 包擴多種開發平臺的移植
?? C
字號:
/*
	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 all the demo application tasks, then starts the scheduler.  The WEB
 * documentation provides more details of the demo application tasks.
 *
 * Main. c also creates a task called "Check".  This only executes every three
 * seconds but has the highest priority so is guaranteed to get processor time.
 * Its main function is to check that all the other tasks are still operational.
 * Each task that does not flash an LED maintains a unique count that is
 * incremented each time the task successfully completes its function.  Should
 * any error occur within such a task the count is permanently halted.  The
 * check task inspects the count of each task to ensure it has changed since
 * the last time the check task executed.  If all the count variables have
 * changed all the tasks are still executing error free, and the check task
 * toggles an LED.  Should any task contain an error at any time the LED toggle
 * will stop.
 *
 * The LED flash and communications test tasks do not maintain a count.
 */

/*
Changes from V1.2.0
	
	+ Changed the baud rate for the serial test from 19200 to 57600.

Changes from V1.2.3

	+ The integer and comtest tasks are now used when the cooperative scheduler
	  is being used.  Previously they were only used with the preemptive
	  scheduler.

Changes from V1.2.5

	+ Set the baud rate to 38400.  This has a smaller error percentage with an
	  8MHz clock (according to the manual).

Changes from V2.0.0

	+ Delay periods are now specified using variables and constants of
	  portTickType rather than unsigned portLONG.

Changes from V2.2.0

	+ File can now be built using either the IAR or WinAVR compiler.

Changes from V2.6.1

	+ The IAR and WinAVR AVR ports are now maintained separately.

Changes from V4.0.5

	+ Modified to demonstrate the use of co-routines.
*/

#include <stdlib.h>
#include <string.h>

#ifdef GCC_MEGA_AVR
	/* EEPROM routines used only with the WinAVR compiler. */
	#include <avr/eeprom.h>
#endif

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

/* Demo file headers. */
#include "PollQ.h"
#include "integer.h"
#include "serial.h"
#include "comtest.h"
#include "crflash.h"
#include "print.h"
#include "partest.h"
#include "regtest.h"

/* Priority definitions for most of the tasks in the demo application.  Some
tasks just use the idle priority. */
#define mainLED_TASK_PRIORITY			( tskIDLE_PRIORITY + 1 )
#define mainCOM_TEST_PRIORITY			( tskIDLE_PRIORITY + 2 )
#define mainQUEUE_POLL_PRIORITY			( tskIDLE_PRIORITY + 2 )
#define mainCHECK_TASK_PRIORITY			( tskIDLE_PRIORITY + 3 )

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

/* LED used by the serial port tasks.  This is toggled on each character Tx,
and mainCOM_TEST_LED + 1 is toggles on each character Rx. */
#define mainCOM_TEST_LED				( 4 )

/* LED that is toggled by the check task.  The check task periodically checks
that all the other tasks are operating without error.  If no errors are found
the LED is toggled.  If an error is found at any time the LED is never toggles
again. */
#define mainCHECK_TASK_LED				( 7 )

/* The period between executions of the check task. */
#define mainCHECK_PERIOD				( ( portTickType ) 3000 / portTICK_RATE_MS  )

/* An address in the EEPROM used to count resets.  This is used to check that
the demo application is not unexpectedly resetting. */
#define mainRESET_COUNT_ADDRESS			( ( void * ) 0x50 )

/* The number of coroutines to create. */
#define mainNUM_FLASH_COROUTINES		( 3 )

/*
 * The task function for the "Check" task.
 */
static void vErrorChecks( void *pvParameters );

/*
 * Checks the unique counts of other tasks to ensure they are still operational.
 * Flashes an LED if everything is okay.
 */
static void prvCheckOtherTasksAreStillRunning( void );

/*
 * Called on boot to increment a count stored in the EEPROM.  This is used to
 * ensure the CPU does not reset unexpectedly.
 */
static void prvIncrementResetCount( void );

/*
 * Idle hook is used to scheduler co-routines.
 */
void vApplicationIdleHook( void );	

portSHORT main( void )
{
	prvIncrementResetCount();

	/* Setup the LED's for output. */
	vParTestInitialise();

	/* Create the standard demo tasks. */
	vStartIntegerMathTasks( tskIDLE_PRIORITY );
	vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
	vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
	vStartRegTestTasks();
	
	/* Create the tasks defined within this file. */
	xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );

	/* Create the co-routines that flash the LED's. */
	vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES );
	
	/* In this port, to use preemptive scheduler define configUSE_PREEMPTION
	as 1 in portmacro.h.  To use the cooperative scheduler define
	configUSE_PREEMPTION as 0. */
	vTaskStartScheduler();

	return 0;
}
/*-----------------------------------------------------------*/

static void vErrorChecks( void *pvParameters )
{
static volatile unsigned portLONG ulDummyVariable = 3UL;

	/* The parameters are not used. */
	( void ) pvParameters;

	/* Cycle for ever, delaying then checking all the other tasks are still
	operating without error. */
	for( ;; )
	{
		vTaskDelay( mainCHECK_PERIOD );

		/* Perform a bit of 32bit maths to ensure the registers used by the
		integer tasks get some exercise. The result here is not important -
		see the demo application documentation for more info. */
		ulDummyVariable *= 3;
		
		prvCheckOtherTasksAreStillRunning();
	}
}
/*-----------------------------------------------------------*/

static void prvCheckOtherTasksAreStillRunning( void )
{
static portBASE_TYPE xErrorHasOccurred = pdFALSE;

	if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
	{
		xErrorHasOccurred = pdTRUE;
	}

	if( xAreComTestTasksStillRunning() != pdTRUE )
	{
		xErrorHasOccurred = pdTRUE;
	}

	if( xArePollingQueuesStillRunning() != pdTRUE )
	{
		xErrorHasOccurred = pdTRUE;
	}

	if( xAreRegTestTasksStillRunning() != pdTRUE )
	{
		xErrorHasOccurred = pdTRUE;
	}
	
	if( xErrorHasOccurred == pdFALSE )
	{
		/* Toggle the LED if everything is okay so we know if an error occurs even if not
		using console IO. */
		vParTestToggleLED( mainCHECK_TASK_LED );
	}
}
/*-----------------------------------------------------------*/

static void prvIncrementResetCount( void )
{
unsigned portCHAR ucCount;
const unsigned portCHAR ucReadBit = ( unsigned portCHAR ) 0x01;
const unsigned portCHAR ucWrite1 = ( unsigned portCHAR ) 0x04;
const unsigned portCHAR ucWrite2 = ( unsigned portCHAR ) 0x02;

	/* Increment the EEPROM value at 0x00.
	
	Setup the EEPROM address. */
	EEARH = 0x00;
	EEARL = 0x00;
	
	/* Set the read enable bit. */
	EECR |= ucReadBit;

	/* Wait for the read. */
	while( EECR & ucReadBit );
	
	/* The byte is ready. */
	ucCount = EEDR;
	
	/* Increment the reset count, then write the byte back. */
	ucCount++;
	EEDR = ucCount;
	EECR = ucWrite1;
	EECR = ( ucWrite1 | ucWrite2 );
}
/*-----------------------------------------------------------*/

void vApplicationIdleHook( void )
{
	vCoRoutineSchedule();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久影院色老大| 亚洲二区视频在线| 欧美成人vr18sexvr| 制服视频三区第一页精品| 久久欧美一区二区| 日韩美女视频一区二区| 五月激情丁香一区二区三区| 国内精品伊人久久久久影院对白| 成人app在线| 9191国产精品| 国产精品麻豆久久久| 国产亚洲1区2区3区| 一区二区高清在线| 国产精品自拍网站| 欧美日韩欧美一区二区| 久久久不卡影院| 亚洲一二三区视频在线观看| 国产乱人伦偷精品视频免下载| 欧美三级在线视频| 精品国产乱码久久久久久久| 中文字幕亚洲精品在线观看| 美女一区二区视频| 91久久精品一区二区三区| 久久综合网色—综合色88| 亚洲国产毛片aaaaa无费看| 粉嫩13p一区二区三区| 欧美一区2区视频在线观看| 亚洲麻豆国产自偷在线| 精品在线视频一区| 欧美三级中文字幕在线观看| 亚洲人成在线观看一区二区| 国产一区高清在线| 欧美顶级少妇做爰| 亚洲综合色区另类av| 免费欧美日韩国产三级电影| 欧美亚洲综合久久| 亚洲乱码国产乱码精品精98午夜| 成人中文字幕电影| 久久久国产午夜精品| 免费在线观看视频一区| 欧美日韩一级片网站| 一区二区三区av电影| 91免费版pro下载短视频| 国产精品美女视频| 国产一区二三区好的| 欧美大片免费久久精品三p| 香蕉av福利精品导航| 在线亚洲高清视频| 亚洲午夜三级在线| 一本大道综合伊人精品热热| 国产精品天天看| 国产精品一区二区久久不卡| 精品电影一区二区| 久久aⅴ国产欧美74aaa| 制服丝袜激情欧洲亚洲| 蜜桃精品视频在线| 日韩欧美在线影院| 久久精品噜噜噜成人88aⅴ| 91精品国产一区二区| 美国十次了思思久久精品导航| 日本乱码高清不卡字幕| 亚洲一区在线播放| 欧美高清视频不卡网| 奇米精品一区二区三区在线观看一| 欧美二区三区91| 久久电影网站中文字幕| 久久精品欧美一区二区三区不卡| 激情综合色综合久久综合| 欧美大片日本大片免费观看| 国产精品亚洲一区二区三区在线| 久久精品一区二区三区av| 99久久免费视频.com| 伊人性伊人情综合网| 4438x成人网最大色成网站| 久久99久久99小草精品免视看| 久久亚洲一区二区三区明星换脸 | 久久99精品久久久久久动态图| 日韩一区二区免费在线电影| 国产麻豆视频一区| 精品福利一二区| 99久久亚洲一区二区三区青草| 亚洲成人黄色影院| 国产校园另类小说区| 91麻豆视频网站| 久久se精品一区二区| 日韩美女精品在线| 91精品国产色综合久久不卡蜜臀| 激情欧美一区二区| 亚洲国产精品精华液2区45| 在线一区二区三区| 久久av老司机精品网站导航| 国产精品乱人伦中文| 欧美色男人天堂| 国产福利一区二区三区视频在线 | 精品精品国产高清a毛片牛牛| 成人免费三级在线| 天堂久久久久va久久久久| 欧美激情在线观看视频免费| 欧美日韩精品一区二区天天拍小说| 另类专区欧美蜜桃臀第一页| 亚洲最大成人综合| 国产色爱av资源综合区| 欧美在线高清视频| 美日韩一区二区| 亚洲一区二区精品3399| 国产人久久人人人人爽| 欧美一区二区三区四区五区| 色综合夜色一区| 国产盗摄女厕一区二区三区 | 亚洲va欧美va天堂v国产综合| 精品欧美一区二区在线观看| 精品视频在线免费| 99久久精品国产一区| 国内精品国产三级国产a久久| 亚洲一区成人在线| 亚洲精品老司机| 国产夜色精品一区二区av| 欧美精品久久久久久久多人混战| 91免费国产在线| 99久久精品免费看| 风间由美性色一区二区三区| 激情综合网最新| 久久国产精品一区二区| 日韩精品电影一区亚洲| 亚洲精品成人少妇| 亚洲日韩欧美一区二区在线| 18成人在线视频| 国产精品视频麻豆| 久久久高清一区二区三区| 久久婷婷色综合| 26uuu色噜噜精品一区| 精品国产在天天线2019| 日韩视频一区二区三区在线播放 | 韩国视频一区二区| 亚洲bt欧美bt精品777| 青青青伊人色综合久久| 国产精品88888| 色天使久久综合网天天| 7777精品伊人久久久大香线蕉经典版下载| 91精品麻豆日日躁夜夜躁| 精品美女一区二区三区| 国产精品麻豆视频| 亚洲国产aⅴ天堂久久| 麻豆国产一区二区| 成人国产精品免费观看视频| 欧美亚洲一区三区| 久久色成人在线| 夜色激情一区二区| 九一久久久久久| 91女厕偷拍女厕偷拍高清| 91精品国产麻豆国产自产在线| 久久丝袜美腿综合| 亚洲国产精品综合小说图片区| 久草在线在线精品观看| 日本道精品一区二区三区| 日韩亚洲国产中文字幕欧美| 中文子幕无线码一区tr| 日韩福利视频网| 成人午夜短视频| 6080亚洲精品一区二区| 亚洲色图欧美偷拍| 国产综合久久久久久鬼色| 蜜桃视频在线观看一区二区| 波多野结衣的一区二区三区| 欧美日本视频在线| 自拍偷拍亚洲激情| 国产一区二区三区视频在线播放| 色琪琪一区二区三区亚洲区| 精品久久久久99| 亚洲第一福利一区| 成人app下载| 久久影视一区二区| 首页综合国产亚洲丝袜| 91丝袜呻吟高潮美腿白嫩在线观看| 日韩精品影音先锋| 亚洲午夜国产一区99re久久| 成人av资源在线| 26uuu欧美日本| 麻豆精品新av中文字幕| 欧美日韩大陆一区二区| 亚洲综合色婷婷| 91在线无精精品入口| 日本一区二区免费在线| 国产在线不卡一区| 欧美tk—视频vk| 免费三级欧美电影| 日韩一区二区在线看片| 午夜精品久久久久| 欧美亚洲愉拍一区二区| 一区二区三区在线视频免费观看| 懂色一区二区三区免费观看| 久久先锋影音av| 国产九色精品成人porny| 91精品国产福利| 蜜臀99久久精品久久久久久软件| 在线不卡a资源高清| 日韩和欧美一区二区三区| 欧美三级乱人伦电影| 亚洲超丰满肉感bbw| 91麻豆精品国产自产在线|