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

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

?? death.c

?? MCS-51的一個Free小型操作系統,在KeilC中下編譯工作
?? C
字號:
/*
	FreeRTOS.org V4.1.3 - 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.
	***************************************************************************
*/

/**
 * Create a single persistent task which periodically dynamically creates another
 * four tasks.  The original task is called the creator task, the four tasks it
 * creates are called suicidal tasks.
 *
 * Two of the created suicidal tasks kill one other suicidal task before killing
 * themselves - leaving just the original task remaining.
 *
 * The creator task must be spawned after all of the other demo application tasks
 * as it keeps a check on the number of tasks under the scheduler control.  The
 * number of tasks it expects to see running should never be greater than the
 * number of tasks that were in existence when the creator task was spawned, plus
 * one set of four suicidal tasks.  If this number is exceeded an error is flagged.
 *
 * \page DeathC death.c
 * \ingroup DemoFiles
 * <HR>
 */

/*
Changes from V3.0.0
	+ CreationCount sizes changed from unsigned portBASE_TYPE to
	  unsigned portSHORT to minimize the risk of overflowing.
	
	+ Reset of usLastCreationCount added
	
Changes from V3.1.0
	+ Changed the dummy calculation to use variables of type long, rather than
	  float.  This allows the file to be used with ports that do not support
	  floating point.

*/

#include <stdlib.h>

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

/* Demo program include files. */
#include "death.h"

#define deathSTACK_SIZE		( configMINIMAL_STACK_SIZE + 24 )

/* The task originally created which is responsible for periodically dynamically
creating another four tasks. */
static portTASK_FUNCTION_PROTO( vCreateTasks, pvParameters );

/* The task function of the dynamically created tasks. */
static portTASK_FUNCTION_PROTO( vSuicidalTask, pvParameters );

/* A variable which is incremented every time the dynamic tasks are created.  This
is used to check that the task is still running. */
static volatile unsigned portSHORT usCreationCount = 0;

/* Used to store the number of tasks that were originally running so the creator
task can tell if any of the suicidal tasks have failed to die.
*/
static volatile unsigned portBASE_TYPE uxTasksRunningAtStart = 0;

/* Tasks are deleted by the idle task.  Under heavy load the idle task might
not get much processing time, so it would be legitimate for several tasks to
remain undeleted for a short period. */
static const unsigned portBASE_TYPE uxMaxNumberOfExtraTasksRunning = 4;

/* Used to store a handle to the tasks that should be killed by a suicidal task,
before it kills itself. */
xTaskHandle xCreatedTask1, xCreatedTask2;

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

void vCreateSuicidalTasks( unsigned portBASE_TYPE uxPriority )
{
unsigned portBASE_TYPE *puxPriority;

	/* Create the Creator tasks - passing in as a parameter the priority at which
	the suicidal tasks should be created. */
	puxPriority = ( unsigned portBASE_TYPE * ) pvPortMalloc( sizeof( unsigned portBASE_TYPE ) );
	*puxPriority = uxPriority;

	xTaskCreate( vCreateTasks, "CREATOR", deathSTACK_SIZE, ( void * ) puxPriority, uxPriority, NULL );

	/* Record the number of tasks that are running now so we know if any of the
	suicidal tasks have failed to be killed. */
	uxTasksRunningAtStart = ( unsigned portBASE_TYPE ) uxTaskGetNumberOfTasks();
	
	/* FreeRTOS.org versions before V3.0 started the idle-task as the very
	first task. The idle task was then already included in uxTasksRunningAtStart.
	From FreeRTOS V3.0 on, the idle task is started when the scheduler is
	started. Therefore the idle task is not yet accounted for. We correct
	this by increasing uxTasksRunningAtStart by 1. */
	uxTasksRunningAtStart++;
}
/*-----------------------------------------------------------*/
					
static portTASK_FUNCTION( vSuicidalTask, pvParameters )
{
volatile portLONG l1, l2;
xTaskHandle xTaskToKill;
const portTickType xDelay = ( portTickType ) 200 / portTICK_RATE_MS;

	if( pvParameters != NULL )
	{
		/* This task is periodically created four times.  Two created tasks are
		passed a handle to the other task so it can kill it before killing itself.
		The other task is passed in null. */
		xTaskToKill = *( xTaskHandle* )pvParameters;
	}
	else
	{
		xTaskToKill = NULL;
	}

	for( ;; )
	{
		/* Do something random just to use some stack and registers. */
		l1 = 2;
		l2 = 89;
		l2 *= l1;
		vTaskDelay( xDelay );

		if( xTaskToKill != NULL )
		{
			/* Make sure the other task has a go before we delete it. */
			vTaskDelay( ( portTickType ) 0 );
			/* Kill the other task that was created by vCreateTasks(). */
			vTaskDelete( xTaskToKill );
			/* Kill ourselves. */
			vTaskDelete( NULL );
		}
	}
}/*lint !e818 !e550 Function prototype must be as per standard for task functions. */
/*-----------------------------------------------------------*/

