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

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

?? os_core.c

?? 基于LPC2200實驗箱的中速采樣源代碼
?? 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一区二区三区免费野_久草精品视频
黄网站免费久久| 91久久一区二区| 色综合亚洲欧洲| 日韩亚洲欧美综合| 亚洲特级片在线| 捆绑变态av一区二区三区| 99久久精品情趣| 欧美mv和日韩mv国产网站| 亚洲自拍偷拍图区| 成年人国产精品| 久久蜜桃av一区精品变态类天堂| 日韩中文字幕91| 欧美在线观看一二区| 亚洲欧洲av一区二区三区久久| 精品午夜久久福利影院| 欧美精品三级日韩久久| 亚洲午夜久久久久久久久久久| 成人av电影在线观看| 亚洲国产精品国自产拍av| 久久激情五月婷婷| 欧美一区二区三区在线观看| 首页综合国产亚洲丝袜| 欧美日韩成人综合在线一区二区 | 色欧美乱欧美15图片| 国产午夜三级一区二区三| 久草在线在线精品观看| 欧美变态口味重另类| 久久疯狂做爰流白浆xx| 26uuu精品一区二区在线观看| 麻豆精品久久精品色综合| 在线不卡a资源高清| 日本一区中文字幕| 欧美一二三四在线| 激情综合网av| 国产欧美日韩三级| 成人av在线一区二区| 中文字幕一区在线观看视频| heyzo一本久久综合| 日本91福利区| 精品处破学生在线二十三| 国产一区二区三区黄视频| 亚洲国产精品99久久久久久久久| 国产一区二区三区av电影| 欧美国产综合一区二区| 色婷婷亚洲婷婷| 日日噜噜夜夜狠狠视频欧美人 | 亚洲国产精品天堂| 欧美三级三级三级爽爽爽| 日本不卡高清视频| 久久精品无码一区二区三区| 91浏览器打开| 日韩av一二三| 国产精品天天摸av网| 色爱区综合激月婷婷| 日韩 欧美一区二区三区| 久久久久久电影| 色老综合老女人久久久| 蜜桃久久久久久| 国产精品家庭影院| 欧美一级片免费看| www.欧美.com| 日韩福利视频网| 亚洲国产成人午夜在线一区| 欧美视频中文一区二区三区在线观看| 日韩成人精品视频| 国产精品视频第一区| 在线综合视频播放| 99re视频精品| 久久成人18免费观看| 日韩理论电影院| 久久综合色天天久久综合图片| 99精品视频在线观看免费| 三级成人在线视频| 国产精品国产成人国产三级| 日韩欧美在线1卡| 91视频国产资源| 国产精品一区二区无线| 亚洲成a人在线观看| 国产精品视频在线看| 日韩美女一区二区三区四区| 日本韩国欧美三级| 国产福利一区在线| 奇米四色…亚洲| 樱桃视频在线观看一区| 久久久久久久久久久久久女国产乱| 91国模大尺度私拍在线视频| 丁香桃色午夜亚洲一区二区三区| 日韩影院在线观看| 亚洲第一狼人社区| 夜夜爽夜夜爽精品视频| 国产精品蜜臀在线观看| 日韩欧美成人激情| 欧美高清一级片在线| 欧美亚洲国产bt| 91麻豆123| 91热门视频在线观看| 高清国产一区二区三区| 国产专区综合网| 精品一区二区日韩| 蜜桃视频一区二区三区在线观看| 性做久久久久久免费观看| 亚洲黄色性网站| 亚洲日本在线视频观看| 人人超碰91尤物精品国产| 婷婷开心久久网| 午夜精品久久久久影视| 香蕉影视欧美成人| 亚洲国产日韩在线一区模特| 亚洲一区二区在线免费观看视频| 亚洲欧美区自拍先锋| 最新国产の精品合集bt伙计| 1024成人网色www| 亚洲黄一区二区三区| 亚洲老司机在线| 亚洲高清在线精品| 午夜精品久久久久久久久久久| 亚洲成人777| 美脚の诱脚舐め脚责91| 久久99久久久久| 国产成人精品免费网站| 成人看片黄a免费看在线| 99免费精品视频| 色综合久久88色综合天天免费| 91麻豆免费视频| 欧美亚洲综合另类| 日韩欧美一区电影| 国产区在线观看成人精品| 中文字幕一区日韩精品欧美| 亚洲综合免费观看高清完整版| 亚洲国产aⅴ天堂久久| 久久国内精品视频| 国产98色在线|日韩| 波多野结衣91| 欧美日韩日日骚| 2023国产精品视频| 日本一区二区三区四区在线视频| 亚洲免费在线播放| 免费成人在线网站| 国产精品一区二区男女羞羞无遮挡| 东方aⅴ免费观看久久av| 色天使久久综合网天天| 欧美一区二区精美| 国产精品乱子久久久久| 亚洲第一福利一区| 国产精品一二三四区| 色视频一区二区| 精品国产一区二区三区四区四| 中文字幕在线不卡| 美女一区二区久久| 91女厕偷拍女厕偷拍高清| 91精品国产麻豆国产自产在线 | 亚洲国产综合色| 激情五月婷婷综合网| 91美女片黄在线观看91美女| 欧美一卡二卡在线观看| 亚洲三级在线免费| 激情综合网最新| 欧美伊人精品成人久久综合97| 久久久另类综合| 午夜欧美大尺度福利影院在线看 | 麻豆国产欧美日韩综合精品二区| 丁香啪啪综合成人亚洲小说 | 国产日韩欧美亚洲| 天堂久久一区二区三区| 成人黄色国产精品网站大全在线免费观看 | 在线视频你懂得一区二区三区| 欧美va日韩va| 亚洲综合自拍偷拍| 成人少妇影院yyyy| 精品盗摄一区二区三区| 香蕉久久夜色精品国产使用方法| 成人av影视在线观看| 精品粉嫩超白一线天av| 首页国产欧美日韩丝袜| 精品国产乱码久久久久久浪潮| 亚洲va欧美va人人爽午夜| www.色精品| 欧美国产成人在线| 国产资源在线一区| 日韩精品中文字幕在线一区| 亚洲成人在线观看视频| 一本大道久久精品懂色aⅴ| 国产精品久久久久久久午夜片| 国产一区二区0| 精品剧情v国产在线观看在线| 爽好多水快深点欧美视频| 欧美在线观看一二区| 一区二区三区中文在线| av电影一区二区| 日韩一区在线免费观看| 成人av资源在线| 亚洲欧洲国产日韩| 91色视频在线| 亚洲精品日产精品乱码不卡| 91在线视频免费91| 亚洲视频免费在线观看| 99九九99九九九视频精品| 亚洲欧美电影院| 91免费国产在线| 亚洲国产欧美日韩另类综合 |