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

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

?? semphr.h

?? IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR IAR
?? H
?? 第 1 頁 / 共 2 頁
字號:
/*
	FreeRTOS.org V5.1.1 - Copyright (C) 2003-2008 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.

    ***************************************************************************
    ***************************************************************************
    *                                                                         *
    * SAVE TIME AND MONEY!  We can port FreeRTOS.org to your own hardware,    *
    * and even write all or part of your application on your behalf.          *
    * See http://www.OpenRTOS.com for details of the services we provide to   *
    * expedite your project.                                                  *
    *                                                                         *
    ***************************************************************************
    ***************************************************************************

	Please ensure to read the configuration and relevant port sections of the
	online documentation.

	http://www.FreeRTOS.org - Documentation, latest information, license and 
	contact details.

	http://www.SafeRTOS.com - A version that is certified for use in safety 
	critical systems.

	http://www.OpenRTOS.com - Commercial support, development, porting, 
	licensing and training services.
*/

#ifndef INC_FREERTOS_H
	#error "#include FreeRTOS.h" must appear in source files before "#include semphr.h"
#endif

#ifndef SEMAPHORE_H
#define SEMAPHORE_H

#include "queue.h"

typedef xQueueHandle xSemaphoreHandle;

#define semBINARY_SEMAPHORE_QUEUE_LENGTH	( ( unsigned portCHAR ) 1 )
#define semSEMAPHORE_QUEUE_ITEM_LENGTH		( ( unsigned portCHAR ) 0 )
#define semGIVE_BLOCK_TIME					( ( portTickType ) 0 )


/**
 * semphr. h
 * <pre>vSemaphoreCreateBinary( xSemaphoreHandle xSemaphore )</pre>
 *
 * <i>Macro</i> that implements a semaphore by using the existing queue mechanism.
 * The queue length is 1 as this is a binary semaphore.  The data size is 0
 * as we don't want to actually store any data - we just want to know if the
 * queue is empty or full.
 *
 * This type of semaphore can be used for pure synchronisation between tasks or
 * between an interrupt and a task.  The semaphore need not be given back once
 * obtained, so one task/interrupt can continuously 'give' the semaphore while
 * another continuously 'takes' the semaphore.  For this reason this type of
 * semaphore does not use a priority inheritance mechanism.  For an alternative
 * that does use priority inheritance see xSemaphoreCreateMutex().
 *
 * @param xSemaphore Handle to the created semaphore.  Should be of type xSemaphoreHandle.
 *
 * Example usage:
 <pre>
 xSemaphoreHandle xSemaphore;

 void vATask( void * pvParameters )
 {
    // Semaphore cannot be used before a call to vSemaphoreCreateBinary ().
    // This is a macro so pass the variable in directly.
    vSemaphoreCreateBinary( xSemaphore );

    if( xSemaphore != NULL )
    {
        // The semaphore was created successfully.
        // The semaphore can now be used.  
    }
 }
 </pre>
 * \defgroup vSemaphoreCreateBinary vSemaphoreCreateBinary
 * \ingroup Semaphores
 */
#define vSemaphoreCreateBinary( xSemaphore )		{																								\
														xSemaphore = xQueueCreate( ( unsigned portBASE_TYPE ) 1, semSEMAPHORE_QUEUE_ITEM_LENGTH );	\
														if( xSemaphore != NULL )																	\
														{																							\
															xSemaphoreGive( xSemaphore );															\
														}																							\
													}

/**
 * semphr. h
 * xSemaphoreTake( 
 *                   xSemaphoreHandle xSemaphore, 
 *                   portTickType xBlockTime 
 *               )</pre>
 *
 * <i>Macro</i> to obtain a semaphore.  The semaphore must have previously been
 * created with a call to vSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
 * xSemaphoreCreateCounting().
 *
 * @param xSemaphore A handle to the semaphore being taken - obtained when
 * the semaphore was created.
 *
 * @param xBlockTime The time in ticks to wait for the semaphore to become
 * available.  The macro portTICK_RATE_MS can be used to convert this to a
 * real time.  A block time of zero can be used to poll the semaphore.  A block
 * time of portMAX_DELAY can be used to block indefinitely (provided
 * INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h).
 *
 * @return pdTRUE if the semaphore was obtained.  pdFALSE
 * if xBlockTime expired without the semaphore becoming available.
 *
 * Example usage:
 <pre>
 xSemaphoreHandle xSemaphore = NULL;

 // A task that creates a semaphore.
 void vATask( void * pvParameters )
 {
    // Create the semaphore to guard a shared resource.
    vSemaphoreCreateBinary( xSemaphore );
 }

 // A task that uses the semaphore.
 void vAnotherTask( void * pvParameters )
 {
    // ... Do other things.

    if( xSemaphore != NULL )
    {
        // See if we can obtain the semaphore.  If the semaphore is not available
        // wait 10 ticks to see if it becomes free.	
        if( xSemaphoreTake( xSemaphore, ( portTickType ) 10 ) == pdTRUE )
        {
            // We were able to obtain the semaphore and can now access the
            // shared resource.

            // ...

            // We have finished accessing the shared resource.  Release the 
            // semaphore.
            xSemaphoreGive( xSemaphore );
        }
        else
        {
            // We could not obtain the semaphore and can therefore not access
            // the shared resource safely.
        }
    }
 }
 </pre>
 * \defgroup xSemaphoreTake xSemaphoreTake
 * \ingroup Semaphores
 */
