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

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

?? os_core.c

?? 全套PIC18F452移植UC/OS-II文件,解決AARGB0/AARGB1/AARGB2....AARGB7未定義問題,編譯前請(qǐng)查看里面的說明文件,按說明文件操作100 通過編譯鏈接
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                                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
*********************************************************************************************************
*/

/* Microchip PIC18xxx specific - lookup in program memory because of limited RAM space */
rom INT8U  const  OSMapTbl[]   = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
/* End Microchip PIC18xxx specific */

/*
*********************************************************************************************************
*                                       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)
*********************************************************************************************************
*/

/* Microchip PIC18xxx specific - lookup in program memory because of limited RAM space */
rom INT8U  const  OSUnMapTbl[] = {
/* End Microchip PIC18xxx specific */
    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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲国产日韩| 亚洲欧美一区二区视频| 大美女一区二区三区| 亚洲成在人线免费| 国产精品无码永久免费888| 91精品国产欧美一区二区成人| 成人免费高清视频在线观看| 捆绑调教美女网站视频一区| 亚洲一区二区三区四区不卡| 国产精品久久久久影院老司| 欧美成人vps| 91精品国产91综合久久蜜臀| 91一区一区三区| 国产精品99久久久久久久女警| 日产欧产美韩系列久久99| 亚洲尤物视频在线| 亚洲精品国产精品乱码不99| 国产精品嫩草影院com| 亚洲精品在线三区| 欧美一级一区二区| 在线不卡免费欧美| 欧美喷水一区二区| 91精彩视频在线观看| 99久久精品国产精品久久| 国产suv一区二区三区88区| 国产在线看一区| 另类欧美日韩国产在线| 免费成人美女在线观看| 日韩中文字幕一区二区三区| 亚洲国产精品久久一线不卡| 亚洲情趣在线观看| 亚洲免费观看高清完整| 亚洲人成7777| 一区二区在线观看免费视频播放| 最新不卡av在线| 亚洲欧洲日韩一区二区三区| 亚洲欧美在线视频| 亚洲女同一区二区| 一区二区三区美女| 亚洲成av人影院在线观看网| 亚洲国产精品影院| 亚洲va国产va欧美va观看| 亚洲动漫第一页| 丝袜国产日韩另类美女| 国产精品一区二区91| 风流少妇一区二区| 成人av在线看| 色偷偷88欧美精品久久久| 在线观看亚洲精品| 欧美一区中文字幕| 26uuu另类欧美| 国产日韩欧美精品在线| 中文字幕在线视频一区| 一区二区三区**美女毛片| 亚洲国产另类精品专区| 蜜桃精品视频在线观看| 国产一区二区三区免费| 99re这里都是精品| 欧美性色黄大片| 日韩欧美在线网站| 国产三级精品三级| 亚洲六月丁香色婷婷综合久久| 天天操天天色综合| 精品一区免费av| 波多野结衣一区二区三区| 91精品福利视频| 精品免费视频一区二区| 国产精品久久久久久久久免费樱桃| 一区二区三区在线观看国产| 日本在线播放一区二区三区| 国产高清精品网站| 精品视频全国免费看| 久久综合狠狠综合| 一区二区三区日韩在线观看| 男男成人高潮片免费网站| 国产成人免费高清| 欧美亚洲高清一区| 久久久久久久久久美女| 亚洲综合在线免费观看| 久久成人羞羞网站| 91精品福利视频| 久久久五月婷婷| 一区二区国产盗摄色噜噜| 麻豆极品一区二区三区| av动漫一区二区| 精品电影一区二区| 亚洲国产成人porn| 风流少妇一区二区| 日韩美女视频一区二区在线观看| 亚洲欧洲日产国码二区| 狠狠色狠狠色综合日日91app| 91免费版在线看| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲综合久久久| 粉嫩av一区二区三区粉嫩| 91精品国产色综合久久不卡电影 | www成人在线观看| 一区二区三区.www| av电影在线观看一区| 欧美精品一区二区三| 亚洲成人黄色影院| 91免费在线播放| 久久久久久久久97黄色工厂| 日韩激情中文字幕| 欧美在线free| 成人欧美一区二区三区| 国产成人在线看| 精品乱码亚洲一区二区不卡| 亚洲超碰精品一区二区| 色综合久久久久| 国产精品无码永久免费888| 国产一区福利在线| 欧美哺乳videos| 日本成人超碰在线观看| 欧美色视频在线| 亚洲精品视频一区二区| av在线这里只有精品| 国产精品欧美综合在线| 国产精品一区二区久久精品爱涩| 欧美一区二区精品在线| 亚洲成人免费在线观看| 欧美亚洲高清一区二区三区不卡| 亚洲欧美另类图片小说| 99国产一区二区三精品乱码| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 欧美一区二区三区视频免费| 亚洲国产欧美在线人成| 在线亚洲免费视频| 亚洲精品日产精品乱码不卡| 99国产精品国产精品毛片| 国产欧美精品一区二区三区四区| 国产一区激情在线| 国产午夜久久久久| 国产精品一区二区三区四区 | 日韩你懂的在线播放| 日日夜夜精品视频天天综合网| 欧美性色aⅴ视频一区日韩精品| 一区二区三区精品视频在线| 91美女福利视频| 亚洲欧美另类小说视频| 欧美性色综合网| 日韩av二区在线播放| 日韩午夜在线观看| 国产一区二区三区四| 欧美激情资源网| 一本久道中文字幕精品亚洲嫩| 一区二区在线观看视频| 欧美日韩精品一区二区三区四区| 午夜精品成人在线| 日韩欧美国产精品| 国产精品一区二区在线看| 欧美国产一区视频在线观看| 99久久99久久久精品齐齐| 一区二区三区四区亚洲| 91精品久久久久久蜜臀| 韩国一区二区在线观看| 欧美国产欧美综合| 色婷婷精品大在线视频| 日韩国产高清在线| 久久精品一区二区三区四区| 99re热视频精品| 天天操天天色综合| 久久综合一区二区| 91亚洲精品一区二区乱码| 日韩成人免费电影| 日本一区二区视频在线观看| 在线一区二区三区做爰视频网站| 日本一区中文字幕| 国产精品日产欧美久久久久| 欧美体内she精高潮| 国产精品亚洲专一区二区三区 | 午夜av区久久| 久久综合狠狠综合久久综合88 | 国产日韩亚洲欧美综合| 91色婷婷久久久久合中文| 日韩avvvv在线播放| 国产精品色婷婷久久58| 欧美日韩三级一区| 国产一区二区日韩精品| 一区二区三区加勒比av| 精品国产sm最大网站| 日本高清不卡视频| 国产精品一区二区视频| 亚洲电影在线免费观看| 国产精品乱码妇女bbbb| 欧美一区二区三区免费在线看| 成人免费的视频| 日韩国产欧美在线播放| 亚洲欧美另类久久久精品| 精品国产免费一区二区三区香蕉| 色综合天天性综合| 激情国产一区二区| 亚洲第一成人在线| 国产精品精品国产色婷婷| 日韩欧美国产系列| 欧美精品久久一区| gogo大胆日本视频一区| 国产乱码精品一区二区三区忘忧草| 亚洲成人一区二区在线观看| 亚洲天堂精品在线观看|