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

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

?? os_core.c

?? ucos-II 在arm7 lpc2106 proteus仿真顯示 lcd圖片 。。整個(gè)工程
?? 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()

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品成a人| 国产二区国产一区在线观看| 亚洲女人的天堂| 国产精品网曝门| 欧美国产精品中文字幕| 日本一区二区三区国色天香| 国产色综合久久| 国产精品五月天| 亚洲丝袜美腿综合| 亚洲欧美另类在线| 亚洲最大成人综合| 午夜影院在线观看欧美| 亚洲成a人片在线不卡一二三区| 亚洲线精品一区二区三区| 午夜久久久久久电影| 日韩中文字幕一区二区三区| 免费在线观看精品| 精品中文av资源站在线观看| 国产中文一区二区三区| 国产成人精品免费看| av网站免费线看精品| 色综合中文字幕国产 | 爽好多水快深点欧美视频| 亚洲成人激情av| 免费的成人av| 成人在线综合网| 色妞www精品视频| 欧美一区二区黄色| 国产日本亚洲高清| 亚洲一区视频在线观看视频| 日韩高清不卡一区| 国产精品一区不卡| 色综合久久中文综合久久97| 欧美色男人天堂| 日韩欧美国产综合一区 | 久久久精品国产99久久精品芒果 | 日本不卡视频一二三区| 国产一区二区三区四区五区美女 | 国产一区二区三区免费看| 国产成人久久精品77777最新版本| 99久久久久久| 欧美电影一区二区三区| 久久婷婷国产综合精品青草| 中文字幕色av一区二区三区| 午夜精品在线看| 国产激情视频一区二区三区欧美| 色综合夜色一区| 欧美一区二区三区视频免费| 国产精品免费观看视频| 亚洲成va人在线观看| 国产精品一二三四区| 精品视频一区三区九区| 国产亚洲精品资源在线26u| 一区二区三区电影在线播| 美女一区二区三区| 91国产精品成人| 国产亚洲一区二区三区四区| 亚洲国产日日夜夜| 丁香天五香天堂综合| 91精品在线免费观看| 亚洲同性gay激情无套| 美女一区二区在线观看| 日本道免费精品一区二区三区| 2019国产精品| 亚洲成av人影院| 成年人午夜久久久| ww久久中文字幕| 日本免费新一区视频| 91电影在线观看| 国产精品人人做人人爽人人添| 青青草97国产精品免费观看| 日本精品视频一区二区| 国产精品色在线观看| 伦理电影国产精品| 在线视频综合导航| 国产精品久久久久影院亚瑟 | 亚洲午夜在线观看视频在线| 成人午夜激情视频| 精品福利在线导航| 免费三级欧美电影| 欧美午夜片在线看| 亚洲啪啪综合av一区二区三区| 国产成人小视频| 久久免费国产精品| 久久av资源站| 日韩一区二区三区在线| 亚洲国产一区二区a毛片| 91欧美一区二区| 国产精品免费视频网站| 国内精品久久久久影院薰衣草| 欧美一区二区在线看| 亚洲国产精品久久久男人的天堂| 色狠狠色狠狠综合| 亚洲天堂2016| 91蜜桃在线观看| 国产精品嫩草影院com| 成人综合婷婷国产精品久久免费| 久久男人中文字幕资源站| 国产专区欧美精品| 2022国产精品视频| 韩国成人在线视频| 精品三级av在线| 国产自产v一区二区三区c| 久久综合九色综合久久久精品综合 | 亚洲视频一区在线观看| 成人av免费网站| 自拍偷拍欧美激情| 91在线观看高清| 亚洲精品免费在线| 91福利在线观看| 亚洲一卡二卡三卡四卡| 欧美色精品在线视频| 天天av天天翘天天综合网色鬼国产 | 亚洲一区二区四区蜜桃| 欧美午夜精品久久久久久超碰| 亚洲一二三专区| 欧美精品免费视频| 精品一区二区三区在线播放| 久久久噜噜噜久久人人看| 成人午夜短视频| 亚洲人吸女人奶水| 欧美视频一区二区三区四区| 天天色天天操综合| 久久亚洲二区三区| 菠萝蜜视频在线观看一区| 亚洲精品中文字幕乱码三区| 欧美亚洲另类激情小说| 日韩av成人高清| 久久综合精品国产一区二区三区| 从欧美一区二区三区| 一区二区三区波多野结衣在线观看| 欧美日韩视频在线一区二区 | 欧美性欧美巨大黑白大战| 日本网站在线观看一区二区三区 | 视频一区欧美精品| 精品国内二区三区| 成人av网站免费观看| 亚洲午夜在线电影| 欧美大白屁股肥臀xxxxxx| 成人一区二区三区视频| 亚洲国产日韩精品| 久久久久久久久免费| 色婷婷综合五月| 久久国产精品无码网站| ...xxx性欧美| 91精品国产aⅴ一区二区| 国产福利精品一区| 亚洲综合在线五月| 久久久亚洲欧洲日产国码αv| 99久久国产综合色|国产精品| 日韩综合一区二区| 国产精品美女久久久久av爽李琼| 欧美色视频在线观看| 国产福利一区二区三区| 午夜精品一区二区三区三上悠亚 | 亚洲国产成人av网| 国产色产综合产在线视频| 欧美色老头old∨ideo| 国产成人午夜精品5599| 亚洲国产一区视频| 中文字幕 久热精品 视频在线| 欧美三日本三级三级在线播放| 国产精品一二三四五| 天天做天天摸天天爽国产一区| 国产精品久久久久久久久图文区 | zzijzzij亚洲日本少妇熟睡| 日韩va欧美va亚洲va久久| 中文字幕中文字幕在线一区| 日韩亚洲国产中文字幕欧美| 91丨九色丨蝌蚪丨老版| 黄页视频在线91| 午夜精品一区二区三区电影天堂 | 又紧又大又爽精品一区二区| 久久精品一区八戒影视| 91精品国产美女浴室洗澡无遮挡| 色哟哟一区二区| 风间由美一区二区三区在线观看| 免费在线欧美视频| 一卡二卡三卡日韩欧美| 欧美激情在线一区二区| 久久综合色天天久久综合图片| 欧美高清视频在线高清观看mv色露露十八| av影院午夜一区| 国产成人在线网站| 蜜桃av一区二区三区电影| 亚洲成人精品一区二区| 亚洲免费在线播放| 国产精品久久毛片av大全日韩| 精品国产乱码久久久久久蜜臀 | 欧美一级xxx| 欧美精品日韩一本| 欧美日韩亚洲综合一区 | 久久久精品国产免费观看同学| 337p亚洲精品色噜噜| 欧美视频在线一区| 91免费观看视频| 91视频免费观看| 99免费精品在线观看| av一二三不卡影片| 波多野结衣的一区二区三区|