#define xSemaphoreTake( xSemaphore, xBlockTime )		xQueueGenericReceive( ( xQueueHandle ) xSemaphore, NULL, xBlockTime, pdFALSE )

/**
 * semphr. h
 * xSemaphoreTakeRecursive( 
 *                          xSemaphoreHandle xMutex, 
 *                          portTickType xBlockTime 
 *                        )
 *
 * <i>Macro</i> to recursively obtain, or 'take', a mutex type semaphore.  
 * The mutex must have previously been created using a call to 
 * xSemaphoreCreateRecursiveMutex();
 * 
 * configUSE_RECURSIVE_MUTEXES must be set to 1 in FreeRTOSConfig.h for this
 * macro to be available.
 * 
 * This macro must not be used on mutexes created using xSemaphoreCreateMutex().
 *
 * A mutex used recursively can be 'taken' repeatedly by the owner. The mutex 
 * doesn't become available again until the owner has called 
 * xSemaphoreGiveRecursive() for each successful 'take' request.  For example, 
 * if a task successfully 'takes' the same mutex 5 times then the mutex will 
 * not be available to any other task until it has also  'given' the mutex back
 * exactly five times.
 *
 * @param xMutex A handle to the mutex being obtained.  This is the
 * handle returned by xSemaphoreCreateRecursiveMutex();
 *
 * @param xBlockTime The time in ticks to wait for the semaphore to become
 * available.  The macro portTICK_RATE_MS can be used to convert this to a
 * real time.  A block time of zero can be used to poll the semaphore.  If
 * the task already owns the semaphore then xSemaphoreTakeRecursive() will
 * return immediately no matter what the value of xBlockTime. 
 *
 * @return pdTRUE if the semaphore was obtained.  pdFALSE if xBlockTime
 * expired without the semaphore becoming available.
 *
 * Example usage:
 <pre>
 xSemaphoreHandle xMutex = NULL;

 // A task that creates a mutex.
 void vATask( void * pvParameters )
 {
    // Create the mutex to guard a shared resource.
    xMutex = xSemaphoreCreateRecursiveMutex();
 }

 // A task that uses the mutex.
 void vAnotherTask( void * pvParameters )
 {
    // ... Do other things.

    if( xMutex != NULL )
    {
        // See if we can obtain the mutex.  If the mutex is not available
        // wait 10 ticks to see if it becomes free.	
        if( xSemaphoreTakeRecursive( xSemaphore, ( portTickType ) 10 ) == pdTRUE )
        {
            // We were able to obtain the mutex and can now access the
            // shared resource.

            // ...
            // For some reason due to the nature of the code further calls to 
			// xSemaphoreTakeRecursive() are made on the same mutex.  In real
			// code these would not be just sequential calls as this would make
			// no sense.  Instead the calls are likely to be buried inside
			// a more complex call structure.
            xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );
            xSemaphoreTakeRecursive( xMutex, ( portTickType ) 10 );

            // The mutex has now been 'taken' three times, so will not be 
			// available to another task until it has also been given back
			// three times.  Again it is unlikely that real code would have
			// these calls sequentially, but instead buried in a more complex
			// call structure.  This is just for illustrative purposes.
            xSemaphoreGiveRecursive( xMutex );
			xSemaphoreGiveRecursive( xMutex );
			xSemaphoreGiveRecursive( xMutex );

			// Now the mutex can be taken by other tasks.
        }
        else
        {
            // We could not obtain the mutex and can therefore not access
            // the shared resource safely.
        }
    }
 }
 </pre>
 * \defgroup xSemaphoreTakeRecursive xSemaphoreTakeRecursive
 * \ingroup Semaphores
 */
#define xSemaphoreTakeRecursive( xMutex, xBlockTime )	xQueueTakeMutexRecursive( xMutex, xBlockTime )


