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

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

?? semphr.h

?? mc9s08gb在ucos移植源碼.太難找了
?? H
字號:
/*
	FreeRTOS V3.2.0 - Copyright (C) 2003 - 2005 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.
	***************************************************************************
*/

#include "queue.h"

#ifndef SEMAPHORE_H
#define SEMAPHORE_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.
 *
 * @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 portCHAR ) 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 of been created using 
 * vSemaphoreCreateBinary ().
 *
 * @param xSemaphore A handle to the semaphore being obtained.  This is the
 * handle returned by vSemaphoreCreateBinary ();
 *
 * @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.
 *
 * @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 )	xQueueReceive( ( xQueueHandle ) xSemaphore, NULL, xBlockTime )

/**
 * semphr. h
 * <pre>xSemaphoreGive( xSemaphoreHandle xSemaphore )</pre>
 *
 * <i>Macro</i> to release a semaphore.  The semaphore must of been created using 
 * vSemaphoreCreateBinary (), and obtained using sSemaphoreTake ().
 *
 * This must not be used from an ISR.  See xSemaphoreGiveFromISR () for
 * an alternative which can be used from an ISR.
 *
 * @param xSemaphore A handle to the semaphore being released.  This is the
 * handle returned by vSemaphoreCreateBinary ();
 *
 * @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 )				xQueueSend( ( xQueueHandle ) xSemaphore, NULL, semGIVE_BLOCK_TIME )

/**
 * semphr. h
 * <pre>xSemaphoreGiveFromISR( 
 *                             xSemaphoreHandle xSemaphore, 
 *                             portSHORT sTaskPreviouslyWoken 
 *                           )</pre>
 *
 * <i>Macro</i> to  release a semaphore.  The semaphore must of been created using 
 * vSemaphoreCreateBinary(), and obtained using xSemaphoreTake().
 *
 * This macro can be used from an ISR.
 *
 * @param xSemaphore A handle to the semaphore being released.  This is the
 * handle returned by vSemaphoreCreateBinary();
 *
 * @param sTaskPreviouslyWoken This is included so an ISR can make multiple calls
 * to xSemaphoreGiveFromISR() from a single interrupt.  The first call
 * should always pass in pdFALSE.  Subsequent calls should pass in
 * the value returned from the previous call.  See the file serial .c in the
 * PC port for a good example of using xSemaphoreGiveFromISR().
 *
 * @return pdTRUE if a task was woken by releasing the semaphore.  This is 
 * used by the ISR to determine if a context switch may be required following
 * the ISR.
 *
 * Example usage:
 <pre>
 #define LONG_TIME 0xffff
 #define TICKS_TO_WAIT	10
 xSemaphoreHandle xSemaphore = NULL;

 // Repetitive task.
 void vATask( void * pvParameters )
 {
    for( ;; )
    {
        // We want this task to run every 10 ticks or a timer.  The semaphore 
        // was created before this task was started

        // Block waiting for the semaphore to become available.
        if( xSemaphoreTake( xSemaphore, LONG_TIME ) == pdTRUE )
        {
            // It is time to execute.

            // ...

            // We have finished our task.  Return to the top of the loop where
            // we will block on the semaphore until it is time to execute 
            // again.
        }
    }
 }

 // Timer ISR
 void vTimerISR( void * pvParameters )
 {
 static unsigned portCHAR ucLocalTickCount = 0;

    // A timer tick has occurred.

    // ... Do other time functions.

    // Is it time for vATask () to run?
    ucLocalTickCount++;
    if( ucLocalTickCount >= TICKS_TO_WAIT )
    {
        // Unblock the task by releasing the semaphore.
        xSemaphoreGive( xSemaphore );

        // Reset the count so we release the semaphore again in 10 ticks time.
        ucLocalTickCount = 0;
    }
 }
 </pre>
 * \defgroup xSemaphoreGiveISR xSemaphoreGiveFromISR
 * \ingroup Semaphores
 */
#define xSemaphoreGiveFromISR( xSemaphore, xTaskPreviouslyWoken )			xQueueSendFromISR( ( xQueueHandle ) xSemaphore, NULL, xTaskPreviouslyWoken )


