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

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

?? os_flag.c

?? ARM7Proteus.rar
?? C
?? 第 1 頁 / 共 3 頁
字號:
                 *err                 = OS_ERR_TASK_WAITING;
                 return (pgrp);
             }

        case OS_DEL_ALWAYS:                                /* Always delete the event flag group       */
             pnode = (OS_FLAG_NODE *)pgrp->OSFlagWaitList;
             while (pnode != (OS_FLAG_NODE *)0) {          /* Ready ALL tasks waiting for flags        */
                 OS_FlagTaskRdy(pnode, (OS_FLAGS)0);
                 pnode = (OS_FLAG_NODE *)pnode->OSFlagNodeNext;
             }
             pgrp->OSFlagType     = OS_EVENT_TYPE_UNUSED;
             pgrp->OSFlagWaitList = (void *)OSFlagFreeList;/* Return group to free list                */
             OSFlagFreeList       = pgrp;
             OS_EXIT_CRITICAL();
             if (tasks_waiting == TRUE) {                  /* Reschedule only if task(s) were waiting  */
                 OS_Sched();                               /* Find highest priority task ready to run  */
             }
             *err = OS_NO_ERR;
             return ((OS_FLAG_GRP *)0);                    /* Event Flag Group has been deleted        */

        default:
             OS_EXIT_CRITICAL();
             *err = OS_ERR_INVALID_OPT;
             return (pgrp);
    }
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                        WAIT ON AN EVENT FLAG GROUP
*
* Description: This function is called to wait for a combination of bits to be set in an event flag
*              group.  Your application can wait for ANY bit to be set or ALL bits to be set.
*
* Arguments  : pgrp          is a pointer to the desired event flag group.
*
*              flags         Is a bit pattern indicating which bit(s) (i.e. flags) you wish to wait for.
*                            The bits you want are specified by setting the corresponding bits in
*                            'flags'.  e.g. if your application wants to wait for bits 0 and 1 then
*                            'flags' would contain 0x03.
*
*              wait_type     specifies whether you want ALL bits to be set or ANY of the bits to be set.
*                            You can specify the following argument:
*
*                            OS_FLAG_WAIT_CLR_ALL   You will wait for ALL bits in 'mask' to be clear (0)
*                            OS_FLAG_WAIT_SET_ALL   You will wait for ALL bits in 'mask' to be set   (1)
*                            OS_FLAG_WAIT_CLR_ANY   You will wait for ANY bit  in 'mask' to be clear (0)
*                            OS_FLAG_WAIT_SET_ANY   You will wait for ANY bit  in 'mask' to be set   (1)
*
*                            NOTE: Add OS_FLAG_CONSUME if you want the event flag to be 'consumed' by
*                                  the call.  Example, to wait for any flag in a group AND then clear
*                                  the flags that are present, set 'wait_type' to:
*
*                                  OS_FLAG_WAIT_SET_ANY + OS_FLAG_CONSUME
*
*              timeout       is an optional timeout (in clock ticks) that your task will wait for the
*                            desired bit combination.  If you specify 0, however, your task will wait
*                            forever at the specified event flag group or, until a message arrives.
*
*              err           is a pointer to an error code and can be:
*                            OS_NO_ERR              The desired bits have been set within the specified
*                                                   'timeout'.
*                            OS_ERR_PEND_ISR        If you tried to PEND from an ISR
*                            OS_FLAG_INVALID_PGRP   If 'pgrp' is a NULL pointer.
*                            OS_ERR_EVENT_TYPE      You are not pointing to an event flag group
*                            OS_TIMEOUT             The bit(s) have not been set in the specified
*                                                   'timeout'.
*                            OS_FLAG_ERR_WAIT_TYPE  You didn't specify a proper 'wait_type' argument.
*
* Returns    : The new state of the flags in the event flag group when the task is resumed or,
*              0 if a timeout or an error occurred.
*
* Called from: Task ONLY
*********************************************************************************************************
*/

OS_FLAGS  OSFlagPend (OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U wait_type, INT16U timeout, INT8U *err)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR     cpu_sr;
#endif
    OS_FLAG_NODE  node;
    OS_FLAGS      flags_cur;
    OS_FLAGS      flags_rdy;
    BOOLEAN       consume;


    if (OSIntNesting > 0) {                                /* See if called from ISR ...               */
        *err = OS_ERR_PEND_ISR;                            /* ... can't PEND from an ISR               */
        return ((OS_FLAGS)0);
    }
