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

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

?? os_core.c

?? 嵌入式操作系統源碼usosii-keil c環境開發 可完全運行
?? 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) reentrant
{
#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) reentrant
{
    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) reentrant
{

    
    
    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) reentrant
{

    
    
    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) reentrant
{

    
    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()
*              and you MUST have created at least one task.
*

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区导航在线播放| 久久99精品久久久久久久久久久久| 久草在线在线精品观看| 91啪九色porn原创视频在线观看| 日韩一区二区三区视频在线观看| 国产精品激情偷乱一区二区∴| 日本最新不卡在线| 欧亚洲嫩模精品一区三区| 国产女人18毛片水真多成人如厕| 日本免费新一区视频| 欧美主播一区二区三区| 中文字幕中文在线不卡住| 国产剧情av麻豆香蕉精品| 欧美一区二区三区四区久久| 洋洋av久久久久久久一区| 成人午夜激情片| 久久久精品一品道一区| 蜜桃av噜噜一区| 欧美精品三级在线观看| 亚洲精品成人悠悠色影视| 成人黄动漫网站免费app| 精品国产乱码久久久久久夜甘婷婷 | 国内不卡的二区三区中文字幕| 精品视频一区三区九区| 亚洲精品第1页| 99热99精品| 国产精品久线在线观看| 粉嫩13p一区二区三区| 精品国产免费人成在线观看| 久久精品国产精品亚洲综合| 欧美精品一二三区| 性感美女极品91精品| 欧美在线免费播放| 亚洲欧美激情小说另类| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 日韩不卡手机在线v区| 在线观看三级视频欧美| 亚洲免费av高清| 一本一道久久a久久精品| 国产精品美女久久久久久久| 粉嫩av亚洲一区二区图片| 久久无码av三级| 国产在线精品视频| 久久精品在线观看| 国产成人在线影院| 欧美高清在线视频| jizz一区二区| 亚洲欧美日韩成人高清在线一区| av中文字幕亚洲| 一区视频在线播放| 91一区二区三区在线播放| 亚洲天堂福利av| 91国产成人在线| 亚洲国产成人av网| 欧美一级高清片在线观看| 精一区二区三区| 久久久久久久久久久99999| 国产成人一级电影| 国产精品久久精品日日| 日本韩国欧美一区二区三区| 亚洲国产精品自拍| 这里是久久伊人| 国产一区美女在线| 日本一区二区三区高清不卡 | 日韩va亚洲va欧美va久久| 日韩美女主播在线视频一区二区三区 | 久久久99精品免费观看| 国产.欧美.日韩| 亚洲视频资源在线| 欧美日韩在线播| 麻豆精品视频在线观看| 久久久国际精品| 91在线观看美女| 无码av中文一区二区三区桃花岛| 日韩欧美国产一区二区三区| 国产美女视频91| 亚洲精品美国一| 制服丝袜亚洲色图| 国产一区二区不卡在线| 亚洲免费观看高清完整版在线观看熊| 欧美三级日韩三级| 精品一区二区综合| 椎名由奈av一区二区三区| 欧美日韩国产123区| 精品一区二区三区免费播放| 中文字幕一区在线| 欧美日韩国产综合一区二区三区| 国产一区二区三区精品视频| 亚洲私人黄色宅男| 欧美一区二区日韩| av一区二区三区四区| 视频一区中文字幕| 久久精品一区二区三区不卡 | 99久久综合国产精品| 偷拍一区二区三区| 欧美国产丝袜视频| 欧美妇女性影城| 成人中文字幕合集| 三级一区在线视频先锋| 国产精品美女久久久久久 | 国产成人精品免费看| 午夜影院久久久| 欧美激情综合网| 欧美一区二区精品久久911| 成人免费看视频| 男人的天堂亚洲一区| 国产精品情趣视频| 日韩亚洲欧美成人一区| 97精品电影院| 精品制服美女久久| 亚洲国产va精品久久久不卡综合 | 欧美视频在线一区| 成人网页在线观看| 99久久99久久精品免费看蜜桃| 免费观看30秒视频久久| 亚洲欧美怡红院| 久久天天做天天爱综合色| 欧美日韩国产欧美日美国产精品| 处破女av一区二区| 久久成人综合网| 午夜一区二区三区视频| 国产亚洲欧洲一区高清在线观看| 欧美一区二区三区精品| 在线观看日韩av先锋影音电影院| 国产成人av自拍| 美女一区二区三区在线观看| 亚洲午夜影视影院在线观看| 中文字幕一区二区三区精华液| 日韩午夜中文字幕| 欧美日韩精品专区| 日本国产一区二区| 白白色 亚洲乱淫| 国产精品一级片| 久久国产综合精品| 舔着乳尖日韩一区| 一区二区欧美精品| 国产精品二区一区二区aⅴ污介绍| 精品国产乱码久久久久久闺蜜| 91麻豆精品国产91久久久资源速度 | 久久99精品国产麻豆婷婷| 日日欢夜夜爽一区| 亚洲线精品一区二区三区八戒| 综合久久一区二区三区| 国产丝袜在线精品| 久久这里只有精品首页| 日韩精品一区在线观看| 欧美一区日本一区韩国一区| 欧美日韩另类国产亚洲欧美一级| 一本一道久久a久久精品综合蜜臀| 99精品视频一区| 99国产一区二区三精品乱码| 成人少妇影院yyyy| 成人精品视频.| 成人听书哪个软件好| 国产ts人妖一区二区| 国产在线国偷精品免费看| 国产一区二区久久| 国产精品18久久久久久久久| 国内成人自拍视频| 国产专区欧美精品| 国内外成人在线视频| 国产精品123| 成人sese在线| 99精品偷自拍| 日本道色综合久久| 欧美性猛片xxxx免费看久爱| 欧美视频一区二区| 91精品国产入口| 日韩女同互慰一区二区| 精品福利一区二区三区| 2023国产一二三区日本精品2022| 亚洲精品一区二区三区福利| 久久久www免费人成精品| 国产欧美精品一区aⅴ影院| 中文字幕一区二区在线观看 | 久久看人人爽人人| 国产精品日日摸夜夜摸av| 亚洲欧洲国产专区| 亚洲一二三区在线观看| 五月天丁香久久| 国产一区二区三区免费观看| 波多野结衣在线aⅴ中文字幕不卡| 成人av网站在线观看免费| 91婷婷韩国欧美一区二区| 欧美综合天天夜夜久久| 3751色影院一区二区三区| 亚洲精品一区二区三区影院| 国产精品视频看| 亚洲大片一区二区三区| 美女诱惑一区二区| 菠萝蜜视频在线观看一区| 欧美亚男人的天堂| 日韩精品一区在线| 国产精品毛片无遮挡高清| 一区二区日韩电影| 激情久久五月天| 91在线观看污| 在线播放国产精品二区一二区四区| 亚洲精品一线二线三线无人区| 国产精品久久久久久久久动漫 |