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

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

?? os_core.c

?? 基于飛利浦ARM7 LPC214X的u/COS+GUI
?? 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 "..\APP\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()
*              and you MUST have created at least one task.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本久道久久综合中文字幕| 久久亚洲一区二区三区明星换脸 | 国产精品88888| 色网站国产精品| 久久久777精品电影网影网| 亚洲一线二线三线视频| 国产精品一卡二卡在线观看| 欧美丝袜自拍制服另类| 中文字幕在线不卡一区二区三区| 美女精品自拍一二三四| 在线看国产一区| 136国产福利精品导航| 国产在线精品一区二区三区不卡| 欧美放荡的少妇| 一区二区三区日韩欧美| 91玉足脚交白嫩脚丫在线播放| 精品国产91久久久久久久妲己| 亚洲国产精品影院| 一本大道综合伊人精品热热| 久久精品日韩一区二区三区| 蜜臀精品一区二区三区在线观看| 欧美体内she精高潮| 中文字幕一区二区三区不卡| 成人午夜视频福利| 国产日韩欧美综合一区| 国产一区二区在线影院| 日韩免费看网站| 久久99久久99精品免视看婷婷| 91精品国产乱码久久蜜臀| 亚洲高清免费视频| 91高清视频在线| 亚洲午夜电影网| 欧美色网站导航| 亚洲福利一区二区三区| 欧美日韩精品一区二区三区| 亚洲成a人v欧美综合天堂下载 | 一区二区三区在线免费视频| fc2成人免费人成在线观看播放| 亚洲国产高清在线| 91视频观看视频| 亚洲一区自拍偷拍| 日韩一区国产二区欧美三区| 美女诱惑一区二区| 欧美精品一区二区三区蜜桃| 国产大陆a不卡| 国产精品高清亚洲| 欧美三级视频在线| 日本免费新一区视频| 精品久久久久久久久久久久包黑料| 久久99久久99小草精品免视看| 国产午夜精品一区二区三区视频| 国产精品白丝jk黑袜喷水| 中文字幕在线播放不卡一区| 欧美日韩一区二区三区不卡| 久久精品国产99国产精品| 国产欧美日韩不卡| 色先锋资源久久综合| 日韩av一区二| 国产欧美va欧美不卡在线| 欧美亚一区二区| 国产一区二区按摩在线观看| 国产精品色呦呦| 欧美色老头old∨ideo| 精品在线免费观看| 中文字幕人成不卡一区| 欧美精品电影在线播放| 成人深夜在线观看| 天堂成人国产精品一区| 亚洲国产精品二十页| 91久久国产最好的精华液| 日韩影院在线观看| 欧美国产精品v| 欧美日本一区二区在线观看| 风间由美性色一区二区三区| 一区二区三区蜜桃网| 久久久亚洲国产美女国产盗摄| 色先锋资源久久综合| 国产一区二区伦理片| 亚洲v中文字幕| 欧美—级在线免费片| 日韩一区二区三免费高清| 国产又黄又大久久| 有坂深雪av一区二区精品| 精品国产乱码久久久久久牛牛 | 精品一区二区三区在线观看国产| 亚洲视频在线观看三级| 精品国产一区二区三区av性色| 在线观看视频91| kk眼镜猥琐国模调教系列一区二区 | 欧美一级片免费看| 97se亚洲国产综合在线| 久久成人久久爱| 亚洲午夜三级在线| 亚洲欧美综合另类在线卡通| 久久先锋影音av| 777午夜精品视频在线播放| 91黄色小视频| 94-欧美-setu| 不卡的av电影| 国产suv一区二区三区88区| 精品在线免费视频| 日韩福利视频导航| 午夜精品免费在线| 亚洲已满18点击进入久久| 最新国产の精品合集bt伙计| 久久男人中文字幕资源站| 精品国免费一区二区三区| 制服丝袜av成人在线看| 欧美色倩网站大全免费| 欧美三级资源在线| 欧美丝袜自拍制服另类| 欧美综合在线视频| 欧美性色欧美a在线播放| 在线观看亚洲精品视频| 欧美中文字幕一区| 欧美男女性生活在线直播观看| 欧美视频一区二区三区在线观看| 91福利在线播放| 欧美日本一区二区三区四区| 精品视频在线看| 91精品国产高清一区二区三区| 欧美卡1卡2卡| 91精品国产品国语在线不卡| 91精品国产高清一区二区三区| 欧美久久久久免费| 欧美一区二区三区免费视频| 日韩午夜激情免费电影| 欧美成人猛片aaaaaaa| 欧美一二三四在线| 久久久一区二区三区| 中文字幕一区av| 亚洲综合色噜噜狠狠| 日韩精品一区第一页| 免费在线一区观看| 粉嫩一区二区三区在线看 | 国产在线一区观看| 国产999精品久久久久久绿帽| 成人午夜在线播放| 91国偷自产一区二区开放时间 | 97久久精品人人做人人爽| 91浏览器打开| 欧美一区国产二区| 久久精品综合网| 亚洲影院久久精品| 精品夜夜嗨av一区二区三区| 成人av在线一区二区| 欧美日本国产一区| 国产亚洲欧美日韩俺去了| 亚洲精品五月天| 毛片av一区二区| 91在线国产福利| 欧美一区二区三区日韩视频| 久久综合九色综合欧美亚洲| 中文字幕一区在线观看| 日韩精品电影在线| 成人av片在线观看| 日韩欧美国产高清| 一区二区三区免费在线观看| 国内精品在线播放| 欧美色大人视频| 国产精品情趣视频| 久久激情五月婷婷| 日本大香伊一区二区三区| 久久久久国产精品免费免费搜索| 伊人一区二区三区| 国产盗摄一区二区| 日韩午夜在线观看视频| 夜夜嗨av一区二区三区网页| 国产精品香蕉一区二区三区| 91精品国产一区二区三区蜜臀| 国产欧美一二三区| 美女网站在线免费欧美精品| 99re这里只有精品视频首页| 欧美精品一区男女天堂| 五月婷婷欧美视频| 欧美视频第二页| 亚洲视频一区在线观看| 国产69精品久久久久毛片 | 亚洲欧洲性图库| 狠狠色狠狠色合久久伊人| 欧美日韩你懂的| 亚洲免费在线看| 成人黄页毛片网站| 国产欧美日韩激情| 国产精品一区二区在线看| 欧美一区二区在线免费观看| 亚洲一区二区影院| 在线观看成人小视频| 亚洲精品免费一二三区| 成人av电影免费在线播放| 国产亚洲1区2区3区| 久久av中文字幕片| 久久一二三国产| 国产精品一区二区91| 久久久久久久精| 丰满放荡岳乱妇91ww| 国产精品素人视频| 成人午夜激情影院| 国产精品每日更新在线播放网址| 国产成人综合亚洲网站|