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

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

?? os_core.c

?? uCos-ii 2.86 在C8051F410單片機上移植成功!!! 其中包括:UART驅動
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             CORE FUNCTIONS
*
*                              (c) Copyright 1992-2007, Micrium, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_CORE.C
* By      : Jean J. Labrosse
* Version : V2.86
*
* LICENSING TERMS:
* ---------------
*   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.  
* If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license 
* its use in your product. We provide ALL the source code for your convenience and to help you experience 
* uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a 
* licensing fee.
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#define  OS_GLOBALS
#include "..\header files\includes.h"
#endif

/*
*********************************************************************************************************
*                                       PRIORITY RESOLUTION TABLE
*
* Note: Index into table is bit pattern to resolve highest priority
*       Indexed value corresponds to highest priority bit position (i.e. 0..7)
*********************************************************************************************************
*/

INT8U  const  OSUnMapTbl[256] = {
    0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x00 to 0x0F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x10 to 0x1F                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x20 to 0x2F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x30 to 0x3F                             */
    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x40 to 0x4F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x50 to 0x5F                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x60 to 0x6F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x70 to 0x7F                             */
    7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x80 to 0x8F                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0x90 to 0x9F                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xA0 to 0xAF                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xB0 to 0xBF                             */
    6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xC0 to 0xCF                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xD0 to 0xDF                             */
    5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,       /* 0xE0 to 0xEF                             */
    4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0        /* 0xF0 to 0xFF                             */
};

/*$PAGE*/
/*
*********************************************************************************************************
*                                       FUNCTION PROTOTYPES
*********************************************************************************************************
*/

static  void  OS_InitEventList(void);

static  void  OS_InitMisc(void);

static  void  OS_InitRdyList(void);

static  void  OS_InitTaskIdle(void);

#if OS_TASK_STAT_EN > 0
static  void  OS_InitTaskStat(void);
#endif

static  void  OS_InitTCBList(void);

static  void  OS_SchedNew(void) reentrant;

/*$PAGE*/
/*
*********************************************************************************************************
*                         GET THE NAME OF A SEMAPHORE, MUTEX, MAILBOX or QUEUE
*
* Description: This function is used to obtain the name assigned to a semaphore, mutex, mailbox or queue.
*
* Arguments  : pevent    is a pointer to the event group.  'pevent' can point either to a semaphore,
*                        a mutex, a mailbox or a queue.  Where this function is concerned, the actual
*                        type is irrelevant.
*
*              pname     is a pointer to an ASCII string that will receive the name of the semaphore,
*                        mutex, mailbox or queue.  The string must be able to hold at least
*                        OS_EVENT_NAME_SIZE characters.
*
*              perr      is a pointer to an error code that can contain one of the following values:
*
*                        OS_ERR_NONE                if the name was copied to 'pname'
*                        OS_ERR_EVENT_TYPE          if 'pevent' is not pointing to the proper event
*                                                   control block type.
*                        OS_ERR_PNAME_NULL          You passed a NULL pointer for 'pname'
*                        OS_ERR_PEVENT_NULL         if you passed a NULL pointer for 'pevent'
*                        OS_ERR_NAME_GET_ISR        if you are trying to call this function from an ISR
*
* Returns    : The length of the string or 0 if the 'pevent' is a NULL pointer.
*********************************************************************************************************
*/

