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

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

?? os_core.c

?? ucos-ii+lpc123x proteus emulate
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             CORE FUNCTIONS
*
*                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : OS_CORE.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#define  OS_GLOBALS
#include "includes.h"
#endif

/*
*********************************************************************************************************
*                              MAPPING TABLE TO MAP BIT POSITION TO BIT MASK
*
* Note: Index into table is desired bit position, 0..7
*       Indexed value corresponds to bit mask
*********************************************************************************************************
*/

INT8U  const  OSMapTbl[]   = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};

/*
*********************************************************************************************************
*                                       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[] = {
    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                             */
};

/*
*********************************************************************************************************
*                                       FUNCTION PROTOTYPES
*********************************************************************************************************
*/
static  void  OS_InitEventList(void);
static  void  OS_InitMisc(void);
static  void  OS_InitRdyList(void);
static  void  OS_InitTaskIdle(void);
static  void  OS_InitTaskStat(void);
static  void  OS_InitTCBList(void);

/*$PAGE*/
/*
*********************************************************************************************************
*                                             INITIALIZATION
*
* Description: This function is used to initialize the internals of uC/OS-II and MUST be called prior to
*              creating any uC/OS-II object and, prior to calling OSStart().
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

void  OSInit (void)
{
#if OS_VERSION >= 204
    OSInitHookBegin();                                           /* Call port specific initialization code   */
#endif

    OS_InitMisc();                                               /* Initialize miscellaneous variables       */

    OS_InitRdyList();                                            /* Initialize the Ready List                */
    OS_InitTCBList();                                            /* Initialize the free list of OS_TCBs      */
    OS_InitEventList();                                          /* Initialize the free list of OS_EVENTs    */

#if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
    OS_FlagInit();                                               /* Initialize the event flag structures     */
#endif

#if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
    OS_MemInit();                                                /* Initialize the memory manager            */
#endif

#if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
    OS_QInit();                                                  /* Initialize the message queue structures  */
#endif

    OS_InitTaskIdle();                                           /* Create the Idle Task                     */
#if OS_TASK_STAT_EN > 0
    OS_InitTaskStat();                                           /* Create the Statistic Task                */
#endif

#if OS_VERSION >= 204
    OSInitHookEnd();                                             /* Call port specific init. code            */
#endif
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                              ENTER ISR
*
* Description: This function is used to notify uC/OS-II that you are about to service an interrupt
*              service routine (ISR).  This allows uC/OS-II to keep track of interrupt nesting and thus
*              only perform rescheduling at the last nested ISR.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) This function should be called ith interrupts already disabled
*              2) Your ISR can directly increment OSIntNesting without calling this function because
*                 OSIntNesting has been declared 'global'.  
*              3) You MUST still call OSIntExit() even though you increment OSIntNesting directly.
*              4) You MUST invoke OSIntEnter() and OSIntExit() in pair.  In other words, for every call
*                 to OSIntEnter() at the beginning of the ISR you MUST have a call to OSIntExit() at the
*                 end of the ISR.
*              5) You are allowed to nest interrupts up to 255 levels deep.
*              6) I removed the OS_ENTER_CRITICAL() and OS_EXIT_CRITICAL() around the increment because
*                 OSIntEnter() is always called with interrupts disabled.
*********************************************************************************************************
*/

void  OSIntEnter (void)
{
    if (OSRunning == TRUE) {
        if (OSIntNesting < 255) {
            OSIntNesting++;                      /* Increment ISR nesting level                        */
        }
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                               EXIT ISR
*
* Description: This function is used to notify uC/OS-II that you have completed serviving an ISR.  When
*              the last nested ISR has completed, uC/OS-II will call the scheduler to determine whether
*              a new, high-priority task, is ready to run.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) You MUST invoke OSIntEnter() and OSIntExit() in pair.  In other words, for every call
*                 to OSIntEnter() at the beginning of the ISR you MUST have a call to OSIntExit() at the
*                 end of the ISR.
*              2) Rescheduling is prevented when the scheduler is locked (see OS_SchedLock())
*********************************************************************************************************
*/

