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

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

?? os_core.c

?? protues仿真ARM ARM的I2C
?? 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 "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
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品乱人伦中文| 国产精品综合二区| 亚洲国产成人porn| 亚洲靠逼com| 日韩毛片精品高清免费| 1000精品久久久久久久久| 欧美激情中文不卡| 欧美国产97人人爽人人喊| 国产欧美精品在线观看| 久久精品一区二区三区不卡| 久久综合色婷婷| 国产午夜亚洲精品午夜鲁丝片| 久久久噜噜噜久久人人看| 久久精品视频一区| 中文欧美字幕免费| 自拍偷拍欧美激情| 亚洲一区二区高清| 日韩av在线播放中文字幕| 日韩精品每日更新| 久久99国产精品麻豆| 狠狠色丁香久久婷婷综| 国产精品 日产精品 欧美精品| 国产成人精品亚洲777人妖| 国产精品亚洲第一| 99国产欧美另类久久久精品| 91免费国产视频网站| 欧美性极品少妇| 日韩免费观看2025年上映的电影| 2024国产精品视频| 国产精品视频免费看| 亚洲精品欧美专区| 美女网站一区二区| 国产成人精品免费看| 99国产精品久久久| 欧美精品xxxxbbbb| 久久久精品国产99久久精品芒果| 中文字幕av在线一区二区三区| 中文字幕一区在线| 日韩精品欧美精品| 岛国精品在线播放| 欧美无人高清视频在线观看| 欧美成人一区二区三区片免费| 国产日产精品一区| 亚洲福中文字幕伊人影院| 麻豆国产91在线播放| 成人免费av在线| 欧美日韩视频专区在线播放| 精品久久久久久亚洲综合网| 中文字幕第一区综合| 石原莉奈一区二区三区在线观看 | 麻豆成人在线观看| 高清视频一区二区| 欧美日韩dvd在线观看| 久久久久成人黄色影片| 亚洲妇女屁股眼交7| 国产黑丝在线一区二区三区| 欧美性生活大片视频| 久久精品在线观看| 视频一区视频二区在线观看| 成人激情动漫在线观看| 91.xcao| 国产精品女同一区二区三区| 日韩va欧美va亚洲va久久| 成人永久免费视频| 欧美一区二区三区小说| 国产精品久久久久久久久动漫| 日韩精品电影在线观看| 色综合久久久久综合体| 精品国产sm最大网站| 一级女性全黄久久生活片免费| 国产综合色在线视频区| 欧美日韩一区三区四区| 欧美韩国日本不卡| 蜜桃传媒麻豆第一区在线观看| 一本色道久久综合亚洲精品按摩| 欧美成人乱码一区二区三区| 亚洲成人av福利| 91国产丝袜在线播放| 国产女主播视频一区二区| 日韩电影一区二区三区| 欧美影片第一页| 国产精品大尺度| 粉嫩av一区二区三区在线播放| 日韩一区二区三区观看| 亚洲国产精品麻豆| 日本韩国欧美在线| 国产精品伦一区二区三级视频| 蜜臀av一区二区在线观看| 精品视频色一区| 亚洲主播在线播放| 91蝌蚪porny| 最好看的中文字幕久久| 国产精品一区二区果冻传媒| 日韩三级精品电影久久久| 亚洲国产va精品久久久不卡综合| 99国产精品国产精品久久| 欧美经典三级视频一区二区三区| 久久99热这里只有精品| 日韩一区二区电影网| 五月婷婷激情综合| 欧美精三区欧美精三区| 亚洲一区二区影院| 欧美日韩三级视频| 亚洲成人免费视频| 在线播放欧美女士性生活| 天天综合色天天综合| 欧美日韩在线播放三区| 天堂va蜜桃一区二区三区漫画版| 欧美性大战xxxxx久久久| 亚洲综合男人的天堂| 欧美视频中文字幕| 视频一区中文字幕国产| 欧美一区二区视频在线观看2020 | 日本一区中文字幕 | 一区二区三区美女| 欧美亚洲国产一区二区三区va| 一区二区三区在线播放| 91福利视频网站| 日韩精品福利网| 日韩精品一区二区三区在线观看| 久久99精品久久久久久国产越南| 26uuu国产一区二区三区| 国产成人精品亚洲777人妖 | 成人h动漫精品| 亚洲日本免费电影| 欧美三级视频在线播放| 日本视频免费一区| 久久久精品欧美丰满| 91丨porny丨户外露出| 亚洲高清中文字幕| 精品成人佐山爱一区二区| 国产99久久精品| 亚洲一区二区三区在线看| 337p亚洲精品色噜噜噜| 韩国精品一区二区| 亚洲欧美成人一区二区三区| 欧美日韩久久不卡| 日本vs亚洲vs韩国一区三区 | 高清不卡在线观看| 亚洲欧洲综合另类| 欧美主播一区二区三区美女| 日韩有码一区二区三区| 欧美精品一区二区三区在线| 国产九色sp调教91| 亚洲欧美日韩综合aⅴ视频| 欧美精品一二三| 国模大尺度一区二区三区| 欧美国产精品专区| 91福利在线看| 国产一级精品在线| 亚洲色图一区二区三区| 欧洲一区二区三区免费视频| 日本不卡在线视频| 中文字幕一区二区三中文字幕| 91色乱码一区二区三区| 日韩av高清在线观看| 久久久精品天堂| 欧美精品18+| 国产精品77777| 亚洲综合视频在线| 欧美一级片在线| 卡一卡二国产精品| 综合亚洲深深色噜噜狠狠网站| 欧美丝袜自拍制服另类| 麻豆成人免费电影| 久久久久久久综合日本| 欧美在线看片a免费观看| 狠狠色综合色综合网络| 亚洲天堂久久久久久久| 欧美日韩成人综合在线一区二区| 欧美日韩一区国产| 久久99国产精品久久99| 亚洲婷婷综合色高清在线| 欧美日本高清视频在线观看| 91视视频在线观看入口直接观看www| 天天综合网天天综合色| 国产精品不卡视频| 精品欧美久久久| 3d动漫精品啪啪1区2区免费| 成人深夜视频在线观看| 日韩精品色哟哟| 亚洲人成网站色在线观看| 久久久精品免费免费| 欧美人与z0zoxxxx视频| 成人a区在线观看| 美女尤物国产一区| 日韩精品欧美精品| 国产精品素人一区二区| 日韩一区二区在线播放| 91福利视频久久久久| 成人国产亚洲欧美成人综合网| 麻豆精品久久精品色综合| 一区二区激情视频| 欧美激情艳妇裸体舞| 日韩一区和二区| 欧美性高清videossexo| 91色.com| 91免费看`日韩一区二区| 国产成人免费视频网站| 精品在线播放免费|