#if (OS_EVENT_EN) && (OS_EVENT_NAME_SIZE > 1)
INT8U  OSEventNameGet (OS_EVENT *pevent, INT8U *pname, INT8U *perr)
{
    INT8U      len;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (perr == (INT8U *)0) {                    /* Validate 'perr'                                    */
        return (0);
    }
    if (pevent == (OS_EVENT *)0) {               /* Is 'pevent' a NULL pointer?                        */
        *perr = OS_ERR_PEVENT_NULL;
        return (0);
    }
    if (pname == (INT8U *)0) {                   /* Is 'pname' a NULL pointer?                         */
        *perr = OS_ERR_PNAME_NULL;
        return (0);
    }
#endif
    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        *perr  = OS_ERR_NAME_GET_ISR;
        return (0);
    }
    switch (pevent->OSEventType) {
        case OS_EVENT_TYPE_SEM:
        case OS_EVENT_TYPE_MUTEX:
        case OS_EVENT_TYPE_MBOX:
        case OS_EVENT_TYPE_Q:
             break;

        default:
             *perr = OS_ERR_EVENT_TYPE;
             return (0);
    }
    OS_ENTER_CRITICAL();
    len   = OS_StrCopy(pname, pevent->OSEventName);   /* Copy name from OS_EVENT                       */
    OS_EXIT_CRITICAL();
    *perr = OS_ERR_NONE;
    return (len);
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                         ASSIGN A NAME TO A SEMAPHORE, MUTEX, MAILBOX or QUEUE
*
* Description: This function assigns a name to a semaphore, mutex, mailbox or queue.
*
* Arguments  : pevent    is a pointer to the event group.  'pevent' can point either to a semaphore,
*                        a mutex, a mailbox or a queue.  Where this function is concerned, it doesn't
*                        matter the actual type.
*
*              pname     is a pointer to an ASCII string that will be used as the name of the semaphore,
*                        mutex, mailbox or queue.  The string must be able to hold at least
*                        OS_EVENT_NAME_SIZE characters.
*
*              perr      is a pointer to an error code that can contain one of the following values:
*
*                        OS_ERR_NONE                if the requested task is resumed
*                        OS_ERR_EVENT_TYPE          if 'pevent' is not pointing to the proper event
*                                                   control block type.
*                        OS_ERR_PNAME_NULL          You passed a NULL pointer for 'pname'
*                        OS_ERR_PEVENT_NULL         if you passed a NULL pointer for 'pevent'
*                        OS_ERR_NAME_SET_ISR        if you called this function from an ISR
*
* Returns    : None
*********************************************************************************************************
*/