#if OS_ARG_CHK_EN > 0
    if (pgrp == (OS_FLAG_GRP *)0) {                        /* Validate 'pgrp'                          */
        *err = OS_FLAG_INVALID_PGRP;
        return ((OS_FLAGS)0);
    }
    if (pgrp->OSFlagType != OS_EVENT_TYPE_FLAG) {          /* Validate event block type                */
        *err = OS_ERR_EVENT_TYPE;
        return ((OS_FLAGS)0);
    }
#endif
    if (wait_type & OS_FLAG_CONSUME) {                     /* See if we need to consume the flags      */
        wait_type &= ~OS_FLAG_CONSUME;
        consume    = TRUE;
    } else {
        consume    = FALSE;
    }
/*$PAGE*/
    OS_ENTER_CRITICAL();
    switch (wait_type) {
        case OS_FLAG_WAIT_SET_ALL:                         /* See if all required flags are set        */
             flags_rdy = pgrp->OSFlagFlags & flags;        /* Extract only the bits we want            */
             if (flags_rdy == flags) {                     /* Must match ALL the bits that we want     */
                 if (consume == TRUE) {                    /* See if we need to consume the flags      */
                     pgrp->OSFlagFlags &= ~flags_rdy;      /* Clear ONLY the flags that we wanted      */
                 }
                 flags_cur = pgrp->OSFlagFlags;            /* Will return the state of the group       */
                 OS_EXIT_CRITICAL();                       /* Yes, condition met, return to caller     */
                 *err      = OS_NO_ERR;
                 return (flags_cur);
             } else {                                      /* Block task until events occur or timeout */
                 OS_FlagBlock(pgrp, &node, flags, wait_type, timeout);
                 OS_EXIT_CRITICAL();
             }
             break;

        case OS_FLAG_WAIT_SET_ANY:
             flags_rdy = pgrp->OSFlagFlags & flags;        /* Extract only the bits we want            */
             if (flags_rdy != (OS_FLAGS)0) {               /* See if any flag set                      */
                 if (consume == TRUE) {                    /* See if we need to consume the flags      */
                     pgrp->OSFlagFlags &= ~flags_rdy;      /* Clear ONLY the flags that we got         */
                 }
                 flags_cur = pgrp->OSFlagFlags;            /* Will return the state of the group       */
                 OS_EXIT_CRITICAL();                       /* Yes, condition met, return to caller     */
                 *err      = OS_NO_ERR;
                 return (flags_cur);
             } else {                                      /* Block task until events occur or timeout */
                 OS_FlagBlock(pgrp, &node, flags, wait_type, timeout);
                 OS_EXIT_CRITICAL();
             }
             break;

#if OS_FLAG_WAIT_CLR_EN > 0
        case OS_FLAG_WAIT_CLR_ALL:                         /* See if all required flags are cleared    */
             flags_rdy = ~pgrp->OSFlagFlags & flags;       /* Extract only the bits we want            */
             if (flags_rdy == flags) {                     /* Must match ALL the bits that we want     */
                 if (consume == TRUE) {                    /* See if we need to consume the flags      */
                     pgrp->OSFlagFlags |= flags_rdy;       /* Set ONLY the flags that we wanted        */
                 }
                 flags_cur = pgrp->OSFlagFlags;            /* Will return the state of the group       */
                 OS_EXIT_CRITICAL();                       /* Yes, condition met, return to caller     */
                 *err      = OS_NO_ERR;
                 return (flags_cur);
             } else {                                      /* Block task until events occur or timeout */
                 OS_FlagBlock(pgrp, &node, flags, wait_type, timeout);
                 OS_EXIT_CRITICAL();
             }
             break;

        case OS_FLAG_WAIT_CLR_ANY:
             flags_rdy = ~pgrp->OSFlagFlags & flags;       /* Extract only the bits we want            */
             if (flags_rdy != (OS_FLAGS)0) {               /* See if any flag cleared                  */
                 if (consume == TRUE) {                    /* See if we need to consume the flags      */
                     pgrp->OSFlagFlags |= flags_rdy;       /* Set ONLY the flags that we got           */
                 }
                 flags_cur = pgrp->OSFlagFlags;            /* Will return the state of the group       */
                 OS_EXIT_CRITICAL();                       /* Yes, condition met, return to caller     */
                 *err      = OS_NO_ERR;
                 return (flags_cur);
             } else {                                      /* Block task until events occur or timeout */
                 OS_FlagBlock(pgrp, &node, flags, wait_type, timeout);
                 OS_EXIT_CRITICAL();
             }
             break;
#endif

        default:
             OS_EXIT_CRITICAL();
             flags_cur = (OS_FLAGS)0;
             *err      = OS_FLAG_ERR_WAIT_TYPE;
             return (flags_cur);
    }
    OS_Sched();                                            /* Find next HPT ready to run               */
    OS_ENTER_CRITICAL();
    if (OSTCBCur->OSTCBStat & OS_STAT_FLAG) {              /* Have we timed-out?                       */
        OS_FlagUnlink(&node);
        OSTCBCur->OSTCBStat = OS_STAT_RDY;                 /* Yes, make task ready-to-run              */
        OS_EXIT_CRITICAL();
        flags_cur           = (OS_FLAGS)0;
        *err                = OS_TIMEOUT;                  /* Indicate that we timed-out waiting       */
    } else {
        if (consume == TRUE) {                             /* See if we need to consume the flags      */
            switch (wait_type) {
                case OS_FLAG_WAIT_SET_ALL:
                case OS_FLAG_WAIT_SET_ANY:                 /* Clear ONLY the flags we got              */
                     pgrp->OSFlagFlags &= ~OSTCBCur->OSTCBFlagsRdy;
                     break;

#if OS_FLAG_WAIT_CLR_EN > 0
                case OS_FLAG_WAIT_CLR_ALL:
                case OS_FLAG_WAIT_CLR_ANY:                 /* Set   ONLY the flags we got              */
                     pgrp->OSFlagFlags |= OSTCBCur->OSTCBFlagsRdy;
                     break;
#endif
            }
        }
        flags_cur = pgrp->OSFlagFlags;
        OS_EXIT_CRITICAL();
        *err      = OS_NO_ERR;                             /* Event(s) must have occurred              */
    }
    return (flags_cur);
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                         POST EVENT FLAG BIT(S)
*
* Description: This function is called to set or clear some bits in an event flag group.  The bits to
*              set or clear are specified by a 'bit mask'.
*
* Arguments  : pgrp          is a pointer to the desired event flag group.
*
*              flags         If 'opt' (see below) is OS_FLAG_SET, each bit that is set in 'flags' will
*                            set the corresponding bit in the event flag group.  e.g. to set bits 0, 4
*                            and 5 you would set 'flags' to:
*
*                                0x31     (note, bit 0 is least significant bit)
*
*                            If 'opt' (see below) is OS_FLAG_CLR, each bit that is set in 'flags' will
*                            CLEAR the corresponding bit in the event flag group.  e.g. to clear bits 0,
*                            4 and 5 you would specify 'flags' as:
*
*                                0x31     (note, bit 0 is least significant bit)
*
*              opt           indicates whether the flags will be:
*                                set     (OS_FLAG_SET) or
*                                cleared (OS_FLAG_CLR)
*
*              err           is a pointer to an error code and can be:
*                            OS_NO_ERR              The call was successfull
*                            OS_FLAG_INVALID_PGRP   You passed a NULL pointer
*                            OS_ERR_EVENT_TYPE      You are not pointing to an event flag group
*                            OS_FLAG_INVALID_OPT    You specified an invalid option
*
* Returns    : the new value of the event flags bits that are still set.
*
* Called From: Task or ISR
*
* WARNING(s) : 1) The execution time of this function depends on the number of tasks waiting on the event
*                 flag group.
*              2) The amount of time interrupts are DISABLED depends on the number of tasks waiting on
*                 the event flag group.
*********************************************************************************************************
*/
OS_FLAGS  OSFlagPost (OS_FLAG_GRP *pgrp, OS_FLAGS flags, INT8U opt, INT8U *err)
{
#if OS_CRITICAL_METHOD == 3                          /* Allocate storage for CPU status register       */
    OS_CPU_SR     cpu_sr;
#endif
    OS_FLAG_NODE *pnode;
    BOOLEAN       sched;
    OS_FLAGS      flags_cur;
    OS_FLAGS      flags_rdy;


#if OS_ARG_CHK_EN > 0
    if (pgrp == (OS_FLAG_GRP *)0) {                  /* Validate 'pgrp'                                */
        *err = OS_FLAG_INVALID_PGRP;
        return ((OS_FLAGS)0);
    }
    if (pgrp->OSFlagType != OS_EVENT_TYPE_FLAG) {    /* Make sure we are pointing to an event flag grp */
        *err = OS_ERR_EVENT_TYPE;
        return ((OS_FLAGS)0);
    }
#endif
/*$PAGE*/
    OS_ENTER_CRITICAL();
    switch (opt) {
        case OS_FLAG_CLR:
             pgrp->OSFlagFlags &= ~flags;            /* Clear the flags specified in the group         */
             break;

        case OS_FLAG_SET:
             pgrp->OSFlagFlags |=  flags;            /* Set   the flags specified in the group         */
             break;

        default:
             OS_EXIT_CRITICAL();                     /* INVALID option                                 */
             *err = OS_FLAG_INVALID_OPT;
             return ((OS_FLAGS)0);
    }
    sched = FALSE;                                   /* Indicate that we don't need rescheduling       */
    pnode = (OS_FLAG_NODE *)pgrp->OSFlagWaitList;
    while (pnode != (OS_FLAG_NODE *)0) {             /* Go through all tasks waiting on event flag(s)  */
        switch (pnode->OSFlagNodeWaitType) {
            case OS_FLAG_WAIT_SET_ALL:               /* See if all req. flags are set for current node */
                 flags_rdy = pgrp->OSFlagFlags & pnode->OSFlagNodeFlags;
                 if (flags_rdy == pnode->OSFlagNodeFlags) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品午夜在线观看| 欧美一区二区福利在线| 亚洲欧洲av色图| 91视频在线观看| 亚洲综合视频网| 欧美一区二区三区色| 麻豆成人91精品二区三区| 精品久久久久久久久久久久久久久久久 | 一区二区三区四区亚洲| 色哟哟欧美精品| 丝袜美腿成人在线| 欧美videos中文字幕| 国产aⅴ综合色| 一区二区三区在线不卡| 在线综合视频播放| 国产剧情一区二区| 亚洲激情第一区| 日韩欧美在线不卡| www.亚洲免费av| 首页欧美精品中文字幕| 欧美一级二级三级乱码| 国产成人午夜精品影院观看视频| 国产亚洲精品超碰| 欧美色倩网站大全免费| 黄页视频在线91| 一区二区三区美女| 久久综合给合久久狠狠狠97色69| jlzzjlzz亚洲女人18| 午夜精品国产更新| 国产欧美一区在线| 777午夜精品免费视频| 国产精品一级片在线观看| 一二三区精品视频| 欧美一区二区三区在线观看视频| 国产成人免费视频网站| 亚洲一区二区三区免费视频| 精品国产乱码久久| 99麻豆久久久国产精品免费优播| 亚洲成人免费观看| 国产夜色精品一区二区av| 欧美午夜片在线观看| 国产成人精品1024| 日本美女视频一区二区| 亚洲欧美自拍偷拍色图| 欧美xxxxxxxxx| 欧美日韩一区二区电影| 99国产精品一区| 国产成人亚洲综合a∨猫咪| 午夜亚洲福利老司机| 国产精品久久久久精k8| 久久久久久久综合日本| 717成人午夜免费福利电影| eeuss鲁片一区二区三区在线观看| 免费成人在线网站| 亚洲国产cao| 亚洲人成7777| 国产精品高潮呻吟久久| 久久影院视频免费| 欧美一区2区视频在线观看| 欧美在线观看18| 99国产欧美另类久久久精品 | 高清国产一区二区| 久久精品国产99国产精品| 亚洲18色成人| 一区二区三区成人| 一区二区三区免费| 亚洲品质自拍视频| 亚洲乱码国产乱码精品精可以看 | 亚洲成人av福利| 一区二区三区不卡在线观看 | 91小视频免费观看| 国产成人精品影视| 从欧美一区二区三区| 国产精品一区二区三区99| 久久99国产精品久久99| 另类欧美日韩国产在线| 狠狠久久亚洲欧美| 国内成+人亚洲+欧美+综合在线 | 懂色av一区二区三区免费看| 国产suv一区二区三区88区| 国精产品一区一区三区mba视频| 美女脱光内衣内裤视频久久网站 | 日韩中文字幕麻豆| 日韩av一级片| 久久电影国产免费久久电影 | 亚洲欧美日韩久久| 亚洲日本va在线观看| 亚洲欧洲国产日韩| 亚洲综合清纯丝袜自拍| 日韩精品国产精品| 蜜桃av噜噜一区| 久久精品免费看| 精品亚洲porn| 国产.欧美.日韩| 在线视频亚洲一区| 欧美一区二区视频观看视频| 久久亚洲欧美国产精品乐播| 中文字幕成人av| 亚洲综合免费观看高清完整版在线| 亚洲一区二区三区国产| 久久精品噜噜噜成人88aⅴ| 国产成人av电影在线观看| 99精品黄色片免费大全| 欧美日韩你懂得| 欧美精品一区二区三| 国产精品卡一卡二卡三| 亚洲香肠在线观看| 另类小说色综合网站| 波多野结衣91| 欧美精品粉嫩高潮一区二区| 久久亚洲一级片| 亚洲乱码中文字幕| 精品亚洲欧美一区| 91污在线观看| 欧美一级欧美一级在线播放| 中文字幕二三区不卡| 日欧美一区二区| 成人夜色视频网站在线观看| 91国产免费看| 国产欧美一区二区精品性色| 亚洲一区二区在线播放相泽| 国内精品第一页| 欧美色手机在线观看| 欧美经典一区二区| 日韩制服丝袜av| 9久草视频在线视频精品| 91精品国产91综合久久蜜臀| 国产精品久久久久久久久免费桃花 | 亚洲激情六月丁香| 国产成人欧美日韩在线电影| 欧美午夜免费电影| 国产精品色一区二区三区| 丝袜美腿亚洲综合| 91片黄在线观看| 久久综合九色综合久久久精品综合| 亚洲自拍偷拍九九九| 成人网男人的天堂| 精品剧情在线观看| 蜜桃av噜噜一区二区三区小说| 色综合色狠狠综合色| 国产欧美一区二区精品婷婷| 美美哒免费高清在线观看视频一区二区| 成人国产免费视频| 久久精品一区二区三区四区| 久久超碰97中文字幕| 91福利社在线观看| 亚洲丝袜制服诱惑| 粉嫩欧美一区二区三区高清影视| 欧美日韩电影一区| 一二三四区精品视频| 99精品欧美一区二区三区综合在线| 欧美精品一区二区三区视频| 石原莉奈在线亚洲三区| 欧美日韩国产不卡| 亚洲成人一区二区在线观看| 欧美午夜影院一区| 一区二区三区免费看视频| 色综合久久精品| 亚洲欧美日韩国产手机在线| 菠萝蜜视频在线观看一区| 久久精品人人爽人人爽| 国精产品一区一区三区mba视频| 精品国产乱码久久久久久免费 | 欧美精品一区二区三区蜜桃 | 99久久er热在这里只有精品15| 中文字幕不卡在线播放| 国产成人精品免费网站| 亚洲国产精品二十页| 成人免费毛片嘿嘿连载视频| 国产精品久久久久久久久免费相片 | 欧美日韩国产一级片| 亚洲一级二级三级在线免费观看| 欧美最猛性xxxxx直播| 天天综合色天天综合| 91精品国产高清一区二区三区| 日本大胆欧美人术艺术动态| 日韩美女主播在线视频一区二区三区 | 精品国产一区二区三区av性色 | 免费观看久久久4p| 精品国精品国产| 成人一区在线观看| 一区二区三区四区激情| 欧美系列日韩一区| 久久精品国产精品亚洲综合| 日本一区二区综合亚洲| av午夜精品一区二区三区| 亚洲伊人伊色伊影伊综合网| 欧美一级一区二区| 精品一区二区三区免费播放| 国产欧美日韩中文久久| 91蝌蚪porny九色| 五月婷婷综合激情| 精品福利一区二区三区免费视频| 国产一区二区三区久久久| 国产精品丝袜91| 欧美影院精品一区| 经典三级视频一区| 亚洲欧美一区二区在线观看| 欧美日韩亚洲高清一区二区| 久久成人免费日本黄色|