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

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

?? death.c

?? Este é um rtos free para a familia arm7
?? C
字號:
/*
	FreeRTOS V4.0.0 - Copyright (C) 2003-2006 Richard Barry.

	This file is part of the FreeRTOS distribution.

	FreeRTOS 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 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; 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, 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 V2.0.0

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

#include <stdlib.h>

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

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

#define deathSTACK_SIZE		( ( unsigned portSHORT ) 512 )

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

/* The task function of the dynamically created tasks. */
static void vSuicidalTask( void *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 portSHORT sCreationCount = 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;
static const unsigned portBASE_TYPE uxMaxNumberOfExtraTasksRunning = 5;

/* 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 = uxTaskGetNumberOfTasks();
}
/*-----------------------------------------------------------*/

static void vSuicidalTask( void *pvParameters )
{
portDOUBLE d1, d2;
xTaskHandle xTaskToKill;
const portTickType xDelay = ( portTickType ) 500 / portTICK_RATE_MS;

	if( pvParameters != NULL )
	{
		/* This task is periodically created four times.  Tow 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. */
		d1 = 2.4;
		d2 = 89.2;
		d2 *= d1;
		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 void vCreateTasks( void *pvParameters )
{
const portTickType xDelay = ( portTickType ) 1000 / portTICK_RATE_MS;
unsigned portBASE_TYPE uxPriority;
const portCHAR * const pcTaskStartMsg = "Create task started.\r\n";

	/* Queue a message for printing to say the task has started. */
	vPrintDisplayMessage( &pcTaskStartMsg );

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

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

		xTaskCreate( vSuicidalTask, "SUICIDE1", deathSTACK_SIZE, NULL, uxPriority, &xCreatedTask1 );
		xTaskCreate( vSuicidalTask, "SUICIDE2", deathSTACK_SIZE, &xCreatedTask1, uxPriority, NULL );

		xTaskCreate( vSuicidalTask, "SUICIDE1", deathSTACK_SIZE, NULL, uxPriority, &xCreatedTask2 );
		xTaskCreate( vSuicidalTask, "SUICIDE2", deathSTACK_SIZE, &xCreatedTask2, uxPriority, NULL );

		++sCreationCount;
	}
}
/*-----------------------------------------------------------*/

/* 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 sLastCreationCount = 0;
portSHORT sReturn = pdTRUE;
unsigned portBASE_TYPE uxTasksRunningNow;

	if( sLastCreationCount == sCreationCount )
	{
		sReturn = pdFALSE;
	}
	
	uxTasksRunningNow = uxTaskGetNumberOfTasks();

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

	return sReturn;
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产另类一区| |精品福利一区二区三区| 国产精品拍天天在线| 亚洲国产精品视频| av电影在线观看不卡| 日韩三级高清在线| 亚洲一区二区三区美女| www.亚洲国产| 亚洲精品一区二区三区蜜桃下载| 亚洲第一成人在线| 国产成人亚洲精品狼色在线 | 成人国产精品免费观看动漫| 色哟哟一区二区三区| 久久久亚洲午夜电影| 免费一级片91| 91精品国产91久久综合桃花| 亚洲欧美成人一区二区三区| 国产麻豆精品久久一二三| 在线不卡一区二区| 亚洲a一区二区| 欧美在线观看视频一区二区| 亚洲欧洲制服丝袜| 99re成人精品视频| 国产精品久久久久三级| 高清国产一区二区| 国产欧美日韩亚州综合 | 久久精品久久综合| 91亚洲男人天堂| 欧美精品一区二区三区在线播放| 日韩三区在线观看| 午夜日韩在线电影| 欧美日韩精品久久久| 亚洲免费在线看| 一本高清dvd不卡在线观看| 亚洲丝袜自拍清纯另类| 国产酒店精品激情| 国产精品美女久久久久久久久久久| 中文字幕中文字幕在线一区| 国产成人三级在线观看| 久久久国产精华| 99久久精品国产一区二区三区| 色婷婷精品久久二区二区蜜臂av | 欧美日韩色一区| 亚洲国产综合91精品麻豆| 91丨九色丨蝌蚪丨老版| 综合欧美一区二区三区| av电影在线观看完整版一区二区| 91麻豆精品国产无毒不卡在线观看| 精品久久99ma| 国产黄色精品网站| 欧美国产乱子伦| 91黄色免费看| 丝袜国产日韩另类美女| 欧美另类高清zo欧美| 另类人妖一区二区av| 国产喂奶挤奶一区二区三区| 成人av网站在线观看免费| 一区二区三区**美女毛片| 91精品国产综合久久久蜜臀粉嫩 | 26uuu欧美日本| 国产成人免费在线| 亚洲午夜免费电影| 精品盗摄一区二区三区| 波多野洁衣一区| 亚洲成人先锋电影| 欧美韩日一区二区三区四区| 欧美在线免费播放| 精品一区二区三区在线观看| 日本一区二区三区免费乱视频| 午夜精品久久久久久不卡8050| 成人在线视频一区二区| 亚洲午夜在线电影| 久久综合色婷婷| 在线一区二区三区做爰视频网站| 国产日韩欧美不卡| 欧美日韩国产不卡| 国产成人av电影在线播放| 一区二区高清视频在线观看| 精品福利二区三区| 欧美精品自拍偷拍动漫精品| 国产一区二区网址| 日韩精品一区第一页| 亚洲丝袜另类动漫二区| 欧美成人三级电影在线| 日本道色综合久久| 风流少妇一区二区| 麻豆成人91精品二区三区| 国产精品国产三级国产三级人妇| 国产精品亚洲一区二区三区在线| 欧美成人国产一区二区| 99精品热视频| 国产一区二区三区观看| 亚洲一区二区av在线| 中文字幕不卡在线| 久久亚洲一级片| 日韩三级电影网址| 7777精品久久久大香线蕉| 色综合一个色综合亚洲| 不卡av免费在线观看| 国产美女精品人人做人人爽| 日韩成人伦理电影在线观看| 亚洲最快最全在线视频| 中文字幕一区二区三区四区不卡| 99久久精品免费看国产| 国产成人综合亚洲91猫咪| 久久精品国产久精国产爱| 日韩国产在线观看一区| 亚洲国产成人91porn| 亚洲无线码一区二区三区| 亚洲欧洲国产日本综合| 中文字幕不卡在线播放| 国产欧美一区二区精品仙草咪| 丰满亚洲少妇av| 国产永久精品大片wwwapp| 麻豆91在线播放| 麻豆国产欧美日韩综合精品二区 | 欧美一区二区在线看| 欧美日韩午夜影院| 91麻豆精品国产综合久久久久久| 日韩精品久久久久久| 午夜日韩在线电影| 美女mm1313爽爽久久久蜜臀| 午夜久久久久久久久久一区二区| 精品va天堂亚洲国产| 久久婷婷国产综合国色天香 | 椎名由奈av一区二区三区| 国产精品国产三级国产普通话蜜臀| 成人精品亚洲人成在线| 不卡电影免费在线播放一区| 暴力调教一区二区三区| 91在线看国产| 欧美日韩久久一区二区| 日韩丝袜情趣美女图片| 国产午夜精品久久| 亚洲精品欧美专区| 石原莉奈一区二区三区在线观看 | 亚洲精品在线观看网站| 日本一区二区视频在线观看| 中文字幕一区二区三区不卡| 亚洲女人****多毛耸耸8| 一区二区三区在线观看视频| 亚洲chinese男男1069| 久久国产尿小便嘘嘘尿| 成人激情综合网站| 欧美亚洲综合久久| 精品久久久久一区| 亚洲欧美偷拍卡通变态| 免费在线观看日韩欧美| 成人午夜电影久久影院| 欧美日韩激情一区二区| 久久久国产综合精品女国产盗摄| 欧美一级高清片在线观看| 久久免费精品国产久精品久久久久| 欧美综合一区二区三区| 日韩视频中午一区| 国产精品免费视频一区| 日韩经典一区二区| 成人国产精品免费观看视频| 欧美日韩一区二区三区在线看 | 国产精品88888| 欧美性大战久久| 久久综合色一综合色88| 亚洲午夜久久久久久久久电影网| 国产精品激情偷乱一区二区∴| 久久久久综合网| 亚洲一区二区三区四区的| 国产成人综合网| 日韩一级片网址| 亚洲一二三四区| voyeur盗摄精品| www欧美成人18+| 日韩精品91亚洲二区在线观看| 亚洲二区在线观看| 丁香六月综合激情| 久久伊99综合婷婷久久伊| 日韩高清在线电影| 欧美伊人久久久久久午夜久久久久| 国产农村妇女毛片精品久久麻豆| 欧美女孩性生活视频| 一本一本久久a久久精品综合麻豆| 成人h精品动漫一区二区三区| 国产成人av福利| 91麻豆精品国产91久久久资源速度 | 日本道免费精品一区二区三区| 日韩二区三区四区| 在线亚洲高清视频| 亚洲欧美日韩小说| av不卡在线观看| 国产精品国产馆在线真实露脸 | 美女mm1313爽爽久久久蜜臀| 欧美三级视频在线观看| 中文字幕在线观看一区二区| 国内久久精品视频| 26uuu亚洲综合色| 国产一区二区精品在线观看| www成人在线观看| 国产成人精品1024| 中文字幕精品三区| 色婷婷久久99综合精品jk白丝 | 中文字幕在线不卡一区|