#if (OS_EVENT_EN) && (OS_EVENT_NAME_SIZE > 1)
void  OSEventNameSet (OS_EVENT *pevent, INT8U *pname, INT8U *perr)
{
    INT8U      len;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (perr == (INT8U *)0) {                    /* Validate 'perr'                                    */
        return;
    }
    if (pevent == (OS_EVENT *)0) {               /* Is 'pevent' a NULL pointer?                        */
        *perr = OS_ERR_PEVENT_NULL;
        return;
    }
    if (pname == (INT8U *)0) {                   /* Is 'pname' a NULL pointer?                         */
        *perr = OS_ERR_PNAME_NULL;
        return;
    }
#endif
    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        *perr = OS_ERR_NAME_SET_ISR;
        return;
    }
    switch (pevent->OSEventType) {
        case OS_EVENT_TYPE_SEM:
        case OS_EVENT_TYPE_MUTEX:
        case OS_EVENT_TYPE_MBOX:
        case OS_EVENT_TYPE_Q:
             break;

        default:
             *perr = OS_ERR_EVENT_TYPE;
             return;
    }
    OS_ENTER_CRITICAL();
    len = OS_StrLen(pname);                           /* Can we fit the string in the storage area?    */
    if (len > (OS_EVENT_NAME_SIZE - 1)) {             /* No                                            */
        OS_EXIT_CRITICAL();
        *perr = OS_ERR_EVENT_NAME_TOO_LONG;
        return;
    }
    (void)OS_StrCopy(pevent->OSEventName, pname);     /* Yes, copy name to the event control block     */
    OS_EXIT_CRITICAL();
    *perr = OS_ERR_NONE;
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                      PEND ON MULTIPLE EVENTS
*
* Description: This function waits for multiple events.  If multiple events are ready at the start of the
*              pend call, then all available events are returned as ready.  If the task must pend on the
*              multiple events, then only the first posted or aborted event is returned as ready.
*
* Arguments  : pevents_pend  is a pointer to a NULL-terminated array of event control blocks to wait for.
*
*              pevents_rdy   is a pointer to an array to return which event control blocks are available
*                            or ready.  The size of the array MUST be greater than or equal to the size
*                            of the 'pevents_pend' array, including terminating NULL.
*
*              pmsgs_rdy     is a pointer to an array to return messages from any available message-type
*                            events.  The size of the array MUST be greater than or equal to the size of
*                            the 'pevents_pend' array, excluding the terminating NULL.  Since NULL
*                            messages are valid messages, this array cannot be NULL-terminated.  Instead,
*                            every available message-type event returns its messages in the 'pmsgs_rdy'
*                            array at the same index as the event is returned in the 'pevents_rdy' array.
*                            All other 'pmsgs_rdy' array indices are filled with NULL messages.
*
*              timeout       is an optional timeout period (in clock ticks).  If non-zero, your task will
*                            wait for the resources up to the amount of time specified by this argument.
*                            If you specify 0, however, your task will wait forever for the specified
*                            events or, until the resources becomes available (or the events occur).
*
*              perr          is a pointer to where an error message will be deposited.  Possible error
*                            messages are:
*
*                            OS_ERR_NONE         The call was successful and your task owns the resources
*                                                or, the events you are waiting for occurred; check the
*                                                'pevents_rdy' array for which events are available.
*                            OS_ERR_PEND_ABORT   The wait on the events was aborted; check the
*                                                'pevents_rdy' array for which events were aborted.
*                            OS_ERR_TIMEOUT      The events were not received within the specified
*                                                'timeout'.
*                            OS_ERR_PEVENT_NULL  If 'pevents_pend', 'pevents_rdy', or 'pmsgs_rdy' is a 
*                                                NULL pointer.
*                            OS_ERR_EVENT_TYPE   If you didn't pass a pointer to an array of semaphores, 
*                                                mailboxes, and/or queues.
*                            OS_ERR_PEND_ISR     If you called this function from an ISR and the result
*                                                would lead to a suspension.
*                            OS_ERR_PEND_LOCKED  If you called this function when the scheduler is locked.
*
* Returns    : >  0          the number of events returned as ready or aborted.
*              == 0          if no events are returned as ready because of timeout or upon error.
*
* Notes      : 1) a. Validate 'pevents_pend' array as valid OS_EVENTs : 
*
*                        semaphores, mailboxes, queues
*
*                 b. Return ALL available events and messages, if any
*
*                 c. Add    current task priority as pending to   each events's wait list
*                      Performed in OS_EventTaskWaitMulti()
*
*                 d. Wait on any of multiple events
*
*                 e. Remove current task priority as pending from each events's wait list
*                      Performed in OS_EventTaskRdy(), if events posted or aborted
*
*                 f. Return any event posted or aborted, if any
*                      else
*                    Return timeout
*
*              2) 'pevents_rdy' initialized to NULL PRIOR to all other validation or function handling in 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆国产欧美日韩综合精品二区| 91麻豆精品国产无毒不卡在线观看| 精品久久久久久综合日本欧美| 免费成人在线影院| 日韩片之四级片| 国产一区999| 国产精品成人在线观看| 成人黄色在线网站| 亚洲欧美日韩在线| 在线亚洲人成电影网站色www| 一区二区三区四区视频精品免费| 欧美自拍丝袜亚洲| 久久狠狠亚洲综合| 中文字幕免费不卡| 91黄色激情网站| 美脚の诱脚舐め脚责91| 国产亚洲精品中文字幕| 91猫先生在线| 免费人成网站在线观看欧美高清| 26uuu久久天堂性欧美| 粉嫩蜜臀av国产精品网站| 亚洲精品国产一区二区精华液| 欧美美女视频在线观看| 精品亚洲免费视频| 亚洲人成亚洲人成在线观看图片| 欧美三级中文字| 国产一区二区在线影院| 亚洲视频一区二区在线| 欧美一区二区免费视频| 成人免费av在线| 午夜精品影院在线观看| 久久久噜噜噜久久中文字幕色伊伊| 成人av动漫在线| 奇米影视在线99精品| 欧美激情综合五月色丁香小说| 欧美丝袜自拍制服另类| 国产福利精品一区二区| 日韩国产欧美在线视频| 中文字幕一区二区在线观看| 69堂精品视频| av不卡在线观看| 狠狠色丁香九九婷婷综合五月| 亚洲色欲色欲www| 国产亚洲一区二区三区在线观看| 欧美日韩二区三区| 成人激情图片网| 久久成人免费电影| 亚洲图片欧美色图| 国产精品久久久久久久久快鸭| 91精品国产91综合久久蜜臀| 91丨九色丨黑人外教| 国产一区二区三区综合| 亚洲一区二区三区四区的 | 色婷婷久久久亚洲一区二区三区| 日韩综合在线视频| 亚洲精品日产精品乱码不卡| 久久精品人人做人人爽人人| 欧美一卡在线观看| 欧美午夜影院一区| 色综合久久中文综合久久牛| 国产91丝袜在线播放九色| 精品系列免费在线观看| 丝袜美腿亚洲色图| 一区二区三区中文在线| 国产精品九色蝌蚪自拍| 久久综合九色综合97_久久久| 8x福利精品第一导航| 欧美午夜精品一区二区蜜桃| 99久久综合国产精品| 岛国一区二区在线观看| 国产一区二区三区免费看| 毛片不卡一区二区| 日韩1区2区日韩1区2区| 亚洲国产成人91porn| 一区二区欧美国产| 亚洲一区二区成人在线观看| 亚洲丝袜美腿综合| 亚洲精品成人在线| 亚洲资源在线观看| 一区二区三区精密机械公司| 亚洲久本草在线中文字幕| 国产精品护士白丝一区av| 中文无字幕一区二区三区| 欧美高清在线一区| 国产精品久久久久国产精品日日| 久久综合色综合88| 国产欧美日韩不卡免费| 亚洲国产成人一区二区三区| 中文av一区二区| 亚洲日本一区二区| 一区二区三区国产精华| 亚洲国产一区在线观看| 婷婷国产在线综合| 免费高清成人在线| 国产一区不卡在线| 99久久久精品免费观看国产蜜| 99精品在线观看视频| 色哟哟国产精品| 欧美精品视频www在线观看| 日韩视频在线永久播放| 国产色综合久久| 亚洲精品视频自拍| 日韩精品一级二级 | 国产高清在线精品| 国产白丝网站精品污在线入口| 97久久人人超碰| 欧美日韩成人激情| 久久久精品免费网站| 亚洲同性同志一二三专区| 亚洲国产精品久久久久婷婷884| 日韩福利视频网| 国产东北露脸精品视频| 在线欧美日韩精品| 欧美成人一区二区三区在线观看| 久久毛片高清国产| 亚洲蜜臀av乱码久久精品蜜桃| 午夜不卡在线视频| 国产成人在线视频网站| 欧洲av一区二区嗯嗯嗯啊| 欧美一个色资源| 国产精品不卡在线| 日韩影院在线观看| av毛片久久久久**hd| 欧美人牲a欧美精品| 国产日韩精品久久久| 亚洲成人av在线电影| 国产精品99久久久久久久女警| 日本韩国欧美三级| 久久久欧美精品sm网站| 亚洲综合视频在线观看| 国产乱对白刺激视频不卡| 在线观看不卡视频| 久久精品亚洲精品国产欧美| 亚洲午夜一区二区| 成人免费av网站| 欧美成人午夜电影| 午夜精品免费在线观看| 成人午夜精品一区二区三区| 欧美高清一级片在线| 亚洲天堂av老司机| 久久99精品久久久久久动态图| 在线欧美日韩精品| 国产精品久久久一本精品| 久久成人免费电影| 欧美无乱码久久久免费午夜一区| 国产精品久久免费看| 黑人巨大精品欧美一区| 欧美日韩情趣电影| 亚洲人成精品久久久久| 国产不卡一区视频| 精品久久久久久久久久久久久久久| 亚洲香蕉伊在人在线观| www.日韩大片| 日本一区二区视频在线观看| 美女mm1313爽爽久久久蜜臀| 在线不卡欧美精品一区二区三区| 亚洲人成网站影音先锋播放| 不卡一区中文字幕| 日本一区二区三区视频视频| 精品中文字幕一区二区| 欧美一级夜夜爽| 亚洲高清在线精品| 欧美私人免费视频| 亚洲成a人片综合在线| 色哟哟亚洲精品| 一色桃子久久精品亚洲| 高清成人免费视频| 国产日产精品一区| 福利一区在线观看| 中文字幕精品综合| 成人一道本在线| 国产精品久久久久影视| 成人精品视频网站| 亚洲欧洲日本在线| 91色视频在线| 亚洲自拍与偷拍| 欧美性大战久久| 日日摸夜夜添夜夜添精品视频 | 91亚洲精品久久久蜜桃网站| 一区视频在线播放| 欧美无砖专区一中文字| 婷婷成人激情在线网| 777久久久精品| 狠狠色丁香婷婷综合| 日本一区二区高清| 93久久精品日日躁夜夜躁欧美| 一区二区三区欧美亚洲| 在线免费观看日韩欧美| 日韩国产一二三区| 久久人人超碰精品| 国产成人精品一区二区三区四区 | 日本高清不卡视频| 图片区小说区区亚洲影院| 日韩欧美一区电影| 国产尤物一区二区| 亚洲三级在线播放| 欧美久久久久久蜜桃| 毛片不卡一区二区| 国产精品日日摸夜夜摸av| 欧洲精品在线观看|