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

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

?? os_core.c

?? keil for arm環境下 lpc213x系列 完全編譯通過的代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*
*********************************************************************************************************
*                                                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 "..\user\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()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产裸体歌舞团一区二区| 亚洲欧洲在线观看av| 麻豆久久久久久久| 国产欧美va欧美不卡在线| 91精彩视频在线观看| 七七婷婷婷婷精品国产| 国产精品天美传媒| 精品国产精品一区二区夜夜嗨| 国产精品香蕉一区二区三区| 欧美老肥妇做.爰bbww视频| 狠狠色狠狠色综合系列| 精品福利在线导航| 色综合天天视频在线观看 | 国产精品中文字幕一区二区三区| 136国产福利精品导航| 日韩一级成人av| 色欧美片视频在线观看在线视频| 国产盗摄女厕一区二区三区| 日本亚洲欧美天堂免费| 日韩国产在线一| 国产农村妇女精品| 久久欧美一区二区| 337p日本欧洲亚洲大胆精品| 这里只有精品视频在线观看| 欧美日韩精品一区二区天天拍小说 | 日本一区二区三区四区在线视频| 欧美精品色一区二区三区| 亚洲成人三级小说| 亚洲成av人片在www色猫咪| 国产精品久久久爽爽爽麻豆色哟哟| 日韩精品一区二区三区在线 | 欧美人与性动xxxx| 国产久卡久卡久卡久卡视频精品| 亚洲成人动漫av| 亚洲在线观看免费视频| 亚洲一二三区在线观看| 久久精品水蜜桃av综合天堂| 亚洲男帅同性gay1069| 国产精品女上位| 欧美国产欧美综合| 国产精品麻豆一区二区| 一本色道久久综合亚洲91| 色综合久久66| 欧美探花视频资源| 欧美日韩的一区二区| 日韩欧美成人激情| 中文字幕免费不卡在线| 亚洲品质自拍视频| 日韩电影在线观看网站| 狠狠色丁香久久婷婷综合丁香| 激情综合色播五月| 国产a级毛片一区| 成人a区在线观看| 2021国产精品久久精品| 欧美aaa在线| 欧美丰满一区二区免费视频| 有码一区二区三区| www.亚洲激情.com| 国产免费成人在线视频| 国产福利91精品一区二区三区| 51精品国自产在线| 视频一区免费在线观看| 欧美性xxxxx极品少妇| 亚洲伦理在线免费看| 成人精品一区二区三区中文字幕| 久久久久青草大香线综合精品| 日本欧美久久久久免费播放网| 欧美日韩不卡视频| 日韩精品免费专区| 51精品国自产在线| 老汉av免费一区二区三区| 91精品国产综合久久久久久久 | 欧美喷潮久久久xxxxx| 亚洲免费资源在线播放| 欧美在线免费观看视频| 一区二区三区四区在线免费观看| 99精品一区二区| 国产精品大尺度| 一本大道久久精品懂色aⅴ| 一区二区免费视频| 欧美猛男男办公室激情| 欧美aⅴ一区二区三区视频| 日韩欧美你懂的| 国产福利一区二区三区在线视频| 国产日产精品一区| 99视频一区二区| 亚洲福利视频三区| 久久久精品tv| 国产又黄又大久久| 中文字幕乱码日本亚洲一区二区| 95精品视频在线| 亚洲国产成人高清精品| 欧美一级免费观看| 国产在线视频不卡二| 国产精品国产三级国产普通话99 | 亚洲免费高清视频在线| 欧美日本一道本在线视频| 青草av.久久免费一区| 国产色综合久久| www.性欧美| 日韩av网站免费在线| 久久综合av免费| 91精品福利视频| 免费在线观看精品| 欧美成人一区二区三区在线观看| 国产中文字幕一区| 亚洲视频一区二区免费在线观看| 91精品国产黑色紧身裤美女| 国产一本一道久久香蕉| 一区二区三区精品久久久| 日韩精品专区在线影院观看| 高清不卡在线观看| 亚洲mv在线观看| 国产精品久久免费看| 精品免费一区二区三区| 色哟哟日韩精品| 蜜桃91丨九色丨蝌蚪91桃色| 久久久国产精华| 欧美日韩在线播放三区四区| 国产成人一级电影| 日韩影视精彩在线| 综合久久一区二区三区| 久久亚洲精华国产精华液 | 国产精品私人影院| 欧美一区二区三区婷婷月色| 91丝袜呻吟高潮美腿白嫩在线观看| 日本成人在线不卡视频| 亚洲国产激情av| 精品福利二区三区| 欧美一区二区三区小说| 欧美日韩免费在线视频| 91美女片黄在线| 懂色av一区二区三区免费看| 久久av资源站| 麻豆免费精品视频| 日韩在线一二三区| 天堂一区二区在线| 亚洲国产精品自拍| 亚洲精品中文字幕在线观看| 中文成人av在线| 欧美激情一区不卡| 国产亚洲人成网站| 国产亚洲欧洲一区高清在线观看| 欧美成人女星排名| 日韩精品一区二区三区老鸭窝| 欧美人妇做爰xxxⅹ性高电影| 一本色道**综合亚洲精品蜜桃冫| av爱爱亚洲一区| 91麻豆国产福利在线观看| 风间由美一区二区三区在线观看| 欧美午夜电影网| 国产精品一二三在| 国产高清在线精品| 国产高清在线观看免费不卡| 成人一级视频在线观看| 国产高清亚洲一区| 91视频一区二区三区| 亚洲777理论| 亚洲最大成人综合| 亚洲国产精品黑人久久久| 亚洲国产成人自拍| 亚洲日本免费电影| 亚洲最色的网站| 麻豆精品蜜桃视频网站| 精品一区二区三区的国产在线播放 | 日韩国产欧美在线视频| 午夜不卡av在线| 日精品一区二区三区| 久久99国内精品| www.亚洲色图.com| 欧美视频一区二区三区四区 | 三级久久三级久久久| 日韩高清在线不卡| 国内成+人亚洲+欧美+综合在线| 精品系列免费在线观看| 成人国产亚洲欧美成人综合网| 99久久精品国产麻豆演员表| 欧美视频一区二区三区| 精品欧美乱码久久久久久1区2区| 国产三级一区二区| 亚洲激情图片qvod| 久久电影网电视剧免费观看| 不卡的av电影| 91精品国产91热久久久做人人| 久久午夜色播影院免费高清 | 欧美xxxxxxxx| 亚洲欧洲国产日本综合| 青青青伊人色综合久久| 99re在线视频这里只有精品| 欧美一级高清大全免费观看| 国产精品亲子乱子伦xxxx裸| 日韩二区在线观看| 99精品欧美一区二区蜜桃免费 | 中文字幕+乱码+中文字幕一区| 一区二区三区免费网站| 国产精品综合二区| 这里只有精品免费| 最新高清无码专区| 国产美女在线观看一区| 欧美日韩激情一区二区|