/* 
 * xSemaphoreAltTake() is an alternative version of xSemaphoreTake().
 *
 * The source code that implements the alternative (Alt) API is much 
 * simpler	because it executes everything from within a critical section.  
 * This is	the approach taken by many other RTOSes, but FreeRTOS.org has the 
 * preferred fully featured API too.  The fully featured API has more 
 * complex	code that takes longer to execute, but makes much less use of 
 * critical sections.  Therefore the alternative API sacrifices interrupt 
 * responsiveness to gain execution speed, whereas the fully featured API
 * sacrifices execution speed to ensure better interrupt responsiveness.
 */
#define xSemaphoreAltTake( xSemaphore, xBlockTime )		xQueueAltGenericReceive( ( xQueueHandle ) xSemaphore, NULL, xBlockTime, pdFALSE )

/**
 * semphr. h
 * <pre>xSemaphoreGive( xSemaphoreHandle xSemaphore )</pre>
 *
 * <i>Macro</i> to release a semaphore.  The semaphore must have previously been
 * created with a call to vSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
 * xSemaphoreCreateCounting(). and obtained using sSemaphoreTake().
 *
 * This macro must not be used from an ISR.  See xSemaphoreGiveFromISR () for
 * an alternative which can be used from an ISR.
 *
 * This macro must also not be used on semaphores created using 
 * xSemaphoreCreateRecursiveMutex().
 *
 * @param xSemaphore A handle to the semaphore being released.  This is the
 * handle returned when the semaphore was created.
 *
 * @return pdTRUE if the semaphore was released.  pdFALSE if an error occurred.
 * Semaphores are implemented using queues.  An error can occur if there is
 * no space on the queue to post a message - indicating that the 
 * semaphore was not first obtained correctly.
 *
 * Example usage:
 <pre>
 xSemaphoreHandle xSemaphore = NULL;

 void vATask( void * pvParameters )
 {
    // Create the semaphore to guard a shared resource.
    vSemaphoreCreateBinary( xSemaphore );

    if( xSemaphore != NULL )
    {
        if( xSemaphoreGive( xSemaphore ) != pdTRUE )
        {
            // We would expect this call to fail because we cannot give
            // a semaphore without first "taking" it!
        }

        // Obtain the semaphore - don't block if the semaphore is not
        // immediately available.
        if( xSemaphoreTake( xSemaphore, ( portTickType ) 0 ) )
        {
            // We now have the semaphore and can access the shared resource.

            // ...

            // We have finished accessing the shared resource so can free the
            // semaphore.
            if( xSemaphoreGive( xSemaphore ) != pdTRUE )
            {
                // We would not expect this call to fail because we must have
                // obtained the semaphore to get here.
            }
        }
    }
 }
 </pre>
 * \defgroup xSemaphoreGive xSemaphoreGive
 * \ingroup Semaphores
 */
#define xSemaphoreGive( xSemaphore )		xQueueGenericSend( ( xQueueHandle ) xSemaphore, NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )

