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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? os_flag.c

?? protues仿真ARM ARM的I2C
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
                 *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) {

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产中文一区二区三区| 日韩欧美国产wwwww| 不卡视频一二三| 国产精品一区二区三区乱码 | 日本成人在线不卡视频| 午夜日韩在线电影| 亚洲超丰满肉感bbw| 亚洲成人激情综合网| 亚洲五码中文字幕| 日韩av一级片| 久久精品国产澳门| 国产精品一区二区91| 国产成人免费视频| 99久久久久免费精品国产| 91视视频在线直接观看在线看网页在线看 | 久久亚区不卡日本| 久久久www免费人成精品| 中文字幕av不卡| 亚洲精品国产无天堂网2021 | 国产精品一卡二卡| 国产成人免费视| 91浏览器入口在线观看| 欧美三级视频在线观看| 91麻豆精品国产91久久久久久久久 | 2023国产精华国产精品| 国产欧美一区二区精品秋霞影院| 欧美国产精品劲爆| 亚洲精品国产第一综合99久久| 亚洲一区二区三区视频在线 | 欧美在线不卡视频| 91精品久久久久久蜜臀| 久久麻豆一区二区| 日韩毛片精品高清免费| 亚洲成人免费在线| 国产一区二区三区电影在线观看 | 欧美大白屁股肥臀xxxxxx| 久久久欧美精品sm网站| 一区在线观看视频| 日韩中文字幕91| 粉嫩在线一区二区三区视频| 欧美中文字幕一区| 久久亚洲捆绑美女| 亚洲综合色视频| 国产一区二区三区在线观看免费| 97精品超碰一区二区三区| 欧美日高清视频| 国产三级精品三级| 婷婷中文字幕一区三区| 成人av在线网| 91精品国产综合久久久蜜臀图片| 国产欧美一区二区三区在线看蜜臀| 亚洲一区二区在线播放相泽 | 久久综合色综合88| 一区二区三区中文在线观看| 精久久久久久久久久久| 色婷婷狠狠综合| 国产视频一区二区在线观看| 亚洲国产欧美在线人成| 国产剧情一区在线| 6080午夜不卡| 亚洲欧洲美洲综合色网| 九九精品一区二区| 欧美日韩色综合| 国产精品美女久久福利网站| 免费在线欧美视频| 欧美影院一区二区| 中文字幕一区二区三区在线不卡 | 国内精品嫩模私拍在线| 欧美性一区二区| 国产欧美1区2区3区| 日韩**一区毛片| 一本久道中文字幕精品亚洲嫩| 久久久美女毛片| 首页综合国产亚洲丝袜| 色婷婷av一区二区三区大白胸 | 美女性感视频久久| 91成人在线免费观看| 国产精品青草综合久久久久99| 另类人妖一区二区av| 欧美欧美欧美欧美首页| 亚洲人成影院在线观看| 国产福利一区二区三区视频在线| 欧美一二三区在线观看| 亚洲成人中文在线| 色天天综合色天天久久| 国产日韩欧美精品一区| 久久99国产精品久久99果冻传媒| 欧美男男青年gay1069videost| 亚洲免费大片在线观看| 成人久久视频在线观看| 久久久国际精品| 国产在线一区二区综合免费视频| 51精品国自产在线| 亚洲国产精品尤物yw在线观看| 色婷婷精品久久二区二区蜜臂av| 国产精品色婷婷| 国产91综合一区在线观看| 久久精品男人天堂av| 国产精品一区二区无线| 国产亚洲欧美日韩在线一区| 精品一区二区国语对白| 精品久久一区二区| 久久国产人妖系列| 久久久久亚洲蜜桃| 国产一区二区主播在线| 2023国产精品| 国产盗摄女厕一区二区三区| 国产欧美日韩另类视频免费观看| 国产黄色成人av| 日本一区二区三区视频视频| 成人一道本在线| 中文字幕一区在线| 欧美影视一区二区三区| 婷婷激情综合网| 日韩欧美一卡二卡| 国产精品18久久久久久久网站| 国产丝袜在线精品| 91视频在线观看免费| 一区二区三区中文在线观看| 欧美日韩国产一二三| 免费精品视频在线| 国产三级精品视频| 91免费视频观看| 午夜欧美电影在线观看| 日韩欧美一级二级三级| 国产精品夜夜嗨| 日韩理论在线观看| 欧美日韩精品久久久| 久久99国产乱子伦精品免费| 国产午夜精品在线观看| 一本大道av一区二区在线播放 | 一本到不卡精品视频在线观看| 一个色在线综合| 欧美一区二区高清| 国产精品91一区二区| 亚洲精品国久久99热| 欧美一区二区在线播放| 国产福利精品导航| 亚洲男人的天堂在线观看| 5566中文字幕一区二区电影| 国产福利91精品| 亚洲自拍偷拍图区| 久久综合中文字幕| 在线亚洲一区观看| 久久er99精品| 一区二区三区在线视频播放| 日韩天堂在线观看| jizz一区二区| 天天操天天干天天综合网| 国产日韩亚洲欧美综合| 欧美日韩精品一区二区三区蜜桃| 国产精品亚洲专一区二区三区| 亚洲一区二区在线观看视频| 337p粉嫩大胆噜噜噜噜噜91av | 亚洲男同1069视频| 久久先锋影音av鲁色资源| 色妹子一区二区| 久久精品国产精品亚洲精品 | 成人精品在线视频观看| 日韩影院免费视频| 国产精品免费视频一区| 日韩三级视频在线观看| 91国偷自产一区二区开放时间| 激情五月婷婷综合| 香蕉乱码成人久久天堂爱免费| 国产网红主播福利一区二区| 欧美视频一区二区三区四区| 国产精品资源网站| 日本不卡的三区四区五区| 国产精品成人在线观看| 久久综合狠狠综合久久综合88 | 精品乱码亚洲一区二区不卡| 欧美性生活一区| aaa亚洲精品| 韩国精品免费视频| 日韩福利视频导航| 一区二区成人在线视频| 欧美极品美女视频| 久久综合成人精品亚洲另类欧美| 欧美性感一区二区三区| 91在线高清观看| 国产一区二区福利| 久久精品国产免费| 日本成人在线视频网站| 一区二区三区四区视频精品免费 | 国产一区二区三区香蕉| 日韩高清在线一区| 亚洲亚洲精品在线观看| 综合激情成人伊人| 国产精品第一页第二页第三页| 久久久久综合网| 久久先锋影音av鲁色资源网| 欧美成人官网二区| 欧美一区二区私人影院日本| 欧美日韩电影在线| 欧美日韩国产综合视频在线观看| 在线观看av不卡| 欧美亚洲高清一区二区三区不卡| 一本久久a久久免费精品不卡| 不卡在线观看av|