static portTASK_FUNCTION( vCreateTasks, pvParameters )
{
const portTickType xDelay = ( portTickType ) 1000 / portTICK_RATE_MS;
unsigned portBASE_TYPE uxPriority;

	uxPriority = *( unsigned portBASE_TYPE * ) pvParameters;
	vPortFree( pvParameters );

	for( ;; )
	{
		/* Just loop round, delaying then creating the four suicidal tasks. */
		vTaskDelay( xDelay );

		xTaskCreate( vSuicidalTask, "SUICID1", deathSTACK_SIZE, NULL, uxPriority, &xCreatedTask1 );
		xTaskCreate( vSuicidalTask, "SUICID2", deathSTACK_SIZE, &xCreatedTask1, uxPriority, NULL );

		xTaskCreate( vSuicidalTask, "SUICID1", deathSTACK_SIZE, NULL, uxPriority, &xCreatedTask2 );
		xTaskCreate( vSuicidalTask, "SUICID2", deathSTACK_SIZE, &xCreatedTask2, uxPriority, NULL );

		++usCreationCount;
	}
}
/*-----------------------------------------------------------*/

/* This is called to check that the creator task is still running and that there
are not any more than four extra tasks. */
portBASE_TYPE xIsCreateTaskStillRunning( void )
{
static portSHORT usLastCreationCount = -1;
portBASE_TYPE xReturn = pdTRUE;
static unsigned portBASE_TYPE uxTasksRunningNow;

	if( usLastCreationCount == usCreationCount )
	{
		xReturn = pdFALSE;
	}
	else
	{
		usLastCreationCount = usCreationCount;
	}
	
	uxTasksRunningNow = ( unsigned portBASE_TYPE ) uxTaskGetNumberOfTasks();

	if( uxTasksRunningNow < uxTasksRunningAtStart )
	{
		xReturn = pdFALSE;
	}
	else if( ( uxTasksRunningNow - uxTasksRunningAtStart ) > uxMaxNumberOfExtraTasksRunning )
	{
		xReturn = pdFALSE;
	}
	else
	{
		/* Everything is okay. */
	}

	return xReturn;
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线亚洲精品福利网址导航| 欧美亚洲动漫精品| 亚洲人快播电影网| 91精品国产高清一区二区三区蜜臀| 国产成人a级片| 日韩av不卡一区二区| 亚洲男同性视频| 国产欧美日韩一区二区三区在线观看 | 26uuu国产在线精品一区二区| 91成人国产精品| 成人激情小说网站| 激情深爱一区二区| 日韩极品在线观看| 亚洲一区二区三区三| 国产精品久线观看视频| 亚洲精品一区二区三区蜜桃下载 | 一区二区三区四区不卡在线| 国产亚洲美州欧州综合国| 欧美一区二区在线视频| 欧美在线三级电影| 色综合天天综合网天天看片| 国产大片一区二区| 国产一区二区主播在线| 免费成人你懂的| 三级不卡在线观看| 亚洲bdsm女犯bdsm网站| 亚洲中国最大av网站| 亚洲激情图片一区| 亚洲欧美日韩国产综合| 中文字幕一区二区三| 国产精品夫妻自拍| 国产精品视频线看| 国产精品久久久久影院色老大| 久久久影视传媒| 欧美r级在线观看| 欧美成人精品福利| 26uuu色噜噜精品一区二区| 欧美mv日韩mv亚洲| 欧美精品一区二区三区一线天视频 | 6080午夜不卡| 欧美一级久久久久久久大片| 91精品国产综合久久小美女 | 17c精品麻豆一区二区免费| 国产精品三级视频| 亚洲天堂成人网| 一区二区三区四区五区视频在线观看| 中文字幕在线不卡视频| 亚洲丝袜美腿综合| 亚洲精品成人在线| 亚洲6080在线| 极品少妇一区二区| 高清免费成人av| 91色在线porny| 欧美日韩免费一区二区三区| 欧美剧情电影在线观看完整版免费励志电影| 欧美午夜精品免费| 日韩一区二区三区av| 久久婷婷色综合| 国产精品久久久久久久久晋中| 亚洲欧美日韩综合aⅴ视频| 亚洲愉拍自拍另类高清精品| 日本不卡中文字幕| 国产精品亚洲一区二区三区在线| www.亚洲色图| 欧美日韩一区三区| 欧美精品一区二区三区久久久| 国产欧美日本一区二区三区| 亚洲精品国产成人久久av盗摄| 三级欧美在线一区| 粉嫩一区二区三区性色av| 91网上在线视频| 欧美一区永久视频免费观看| 国产欧美一区二区三区在线老狼| 亚洲人成7777| 久久99国产精品久久99| 91免费在线视频观看| 日韩一区二区三区在线| 国产精品私房写真福利视频| 午夜影院久久久| 国产乱码字幕精品高清av| 色乱码一区二区三区88| 日韩精品一区二区三区视频播放 | 久久国产精品无码网站| 成人妖精视频yjsp地址| 欧美精品粉嫩高潮一区二区| 国产亚洲美州欧州综合国| 亚洲自拍偷拍欧美| 国产精品一线二线三线精华| 在线精品视频免费播放| 精品99999| 亚洲成人动漫一区| www.爱久久.com| 日韩欧美国产精品| 亚洲国产欧美一区二区三区丁香婷| 极品少妇xxxx偷拍精品少妇| 欧美特级限制片免费在线观看| 久久综合国产精品| 亚洲影院免费观看| 成人av先锋影音| 久久网站最新地址| 日韩av中文字幕一区二区| 一本到不卡免费一区二区| 国产亚洲一区二区三区在线观看| 日韩在线a电影| 欧洲生活片亚洲生活在线观看| 国产欧美一区二区三区沐欲| 麻豆精品在线观看| 欧美二区三区91| 亚洲欧美日韩系列| 成人久久视频在线观看| 欧美精品一区二区三区蜜桃视频| 日韩激情在线观看| 欧美系列一区二区| 一区二区三区精品在线| 成人高清伦理免费影院在线观看| 精品剧情在线观看| 麻豆国产一区二区| 欧美一区二区三区在线| 天天综合天天综合色| 欧美调教femdomvk| 亚洲一区二区三区美女| 色婷婷综合久久久中文字幕| 欧美激情一区二区三区蜜桃视频 | 日韩一级欧美一级| 偷窥少妇高潮呻吟av久久免费| 欧亚洲嫩模精品一区三区| 亚洲人成网站影音先锋播放| 99视频国产精品| 亚洲视频小说图片| 99热精品一区二区| 亚洲免费在线观看| 日本道精品一区二区三区| 亚洲美女免费视频| 欧洲一区二区三区在线| 中文字幕一区二区三区乱码在线| 不卡av免费在线观看| 中文字幕va一区二区三区| 成人97人人超碰人人99| 一色屋精品亚洲香蕉网站| 99九九99九九九视频精品| 亚洲色图另类专区| 一本大道av伊人久久综合| 亚洲女厕所小便bbb| 欧美影院一区二区三区| 无码av中文一区二区三区桃花岛| 337p亚洲精品色噜噜噜| 理论片日本一区| 久久久久久久综合日本| 成人午夜av影视| 亚洲欧美激情一区二区| 欧美视频在线播放| 丝袜美腿亚洲色图| 精品电影一区二区| 成人动漫中文字幕| 亚洲一区二区三区精品在线| 欧美高清视频一二三区 | 成人亚洲一区二区一| 亚洲婷婷综合色高清在线| 91国偷自产一区二区开放时间 | 51久久夜色精品国产麻豆| 精品一二线国产| 中文在线免费一区三区高中清不卡| 波多野结衣在线aⅴ中文字幕不卡| 亚洲人亚洲人成电影网站色| 欧美久久久久中文字幕| 狠狠色丁香久久婷婷综合_中| 国产精品乱码妇女bbbb| 色综合久久66| 久久精品国产一区二区| 国产欧美精品国产国产专区| 欧美性大战久久| 国产永久精品大片wwwapp| 亚洲视频免费在线| 欧美大片在线观看一区二区| 99视频有精品| 免费黄网站欧美| 国产精品久久久久久久久晋中| 欧美日韩1区2区| 粉嫩一区二区三区在线看| 亚洲成人一区二区| 亚洲国产精品99久久久久久久久 | 亚洲国产成人精品视频| 欧美精品一区二区三区高清aⅴ| 99久久国产综合精品女不卡| 美女一区二区视频| 亚洲免费观看高清| 久久精品免费在线观看| 欧美日韩国产三级| 99九九99九九九视频精品| 老司机一区二区| 亚洲福中文字幕伊人影院| 欧美激情在线一区二区| 日韩视频在线观看一区二区| 色一区在线观看| 国产精华液一区二区三区| 天堂成人免费av电影一区| 亚洲丝袜自拍清纯另类| 国产日韩高清在线| 日韩精品在线一区二区| 欧美日韩性生活|