#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久99精品| 久久99精品国产.久久久久久 | 99热在这里有精品免费| 精品人在线二区三区| 午夜不卡av免费| voyeur盗摄精品| 国产亚洲视频系列| 国产在线观看免费一区| 日韩欧美国产不卡| 狠狠狠色丁香婷婷综合激情| 欧美日产国产精品| 午夜精品久久久久久久蜜桃app| 欧美色大人视频| 亚洲一区二区三区在线看| 色婷婷国产精品| 午夜精品成人在线视频| 91精品国产一区二区三区| 亚洲成av人片一区二区三区| 欧美日韩免费电影| 久久精品国产一区二区三 | 欧美日韩国产123区| 亚洲制服丝袜av| 欧美日韩亚洲综合在线 | 国产精品高潮呻吟| 在线观看成人免费视频| 国内成人自拍视频| 久久久久久久综合日本| 丁香另类激情小说| 亚洲国产精品麻豆| 日韩欧美在线一区二区三区| 九九**精品视频免费播放| 久久久精品2019中文字幕之3| 国产99久久久精品| 亚洲高清免费观看高清完整版在线观看| 欧美日韩精品欧美日韩精品一| 乱一区二区av| 亚洲五码中文字幕| 精品久久久久久综合日本欧美| 不卡的av网站| 精品一二三四区| 欧美精选午夜久久久乱码6080| 亚洲一区在线视频观看| 久久久国产午夜精品| 欧美精品777| 91一区二区在线| 福利一区二区在线| 国模娜娜一区二区三区| 天堂av在线一区| 亚洲国产一区二区在线播放| 久久精品视频一区二区三区| 欧美一级xxx| 在线成人av网站| 欧美日韩国产高清一区| 91浏览器在线视频| 色婷婷av久久久久久久| 91在线免费视频观看| 欧美日韩免费一区二区三区视频| 蜜臀av一区二区在线观看| 精品久久久网站| 欧美军同video69gay| 欧美三级在线看| 欧美少妇bbb| 欧美一区二区日韩| 2021国产精品久久精品| 久久久久国产精品麻豆| 欧美激情在线一区二区| 中文字幕一区在线| 亚洲一区二区三区爽爽爽爽爽| 亚洲午夜久久久久| 欧美96一区二区免费视频| 久久aⅴ国产欧美74aaa| caoporen国产精品视频| 欧美亚洲国产一区二区三区| 91影院在线观看| 欧美一二三在线| 国产精品区一区二区三区| 亚洲欧美国产77777| 成人免费观看视频| 一本久道久久综合中文字幕 | 亚洲国产日韩a在线播放性色| 日韩在线一区二区| 国产成人一级电影| 国产精品免费久久| 亚洲成av人片一区二区三区| 激情六月婷婷久久| 777奇米成人网| 中文字幕欧美区| 亚洲综合图片区| 波波电影院一区二区三区| 欧美高清激情brazzers| 亚洲综合久久久久| 国产高清视频一区| 精品国产乱码久久久久久闺蜜| 亚洲三级在线免费观看| 国产精品白丝jk黑袜喷水| 欧美午夜理伦三级在线观看| 26uuu久久综合| 日韩成人一区二区三区在线观看| 91色九色蝌蚪| 综合电影一区二区三区| 91在线观看高清| 国产精品久久久一本精品 | 97久久久精品综合88久久| 亚洲国产精品成人综合色在线婷婷| 另类小说综合欧美亚洲| 欧美电影精品一区二区| 国产一区二区三区免费| 久久久精品一品道一区| 成人性生交大片免费看中文网站| 国产偷国产偷精品高清尤物| 盗摄精品av一区二区三区| 中文字幕在线不卡一区二区三区| 成人91在线观看| 亚洲aaa精品| 欧美精品一区二区蜜臀亚洲| 国产成人在线看| 亚洲天堂福利av| 欧美三级电影精品| 久久精品国产精品亚洲精品| 国产亚洲欧美激情| 丁香五精品蜜臀久久久久99网站| 亚洲欧洲av一区二区三区久久| 欧美丝袜丝nylons| 老司机午夜精品| 国产欧美一区二区三区沐欲| 99国产精品久久久久久久久久久| 亚洲欧美一区二区三区国产精品 | 欧美中文字幕不卡| 国产在线国偷精品免费看| 亚洲黄色在线视频| 亚洲精品在线观看视频| 91福利国产成人精品照片| 麻豆国产一区二区| 一区二区三区蜜桃| 亚洲国产精品激情在线观看| 91精品国产综合久久久蜜臀粉嫩| 99精品黄色片免费大全| 国产麻豆视频一区二区| 天堂资源在线中文精品| 亚洲色欲色欲www| 欧美成人三级电影在线| 欧美日韩午夜在线| 欧美中文字幕久久| 99re66热这里只有精品3直播| 国模冰冰炮一区二区| 亚洲午夜久久久久| 久久99久久精品| 青青草97国产精品免费观看 | 国产精品丝袜久久久久久app| 欧美一级黄色录像| 日韩一区二区免费视频| 欧美少妇性性性| 欧美mv日韩mv亚洲| 制服丝袜亚洲精品中文字幕| 欧美视频一区二区三区四区 | 不卡视频免费播放| av一本久道久久综合久久鬼色| 高清不卡在线观看| 91精品91久久久中77777| av影院午夜一区| 色美美综合视频| 欧美精品 日韩| 国产欧美久久久精品影院| 国产精品久久久久久妇女6080 | 欧美婷婷六月丁香综合色| 制服丝袜亚洲网站| 久久影院视频免费| 最新欧美精品一区二区三区| 一区二区三区美女| 精品一区免费av| 99精品久久99久久久久| 日韩三级视频在线看| 国产精品国产a| 日韩成人dvd| 在线免费观看日韩欧美| 欧美一区二区三区四区高清| 国产精品久久午夜夜伦鲁鲁| 亚洲成人手机在线| 懂色av中文字幕一区二区三区| 欧美福利视频一区| 国产欧美精品一区二区三区四区| 亚洲色图欧洲色图婷婷| 日韩av午夜在线观看| 国产成人免费视频精品含羞草妖精| 99re视频精品| 亚洲精品一区二区三区蜜桃下载 | 欧美日韩国产精品自在自线| 国产精品久久久久久久午夜片| 免费美女久久99| 日韩一区国产二区欧美三区| 亚洲美女偷拍久久| 成人久久视频在线观看| 精品国偷自产国产一区| 麻豆成人在线观看| 日本国产一区二区| 亚洲一区二区视频| 欧美日韩国产小视频| 亚洲成av人综合在线观看| 欧美精品在线一区二区三区| 亚洲一区av在线|