void  OSIntExit (void)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr;
#endif
    
    
    if (OSRunning == TRUE) {
        OS_ENTER_CRITICAL();
        if (OSIntNesting > 0) {                            /* Prevent OSIntNesting from wrapping       */
            OSIntNesting--;
        }
        if ((OSIntNesting == 0) && (OSLockNesting == 0)) { /* Reschedule only if all ISRs complete ... */
            OSIntExitY    = OSUnMapTbl[OSRdyGrp];          /* ... and not locked.                      */
            OSPrioHighRdy = (INT8U)((OSIntExitY << 3) + OSUnMapTbl[OSRdyTbl[OSIntExitY]]);
            if (OSPrioHighRdy != OSPrioCur) {              /* No Ctx Sw if current task is highest rdy */
                OSTCBHighRdy  = OSTCBPrioTbl[OSPrioHighRdy];
                OSCtxSwCtr++;                              /* Keep track of the number of ctx switches */
                OSIntCtxSw();                              /* Perform interrupt level ctx switch       */
            }
        }
        OS_EXIT_CRITICAL();
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                          PREVENT SCHEDULING
*
* Description: This function is used to prevent rescheduling to take place.  This allows your application
*              to prevent context switches until you are ready to permit context switching.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) You MUST invoke OSSchedLock() and OSSchedUnlock() in pair.  In other words, for every
*                 call to OSSchedLock() you MUST have a call to OSSchedUnlock().
*********************************************************************************************************
*/

#if OS_SCHED_LOCK_EN > 0
void  OSSchedLock (void)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
    if (OSRunning == TRUE) {                     /* Make sure multitasking is running                  */
        OS_ENTER_CRITICAL();
        if (OSLockNesting < 255) {               /* Prevent OSLockNesting from wrapping back to 0      */
            OSLockNesting++;                     /* Increment lock nesting level                       */
        }
        OS_EXIT_CRITICAL();
    }
}
#endif    

/*$PAGE*/
/*
*********************************************************************************************************
*                                          ENABLE SCHEDULING
*
* Description: This function is used to re-allow rescheduling.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) You MUST invoke OSSchedLock() and OSSchedUnlock() in pair.  In other words, for every
*                 call to OSSchedLock() you MUST have a call to OSSchedUnlock().
*********************************************************************************************************
*/

#if OS_SCHED_LOCK_EN > 0
void  OSSchedUnlock (void)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
    if (OSRunning == TRUE) {                                   /* Make sure multitasking is running    */
        OS_ENTER_CRITICAL();
        if (OSLockNesting > 0) {                               /* Do not decrement if already 0        */
            OSLockNesting--;                                   /* Decrement lock nesting level         */
            if ((OSLockNesting == 0) && (OSIntNesting == 0)) { /* See if sched. enabled and not an ISR */
                OS_EXIT_CRITICAL();
                OS_Sched();                                    /* See if a HPT is ready                */
            } else {
                OS_EXIT_CRITICAL();
            }
        } else {
            OS_EXIT_CRITICAL();
        }
    }
}
#endif    