/**
 * semphr. h
 * <pre>xSemaphoreGiveRecursive( xSemaphoreHandle xMutex )</pre>
 *
 * <i>Macro</i> to recursively release, or 'give', a mutex type semaphore.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
a在线欧美一区| 91久久精品网| 99国内精品久久| 欧美伊人久久久久久久久影院| 欧美日韩一区二区三区不卡| 91麻豆精品国产| 欧美国产激情二区三区| 亚洲精品高清在线| 免费成人在线观看| 91亚洲精华国产精华精华液| 制服.丝袜.亚洲.中文.综合| 洋洋成人永久网站入口| av一本久道久久综合久久鬼色| 26uuu色噜噜精品一区二区| 午夜精品福利一区二区蜜股av| 97久久精品人人做人人爽| 国产日韩av一区二区| 精品亚洲成a人在线观看| 欧美精品123区| 亚洲va韩国va欧美va精品| 欧美在线视频全部完| 一区二区久久久| 色综合久久中文综合久久牛| 最近日韩中文字幕| 成人av集中营| 亚洲女同女同女同女同女同69| 波多野结衣在线aⅴ中文字幕不卡| 久久久精品免费观看| 久久成人免费网站| 欧美大白屁股肥臀xxxxxx| 日韩av中文字幕一区二区三区 | 欧洲av一区二区嗯嗯嗯啊| 国产精品久久久久影院老司| 国产精品1区2区3区| 精品少妇一区二区| 国产福利精品导航| 国产日韩欧美麻豆| 成人午夜视频福利| 中文字幕一区av| 91浏览器打开| 亚洲午夜电影网| 91精品国产91久久久久久一区二区| 免费视频最近日韩| 久久综合九色欧美综合狠狠| 国产99久久久国产精品免费看| 中文欧美字幕免费| 91免费看`日韩一区二区| 一区二区三区在线观看视频 | 成人av中文字幕| 一区二区成人在线| 日韩一级在线观看| 国产成人免费在线观看不卡| 亚洲三级在线看| 91精品欧美综合在线观看最新 | 91网站最新地址| 亚洲第一综合色| 久久久91精品国产一区二区精品 | 7777精品伊人久久久大香线蕉的| 蜜臀a∨国产成人精品| 国产日韩av一区二区| 91激情在线视频| 久久99久久久欧美国产| 日韩毛片视频在线看| 91麻豆精品国产91久久久资源速度| 极品美女销魂一区二区三区 | 久久久亚洲精品一区二区三区| 国产ts人妖一区二区| 亚洲国产美女搞黄色| xvideos.蜜桃一区二区| av欧美精品.com| 免费在线观看日韩欧美| 国产精品传媒在线| 精品国产在天天线2019| 欧美主播一区二区三区| 国产成人精品免费看| 视频精品一区二区| 国产精品的网站| 欧美精品一区二区久久婷婷| 91麻豆蜜桃一区二区三区| 久国产精品韩国三级视频| 亚洲综合色婷婷| 国产欧美综合在线| 日韩免费一区二区| 在线看国产一区| 91亚洲精品乱码久久久久久蜜桃| 美女视频黄免费的久久| 一区二区三区中文在线观看| 久久女同性恋中文字幕| 4438x成人网最大色成网站| 99国产精品久久久久久久久久 | 成人av高清在线| 国产精品综合久久| 日本三级亚洲精品| 亚洲图片自拍偷拍| 亚洲欧美日韩系列| 国产精品国产自产拍高清av| 久久久www成人免费毛片麻豆 | 欧美精品高清视频| 色天天综合色天天久久| 成人深夜视频在线观看| 国产又黄又大久久| 人妖欧美一区二区| 免费看黄色91| 蜜桃视频第一区免费观看| 亚洲福利电影网| 亚洲已满18点击进入久久| 依依成人精品视频| 有坂深雪av一区二区精品| 亚洲蜜臀av乱码久久精品 | 91蜜桃婷婷狠狠久久综合9色| 国产精品白丝jk白祙喷水网站| 久久se这里有精品| 激情综合色播激情啊| 国模少妇一区二区三区| 国产黄色91视频| 高清av一区二区| 99re成人在线| 日本精品视频一区二区三区| 日本韩国精品一区二区在线观看| 色欧美乱欧美15图片| 色88888久久久久久影院野外| 欧美性生活影院| 91精品在线免费| 精品国产一区二区在线观看| 久久精品在线观看| 欧美韩日一区二区三区| 17c精品麻豆一区二区免费| 亚洲美女屁股眼交3| 午夜精品在线看| 老司机精品视频一区二区三区| 国产在线精品一区二区不卡了| 国产成人av电影在线观看| 不卡一二三区首页| 欧美日韩国产一级二级| 欧美www视频| 国产精品久久福利| 午夜精品123| 国产综合色产在线精品| av中文字幕一区| 欧美日本韩国一区| 久久九九久精品国产免费直播| 最新不卡av在线| 美国一区二区三区在线播放| 国产成人精品免费在线| 91成人网在线| 久久久蜜桃精品| 一区2区3区在线看| 国产一区二区中文字幕| 久久伊人蜜桃av一区二区| 国产精品另类一区| 日日夜夜精品视频天天综合网| 久久成人久久鬼色| 日本韩国欧美三级| 久久欧美中文字幕| 日日夜夜免费精品| 99久久婷婷国产| 精品国产乱码久久久久久图片| 亚洲青青青在线视频| 精品午夜一区二区三区在线观看| 91丝袜国产在线播放| 欧美变态tickle挠乳网站| 一区二区成人在线| 成人ar影院免费观看视频| 日韩视频在线一区二区| 亚洲精选视频在线| 国产精品一二三在| 欧美一区二区三区免费视频| 亚洲猫色日本管| 国产sm精品调教视频网站| 欧美精品久久99| 一二三四区精品视频| 不卡欧美aaaaa| 久久久亚洲精品一区二区三区| 日韩精彩视频在线观看| 99国产麻豆精品| 国产精品免费aⅴ片在线观看| 美女网站色91| 欧美精品一二三| 亚洲综合久久久| 色婷婷激情久久| 亚洲色图欧美激情| 99久久国产综合精品女不卡| 久久久精品免费观看| 韩国精品免费视频| 精品久久久久久久一区二区蜜臀| 五月天网站亚洲| 欧美在线观看一区| 亚洲伦在线观看| 99国产精品视频免费观看| 国产精品欧美极品| 成人精品小蝌蚪| 久久精品一区八戒影视| 精品亚洲国内自在自线福利| 欧美成人午夜电影| 极品尤物av久久免费看| 精品美女在线播放| 精品在线亚洲视频| 久久久久久99精品| 成人综合日日夜夜| 日韩一区在线播放|