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

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

?? os_core.c

?? 0x ISP LPC210x的ISP軟件 Ucosii 2.52 for lpc2100 uC/OS-II移植程序及相關中間件 LPC2114 component library LP
?? 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()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区小说| 国产精品美女一区二区| av中文字幕一区| 成人一级视频在线观看| 国产在线不卡一区| 国产高清成人在线| 成人激情午夜影院| 99re在线精品| 欧美在线不卡一区| 日韩欧美一级在线播放| 26uuu精品一区二区| 国产偷国产偷精品高清尤物| 国产亚洲精品超碰| 亚洲日本在线天堂| 亚洲国产日韩在线一区模特| 日本不卡高清视频| 国产精品一线二线三线| 99精品欧美一区二区三区综合在线| 丁香天五香天堂综合| av不卡免费电影| 欧美日韩精品一区视频| 精品久久久久久久人人人人传媒| 久久精品视频免费| 亚洲精品视频在线观看免费| 日韩不卡一区二区| 丰满亚洲少妇av| 欧美色网站导航| 日韩国产高清影视| 精品亚洲成a人| 91亚洲大成网污www| 色婷婷综合在线| 91精品国产91热久久久做人人| 久久综合999| 亚洲自拍偷拍麻豆| 韩国成人精品a∨在线观看| 99re这里只有精品6| 91精品国产一区二区三区蜜臀| 久久综合av免费| 亚洲成a人v欧美综合天堂| 国产精华液一区二区三区| 色激情天天射综合网| 欧美tickle裸体挠脚心vk| 亚洲色图欧洲色图| 国产美女娇喘av呻吟久久| 欧美亚洲一区二区三区四区| 2019国产精品| 婷婷久久综合九色综合伊人色| 粉嫩aⅴ一区二区三区四区五区 | 天天亚洲美女在线视频| 国产+成+人+亚洲欧洲自线| 欧美日韩成人综合| 中文字幕一区二区三区在线观看| 久久精品免费看| 欧美网站大全在线观看| 中文字幕的久久| 精品在线视频一区| 欧美一区二区三区四区视频 | 欧美猛男男办公室激情| 国产精品久久久久国产精品日日| 麻豆国产精品视频| 欧美日韩精品是欧美日韩精品| 欧美激情在线一区二区| 久国产精品韩国三级视频| 欧美无人高清视频在线观看| 中文字幕一区二区三区视频| 国产精品资源网| 久久久综合视频| 美女视频一区二区三区| 欧美丰满一区二区免费视频 | 欧美久久久久久久久久| 亚洲一卡二卡三卡四卡无卡久久| 不卡免费追剧大全电视剧网站| 精品久久国产字幕高潮| 久久精品久久精品| 日韩无一区二区| 久久精品国产99国产| 88在线观看91蜜桃国自产| 天天av天天翘天天综合网| 欧美图片一区二区三区| 亚洲一区二区三区影院| 欧美视频精品在线观看| 亚洲国产精品一区二区久久| 欧美性猛片aaaaaaa做受| 亚洲专区一二三| 欧美肥胖老妇做爰| 老司机免费视频一区二区三区| 91精品国产一区二区三区| 美女在线视频一区| 国产女人18水真多18精品一级做| 丁香激情综合五月| 亚洲综合色网站| 欧美日本精品一区二区三区| 偷拍一区二区三区四区| 精品美女在线观看| 成人小视频免费在线观看| 成人免费在线观看入口| 欧美制服丝袜第一页| 免费不卡在线观看| 国产日韩欧美亚洲| 色屁屁一区二区| 日韩二区在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 99re视频精品| 日韩高清在线一区| 国产女主播在线一区二区| 欧洲精品中文字幕| 久久99久国产精品黄毛片色诱| 国产精品拍天天在线| 欧美日韩另类一区| 成人一区二区视频| 日本va欧美va精品发布| 国产精品网站在线观看| 精品视频在线看| 高清shemale亚洲人妖| 亚洲精品欧美综合四区| 精品久久久影院| 欧美日韩亚洲丝袜制服| 成人综合在线观看| 日韩av中文字幕一区二区 | 色婷婷一区二区| 久久99热99| 亚洲成国产人片在线观看| 精品国产91乱码一区二区三区| 91久久精品网| www.视频一区| 经典三级一区二区| 午夜亚洲福利老司机| 中文字幕一区二区三区四区不卡 | 免费在线观看精品| 亚洲三级小视频| 国产日产亚洲精品系列| 欧美一级国产精品| 91福利在线导航| 波多野结衣中文一区| 精品一区二区三区视频| 日韩电影在线一区| 亚洲成a人v欧美综合天堂| 亚洲人成小说网站色在线| 2020日本不卡一区二区视频| 欧美一区二区三区在线视频| 久久综合久久99| 91精品国产综合久久久久久久| 色婷婷久久久综合中文字幕| 成人高清在线视频| 国产成人鲁色资源国产91色综| 国产自产视频一区二区三区| 蜜臀av一级做a爰片久久| 婷婷成人综合网| 日本网站在线观看一区二区三区| 亚洲午夜激情网页| 亚洲成人免费影院| 视频一区二区三区中文字幕| 亚洲高清免费观看 | 日韩欧美一区二区在线视频| 欧美日韩精品免费观看视频| 欧美无砖专区一中文字| 欧美日韩中文精品| 欧美精品视频www在线观看| 欧美日韩成人高清| 欧美一区二区三区在线观看视频| 91精品国产综合久久久蜜臀粉嫩| 91精品国产一区二区| 欧美电影免费观看高清完整版在 | 日韩一区二区三区免费看| 欧美美女一区二区三区| 欧美一区二区三区在线观看| 日韩视频永久免费| 26uuuu精品一区二区| 中文字幕不卡一区| 一区二区三区久久久| 亚洲午夜久久久久| 蜜桃一区二区三区四区| 国产一区二区91| 成人免费视频视频在线观看免费 | 亚洲小说春色综合另类电影| 亚洲国产日产av| 久久99精品久久久| 成人ar影院免费观看视频| 欧美三电影在线| 久久综合狠狠综合久久综合88| 国产精品国产三级国产aⅴ入口| 一区二区在线免费观看| 欧美aa在线视频| 成人免费看黄yyy456| 欧美三区在线视频| 国产亚洲人成网站| 一区二区三区欧美日韩| 韩国三级中文字幕hd久久精品| 99re视频这里只有精品| 欧美一区日本一区韩国一区| 欧美经典三级视频一区二区三区| 一区二区激情视频| 国产精品一区在线观看你懂的| 在线观看亚洲专区| 精品久久人人做人人爱| 亚洲综合免费观看高清完整版在线| 精品一区二区在线播放| 在线视频欧美区| 国产精品沙发午睡系列990531| 天天色天天操综合|