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

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

?? os_core.c

?? 這是基于LPC2210芯片的定時器的應(yīng)用源代碼
?? 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一区二区三区免费野_久草精品视频
色天使色偷偷av一区二区| 欧美国产禁国产网站cc| 日韩午夜三级在线| 久久日韩粉嫩一区二区三区| 国产精品久久久久婷婷二区次| 久久一日本道色综合| 国产精品麻豆一区二区| 午夜av一区二区三区| 国产精品77777| 欧美日韩一级片网站| 丝袜美腿成人在线| 成人一道本在线| 欧美成人性福生活免费看| 国产精品丝袜一区| 日本欧美加勒比视频| 美国十次综合导航| 欧美在线免费播放| 国产亚洲污的网站| 日本女优在线视频一区二区 | 欧美日韩国产片| 2欧美一区二区三区在线观看视频| 国产精品九色蝌蚪自拍| 久久er精品视频| 在线观看成人小视频| 精品入口麻豆88视频| 亚洲国产va精品久久久不卡综合| 国产一区二区视频在线播放| 欧洲色大大久久| 狠狠色丁香久久婷婷综| 欧美日韩国产在线观看| 亚洲欧美激情一区二区| 精品一区二区在线免费观看| 精品视频1区2区| 一级精品视频在线观看宜春院| 免费高清不卡av| 欧美亚一区二区| 亚洲色图在线看| 精品蜜桃在线看| 午夜精品一区二区三区电影天堂| 色综合久久中文综合久久97| 国产精品情趣视频| 国产精品996| 国产午夜三级一区二区三| 韩国成人精品a∨在线观看| 91麻豆精品国产| 亚洲韩国精品一区| 欧美亚洲日本一区| 不卡av电影在线播放| 国产精品三级视频| 97aⅴ精品视频一二三区| 亚洲视频一区在线观看| 91视频观看免费| 一区二区三区在线免费| 成人av在线网| 亚洲欧洲性图库| 91国模大尺度私拍在线视频| 欧美国产综合色视频| 不卡一区在线观看| 黄色精品一二区| 国产欧美一区二区三区在线老狼| 国产九色精品成人porny| 91精品国产综合久久香蕉麻豆| 日本欧美一区二区三区| 制服丝袜成人动漫| 国产一区二区三区四区五区入口| 26uuu亚洲| av一二三不卡影片| 奇米精品一区二区三区在线观看一| 日韩高清不卡在线| 欧美国产综合色视频| 欧美日韩国产区一| 成人av网址在线| 日本三级亚洲精品| 亚洲精品乱码久久久久久日本蜜臀| 欧美精品自拍偷拍动漫精品| 国产69精品一区二区亚洲孕妇 | 不卡av在线免费观看| 亚洲成a人片在线观看中文| 午夜视频久久久久久| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 日韩欧美在线网站| 99re这里都是精品| 精品午夜久久福利影院| 99久久久精品| 美女一区二区在线观看| 亚洲激情在线激情| 欧美国产日韩a欧美在线观看| 欧洲国内综合视频| 成人精品鲁一区一区二区| 免费人成黄页网站在线一区二区| 亚洲欧美一区二区三区久本道91| 精品成人一区二区三区| 97成人超碰视| 丁香婷婷综合色啪| 久久er精品视频| 色偷偷久久一区二区三区| 国产激情一区二区三区桃花岛亚洲| 亚洲电影一级片| 亚洲一级二级在线| 伊人色综合久久天天人手人婷| 中文字幕第一区二区| 久久男人中文字幕资源站| 日韩丝袜情趣美女图片| 欧美久久高跟鞋激| 制服丝袜亚洲精品中文字幕| 欧美三级在线播放| 中文字幕一区二区三区在线播放| 久久嫩草精品久久久精品一| 欧美精品一区二区三区在线 | 一本大道久久a久久综合婷婷| 国产成人精品网址| 国产精品一二三四五| 国产精品一品视频| 国产精品亚洲一区二区三区妖精| 国产综合色精品一区二区三区| 另类专区欧美蜜桃臀第一页| 国内久久婷婷综合| 欧美一区二区三区免费| 欧美精品久久天天躁| 91精品国产日韩91久久久久久| 欧美精品123区| 欧美大片一区二区| wwww国产精品欧美| 中文字幕欧美三区| 日韩一区日韩二区| 亚洲一区免费观看| 日韩国产成人精品| 国产综合成人久久大片91| 国产精品系列在线播放| 久久综合九色综合97婷婷| 久久影音资源网| 亚洲特级片在线| 亚洲成av人在线观看| 麻豆免费精品视频| 国产成人亚洲精品青草天美| av在线不卡网| 欧美日本国产一区| www激情久久| 亚洲另类在线一区| 蜜桃在线一区二区三区| 国产99久久久久久免费看农村| 91蜜桃免费观看视频| 亚洲欧美激情小说另类| 偷拍自拍另类欧美| 国产精品一区二区在线观看网站| 99久久99久久精品国产片果冻 | 91在线观看美女| 欧美日韩亚洲高清一区二区| 精品99999| 中文字幕一区二区三区在线播放| 日韩高清不卡一区| 成人免费高清视频| 欧美一卡在线观看| 国产精品综合网| 欧美综合一区二区三区| 久久久噜噜噜久久人人看 | 久久这里只有精品首页| 亚洲欧美成人一区二区三区| 日本不卡一区二区| 国产成人av资源| 欧美丰满高潮xxxx喷水动漫| 国产校园另类小说区| 欧美在线视频不卡| 久久精品亚洲麻豆av一区二区| 一卡二卡欧美日韩| 成人成人成人在线视频| 日韩免费电影一区| 亚洲自拍偷拍图区| jlzzjlzz亚洲日本少妇| 欧美tickling网站挠脚心| 一区二区三区日韩欧美| 国产a级毛片一区| 欧美大片拔萝卜| 亚州成人在线电影| 91视视频在线观看入口直接观看www | 亚洲午夜视频在线| voyeur盗摄精品| 久久久www免费人成精品| 婷婷中文字幕一区三区| 国产亚洲1区2区3区| 欧美96一区二区免费视频| 欧美性受xxxx黑人xyx| 国产精品超碰97尤物18| 国产乱一区二区| 精品久久久久久久久久久久包黑料| 亚洲成人免费影院| 在线免费不卡电影| 亚洲图片你懂的| av电影在线不卡| 国产精品成人网| 国产成人日日夜夜| 久久亚洲精精品中文字幕早川悠里| 婷婷综合另类小说色区| 中文字幕一区二| 不卡的av网站| 中文字幕佐山爱一区二区免费| 夫妻av一区二区| 久久久国产一区二区三区四区小说| 精品一区二区三区免费| 精品美女一区二区三区|