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

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

?? 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()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一线二线三线视频| 日韩欧美在线123| 韩国理伦片一区二区三区在线播放 | 欧美日韩成人在线| 欧美日韩久久久一区| 91免费观看在线| 91在线观看视频| 欧美中文字幕一区二区三区亚洲| 成人黄色软件下载| 高清成人免费视频| 国产精品一区二区不卡| 亚洲久草在线视频| 亚洲欧洲另类国产综合| 国产精品久久久久久亚洲毛片| 久久人人爽人人爽| 国产精品女主播在线观看| 成人免费在线播放视频| 一级中文字幕一区二区| 偷拍自拍另类欧美| 国产精品亚洲专一区二区三区| 成人性生交大片免费看视频在线 | 欧亚一区二区三区| 欧美美女视频在线观看| 久久免费偷拍视频| 亚洲欧美日韩一区| 麻豆精品国产传媒mv男同| 不卡一区二区在线| 欧美日韩另类国产亚洲欧美一级| 日韩欧美国产一二三区| 国产精品久久久久久久久快鸭 | 免费观看91视频大全| 国产91清纯白嫩初高中在线观看 | 午夜激情久久久| 国产成人无遮挡在线视频| 色88888久久久久久影院按摩| 欧美电影影音先锋| 亚洲视频一二三区| 麻豆精品国产传媒mv男同| 99在线热播精品免费| 欧美变态tickle挠乳网站| 一区二区激情视频| 国产精品一品视频| 91精品国产色综合久久不卡蜜臀| 国产精品嫩草影院com| 日韩av电影免费观看高清完整版 | 久久先锋影音av鲁色资源| 樱桃国产成人精品视频| 久久99精品久久只有精品| 在线观看成人免费视频| 国产日韩三级在线| 韩国欧美一区二区| 欧美一区二区在线不卡| 综合亚洲深深色噜噜狠狠网站| 理论片日本一区| 69成人精品免费视频| 一个色在线综合| 91蝌蚪国产九色| 中文字幕免费一区| 国产宾馆实践打屁股91| 26uuu国产一区二区三区| 日韩国产在线观看| 欧美喷潮久久久xxxxx| 亚洲国产日韩在线一区模特 | 日韩视频免费观看高清完整版 | 成人一级黄色片| 精品少妇一区二区三区视频免付费| 亚洲综合在线第一页| 91国产免费观看| 一区二区三区视频在线观看 | 日本色综合中文字幕| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国产精品久久久久天堂| 成人成人成人在线视频| 中文字幕一区三区| 91网站最新网址| 一个色在线综合| 欧美日韩免费观看一区三区| 亚洲sss视频在线视频| 欧美老年两性高潮| 蜜桃精品视频在线观看| 精品第一国产综合精品aⅴ| 国产在线精品一区二区不卡了| 精品av久久707| 成人禁用看黄a在线| 亚洲欧美电影一区二区| 欧美久久久久免费| 国产在线播放一区| 国产精品盗摄一区二区三区| 91网上在线视频| 奇米色777欧美一区二区| 久久久久久久久岛国免费| 99久久免费视频.com| 亚洲福利一二三区| www亚洲一区| 91免费看视频| 日韩国产在线一| 久久精品人人做人人综合| 91同城在线观看| 日本不卡在线视频| 国产精品私房写真福利视频| 欧美性受xxxx黑人xyx性爽| 美女视频一区在线观看| 中文字幕亚洲综合久久菠萝蜜| 欧美中文字幕一二三区视频| 免费看黄色91| 亚洲三级小视频| 欧美本精品男人aⅴ天堂| 成人免费毛片片v| 日韩精品电影一区亚洲| 国产精品午夜免费| 日韩视频一区二区三区在线播放| 懂色一区二区三区免费观看| 偷拍一区二区三区| 亚洲欧美综合另类在线卡通| 在线播放日韩导航| 99久久国产综合精品色伊| 麻豆精品久久精品色综合| 亚洲精品老司机| 国产亚洲欧美日韩在线一区| 欧美日韩国产免费一区二区 | 综合激情成人伊人| 精品国产凹凸成av人导航| 欧美午夜电影网| 成人av免费在线观看| 精品一区二区三区免费| 日日摸夜夜添夜夜添精品视频| 中文字幕的久久| 久久综合九色综合97婷婷女人| 欧美视频一区二区三区在线观看| 粉嫩一区二区三区性色av| 五月天激情小说综合| 亚洲欧美日韩综合aⅴ视频| 国产欧美综合在线| 2021中文字幕一区亚洲| 日韩一区二区免费在线电影| 精品视频在线免费观看| 色综合一区二区三区| 成人午夜伦理影院| 丰满少妇在线播放bd日韩电影| 久久丁香综合五月国产三级网站| 五月婷婷久久综合| 亚洲午夜电影在线| 亚洲成人精品一区| 亚洲国产精品一区二区久久| 亚洲图片另类小说| 自拍视频在线观看一区二区| 国产精品国产三级国产普通话三级| 精品久久久久久久一区二区蜜臀| 制服.丝袜.亚洲.另类.中文| 3atv在线一区二区三区| 在线播放国产精品二区一二区四区| 欧美日韩免费一区二区三区| 欧美喷潮久久久xxxxx| 欧美区一区二区三区| 91精品国产美女浴室洗澡无遮挡| 欧美色欧美亚洲另类二区| 欧美色男人天堂| 91精品国产麻豆| 欧美精品一区二区久久婷婷| 精品88久久久久88久久久| 久久五月婷婷丁香社区| 精品成人佐山爱一区二区| 2024国产精品| 亚洲欧美综合色| 亚洲第一激情av| 久久疯狂做爰流白浆xx| 高清不卡一区二区| 色综合天天在线| 欧美日韩国产一区二区三区地区| 在线播放中文字幕一区| 精品久久久久久久久久久院品网| 久久久久久综合| 亚洲男同1069视频| 奇米综合一区二区三区精品视频| 激情欧美一区二区| 99久久久国产精品免费蜜臀| 欧美日韩一级黄| 久久精品一区八戒影视| 亚洲精品国产品国语在线app| 亚洲成人精品一区二区| 国产精品一区二区三区网站| 99久久99久久久精品齐齐| 在线成人午夜影院| 国产精品人妖ts系列视频| 亚洲精品v日韩精品| 麻豆国产精品视频| 91免费在线视频观看| 精品乱人伦一区二区三区| 亚洲国产精品t66y| 日本vs亚洲vs韩国一区三区二区| 国产精品资源在线| 欧美三级欧美一级| 国产精品美女视频| 日本在线不卡视频一二三区| 成人久久18免费网站麻豆| 欧美久久久久免费| 国产精品家庭影院| 久草精品在线观看| 欧美日韩精品欧美日韩精品一 | 成人av资源下载|