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

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

?? 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()

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人在线视频网址| 亚洲成人午夜影院| www激情久久| 日韩片之四级片| 日韩欧美一级在线播放| 欧美一区二区三区视频在线| 欧美揉bbbbb揉bbbbb| 欧美日韩精品综合在线| 欧美日韩国产小视频| 日韩亚洲欧美一区二区三区| 91精品国产综合久久久久| 日韩一区二区精品| 亚洲精品一区二区三区香蕉| 久久婷婷综合激情| 中文字幕欧美一| 亚洲午夜私人影院| 日韩av在线播放中文字幕| 久久91精品国产91久久小草| 国产精品18久久久| 色哟哟国产精品| 日韩亚洲国产中文字幕欧美| 国产亚洲精品精华液| 亚洲精品乱码久久久久久| 亚洲小说春色综合另类电影| 久久97超碰国产精品超碰| 成人一区二区三区视频| 欧美日韩国产综合一区二区三区 | 国产成人免费视频网站 | 免费不卡在线观看| 国产aⅴ综合色| 欧美性xxxxxx少妇| 精品国产一区久久| 亚洲激情图片一区| 国产中文一区二区三区| 一本色道久久综合狠狠躁的推荐| 这里只有精品视频在线观看| 久久久www成人免费毛片麻豆| 亚洲欧美日韩国产一区二区三区| 午夜国产精品一区| 成人深夜福利app| 在线播放欧美女士性生活| 国产亲近乱来精品视频| 天堂影院一区二区| 成人动漫一区二区三区| 日韩一区二区免费在线电影| 亚洲欧美成人一区二区三区| 国内精品伊人久久久久av一坑 | 18成人在线视频| 天堂精品中文字幕在线| 97se亚洲国产综合自在线| 精品捆绑美女sm三区| 亚洲综合成人网| 东方aⅴ免费观看久久av| 日韩午夜电影在线观看| 亚洲一区免费在线观看| 91片在线免费观看| 国产精品毛片大码女人| 精品一区二区三区免费视频| 欧美肥胖老妇做爰| 亚洲午夜私人影院| 欧美在线观看一区二区| 亚洲视频免费在线观看| 久久精品国产色蜜蜜麻豆| 一本大道久久a久久综合| 国产精品久久三| 国产成人午夜高潮毛片| 欧美本精品男人aⅴ天堂| 日本成人在线一区| 欧美剧情片在线观看| 国产精品久久午夜| 99视频在线观看一区三区| 国产女主播一区| 99精品一区二区三区| 中文字幕欧美日韩一区| 成人亚洲精品久久久久软件| 国产欧美一区二区在线观看| 国产成人在线视频免费播放| 久久久久青草大香线综合精品| 精品中文av资源站在线观看| 欧美刺激脚交jootjob| 看电视剧不卡顿的网站| 精品久久五月天| 国产麻豆成人精品| 国产精品久久久久久亚洲毛片| 成人性视频网站| 亚洲精品国产品国语在线app| 色香色香欲天天天影视综合网| 亚洲一区二区五区| 欧美日韩精品系列| 五月天久久比比资源色| 日韩一级欧美一级| 国产成人小视频| 亚洲美女少妇撒尿| 91精品国产综合久久久蜜臀图片 | 国产成人av影院| 国产精品嫩草久久久久| 在线观看成人免费视频| 日本三级亚洲精品| 亚洲国产精品国自产拍av| 91一区一区三区| 日韩中文字幕亚洲一区二区va在线| 日韩精品综合一本久道在线视频| 国产一区二区三区免费播放| 亚洲色图色小说| 日韩一区二区三区在线| 成人综合在线观看| 天天色天天操综合| 国产午夜精品久久久久久免费视 | 欧美中文字幕一二三区视频| 免费高清在线一区| 综合久久给合久久狠狠狠97色| 欧美撒尿777hd撒尿| 国产精品白丝av| 亚洲永久精品国产| 国产日韩欧美一区二区三区综合| 在线视频欧美区| 国产精品 日产精品 欧美精品| 亚洲二区在线视频| 国产精品欧美精品| 精品成人在线观看| 欧美日韩亚洲另类| 一本大道综合伊人精品热热| 国产精品一品二品| 毛片av一区二区| 亚洲国产精品一区二区久久恐怖片| 国产日韩成人精品| 精品国产亚洲一区二区三区在线观看| 色伊人久久综合中文字幕| 国产成人精品综合在线观看 | 在线亚洲免费视频| 国产剧情一区二区三区| 美女在线观看视频一区二区| 亚洲一区二区三区四区的| 国产精品天美传媒| 久久久国产精华| 日韩亚洲欧美综合| 这里是久久伊人| 日本韩国精品一区二区在线观看| 成人精品视频一区| 国产精品综合视频| 国产一区二区三区久久久 | 成人avav影音| 国产91在线观看| 成人伦理片在线| 成人性生交大片免费看在线播放| 久久精品99国产精品日本| 日韩精品每日更新| 亚洲成人av中文| 日韩高清电影一区| 三级久久三级久久| 免费成人在线视频观看| 六月丁香综合在线视频| 美女视频一区二区| 国内精品伊人久久久久av影院 | av在线综合网| 97久久精品人人澡人人爽| av成人老司机| 欧美三级三级三级爽爽爽| 欧美日韩黄色一区二区| 91麻豆精品国产91久久久久| 欧美一卡在线观看| 久久亚洲一区二区三区明星换脸| 久久久精品免费免费| 综合分类小说区另类春色亚洲小说欧美 | 在线看日本不卡| 欧美色区777第一页| 欧美日韩www| 日韩免费看网站| 中国色在线观看另类| 国产精品视频线看| 亚洲美女视频一区| 日本成人在线一区| 国产91精品一区二区麻豆网站 | 中文子幕无线码一区tr| 中文字幕成人在线观看| 一区二区三区加勒比av| 日韩中文字幕一区二区三区| 国产九九视频一区二区三区| 91免费版在线| 精品少妇一区二区三区日产乱码| 日本一区二区视频在线观看| 亚洲一区在线播放| 国产精品一区二区x88av| 91黄色激情网站| 精品国产精品一区二区夜夜嗨| 中文字幕av一区二区三区高| 亚洲成人www| av综合在线播放| 欧美成人激情免费网| 亚洲天堂成人网| 国产揄拍国内精品对白| 色综合久久久久综合99| 精品国产伦一区二区三区观看方式 | 欧美老女人第四色| 久久久国产精华| 三级精品在线观看| 色天使久久综合网天天| 欧美国产一区视频在线观看| 日韩成人dvd| 欧美三日本三级三级在线播放|