/*$PAGE*/
/*
*********************************************************************************************************
*                                          START MULTITASKING
*
* Description: This function is used to start the multitasking process which lets uC/OS-II manages the
*              task that you have created.  Before you can call OSStart(), you MUST have called OSInit()

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
天天影视涩香欲综合网 | 欧美影视一区在线| 国产成人免费视频网站| 激情图区综合网| 久久成人18免费观看| 麻豆极品一区二区三区| 蜜桃av噜噜一区| 久久99在线观看| 精品无码三级在线观看视频| 麻豆精品视频在线| 久国产精品韩国三级视频| 激情综合一区二区三区| 国产一区二区三区精品视频| 国产99一区视频免费| 成人一区二区三区中文字幕| 99精品久久只有精品| 日本精品裸体写真集在线观看 | 欧美色老头old∨ideo| 欧美日韩大陆一区二区| 欧美日韩精品电影| 日韩欧美久久久| 久久精品人人爽人人爽| 亚洲品质自拍视频网站| 亚洲午夜电影网| 捆绑紧缚一区二区三区视频| 国产精品综合一区二区| 99精品黄色片免费大全| 欧美少妇bbb| 精品国产凹凸成av人导航| 日本一区二区三区免费乱视频| 亚洲欧美日韩系列| 日韩精品成人一区二区在线| 国产另类ts人妖一区二区| 不卡av电影在线播放| 欧美日免费三级在线| 日韩一区二区三区免费看| 国产三级精品在线| 一区二区三区日韩欧美精品| 日韩精品成人一区二区三区| 97se亚洲国产综合自在线不卡| 91麻豆精东视频| 91精品国产福利| 国产精品人成在线观看免费 | 国内成+人亚洲+欧美+综合在线| 国产成人精品三级麻豆| 欧美三级乱人伦电影| 久久毛片高清国产| 亚洲黄色录像片| 国产在线不卡视频| 日本高清不卡视频| 久久亚洲一区二区三区明星换脸 | 蜜乳av一区二区| 成人app下载| 91精品久久久久久久99蜜桃| 国产精品伦理在线| 日产国产欧美视频一区精品| 91在线看国产| 久久久精品tv| 日韩国产在线一| 97久久精品人人做人人爽50路| 日韩亚洲欧美一区二区三区| 亚洲日本在线看| 美女视频免费一区| 色呦呦国产精品| 中文字幕欧美区| 久久99国产精品免费网站| 欧美在线短视频| 国产日韩欧美一区二区三区乱码| 日韩黄色免费电影| 一本大道综合伊人精品热热| 久久精品综合网| 日韩电影免费在线观看网站| 色欧美乱欧美15图片| 欧美激情一区二区三区蜜桃视频| 青青青伊人色综合久久| 在线观看免费一区| 成人欧美一区二区三区黑人麻豆| 韩国午夜理伦三级不卡影院| 7777精品久久久大香线蕉| 一区二区三区精品在线观看| 波多野结衣中文字幕一区| 国产清纯在线一区二区www| 美女高潮久久久| 欧美一卡二卡在线| 亚洲国产一区二区在线播放| 91老司机福利 在线| 国产精品久久久久久久浪潮网站 | 日韩无一区二区| 亚洲成人手机在线| 在线观看日韩国产| 国产精品丝袜黑色高跟| 国产成人综合亚洲网站| 久久综合狠狠综合久久综合88| 另类小说图片综合网| 欧美一区二区精品| 日韩高清一区在线| 欧美人与性动xxxx| 五月婷婷久久丁香| 欧美日韩在线播放三区四区| 亚洲一区二区精品3399| 欧美在线免费观看亚洲| 亚洲制服丝袜在线| 欧洲精品一区二区三区在线观看| 樱花影视一区二区| 欧美色图在线观看| 亚洲在线中文字幕| 欧美日本在线播放| 日韩av一级片| 精品福利视频一区二区三区| 久久精品国产在热久久| 久久久久久久久久久久久久久99 | 精品午夜久久福利影院| 欧美大片国产精品| 精品一区二区免费看| 337p日本欧洲亚洲大胆精品| 国产乱子伦视频一区二区三区 | 久久嫩草精品久久久精品| 国产精品中文字幕欧美| 亚洲国产经典视频| 91丨porny丨最新| 亚洲国产成人高清精品| 欧美一区二区播放| 国产精品原创巨作av| 国产精品国产自产拍在线| 91麻豆swag| 日韩综合小视频| 久久亚洲私人国产精品va媚药| 成人综合婷婷国产精品久久 | 手机精品视频在线观看| 欧美一区二区三区公司| 国产电影一区在线| 亚洲日本va午夜在线影院| 久久久不卡网国产精品一区| 成人精品免费看| 亚洲一区二区欧美| 亚洲精品一区二区三区在线观看 | 在线观看一区二区视频| 天天综合色天天综合色h| 亚洲精品一线二线三线| 99国产精品一区| 天天做天天摸天天爽国产一区| 精品久久人人做人人爽| 波多野结衣中文字幕一区| 性感美女极品91精品| 久久久高清一区二区三区| 欧洲av一区二区嗯嗯嗯啊| 久久国产欧美日韩精品| 国产精品国产三级国产普通话99| 欧美日韩激情在线| 国产99久久久国产精品潘金网站| 亚洲一二三四在线观看| 26uuu亚洲综合色| 欧美在线综合视频| 国产成人鲁色资源国产91色综| 亚洲高清一区二区三区| 国产视频视频一区| 欧美性淫爽ww久久久久无| 国产精品一级黄| 午夜精品视频一区| 国产精品传媒入口麻豆| 欧美电影免费观看高清完整版在| 91同城在线观看| 国产一区视频网站| 日韩中文字幕一区二区三区| 国产精品久久久久影院亚瑟| 欧美刺激午夜性久久久久久久| 91毛片在线观看| 国产精品18久久久久| 亚洲高清视频中文字幕| 中文字幕一区二区在线观看 | 视频一区国产视频| 国产精品毛片久久久久久| 日韩精品一区二区三区老鸭窝| 在线亚洲高清视频| 99久久99久久精品国产片果冻| 免费美女久久99| 亚洲不卡av一区二区三区| 国产精品成人一区二区三区夜夜夜| 精品少妇一区二区三区在线视频| 欧美调教femdomvk| 91日韩一区二区三区| 高清成人免费视频| 国产一区二区看久久| 日韩精品乱码av一区二区| 亚洲综合无码一区二区| 综合久久一区二区三区| 国产亚洲成av人在线观看导航| 欧美白人最猛性xxxxx69交| 欧美精品在线视频| 欧美日韩一区中文字幕| 色爱区综合激月婷婷| av电影在线观看一区| 成人精品免费看| 国产麻豆精品视频| 色综合欧美在线| jvid福利写真一区二区三区| 国产成人av资源| 国产成人精品aa毛片| 国产成人小视频| 国产成人av影院|