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

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

?? os_core.c

?? 全套PIC18F452移植UC/OS-II文件,解決AARGB0/AARGB1/AARGB2....AARGB7未定義問(wèn)題,編譯前請(qǐng)查看里面的說(shuō)明文件,按說(shuō)明文件操作100 通過(guò)編譯鏈接
?? 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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本欧美韩国一区三区| 国产一区二区电影| 国产亚洲欧美色| 99精品久久免费看蜜臀剧情介绍| 亚洲地区一二三色| 久久久国产精品不卡| 欧美精品日韩一本| 99久久99精品久久久久久 | 中文字幕第一区| 欧美剧情片在线观看| 成人av免费在线播放| 精品无人码麻豆乱码1区2区| 亚洲妇女屁股眼交7| 国产精品夫妻自拍| 久久精品一区二区三区不卡牛牛 | 制服丝袜国产精品| 91伊人久久大香线蕉| 国产一区二区三区免费播放| 亚洲一区二区视频在线| 国产精品久久久久久久久果冻传媒 | 在线免费观看一区| 国产999精品久久久久久| 久久精品国产精品亚洲综合| 亚洲国产中文字幕在线视频综合| 中文字幕亚洲在| 国产亚洲欧美中文| 午夜精品久久久久影视| 最新日韩av在线| 国产精品午夜免费| 国产午夜精品美女毛片视频| 欧美大片一区二区| 日韩免费一区二区三区在线播放| 欧美日韩精品一区二区三区四区 | 欧美成人aa大片| 91精品国产综合久久精品性色| 91久久精品网| 91成人在线观看喷潮| 色综合视频在线观看| yourporn久久国产精品| 不卡的av电影在线观看| 国产69精品久久久久777| 国产成人精品在线看| 国产91精品久久久久久久网曝门 | 欧美一级艳片视频免费观看| 欧美日韩免费在线视频| 欧美日韩性生活| 欧美精品丝袜中出| 日韩欧美中文字幕一区| 精品三级在线观看| 久久久99久久| 国产精品全国免费观看高清| 亚洲欧美综合网| 亚洲视频每日更新| 一片黄亚洲嫩模| 午夜久久电影网| 美女www一区二区| 国产伦精品一区二区三区在线观看| 国产精品中文欧美| 丁香一区二区三区| 色婷婷综合视频在线观看| 欧美一a一片一级一片| 欧美精选午夜久久久乱码6080| 亚洲欧洲精品一区二区三区不卡 | 亚洲私人影院在线观看| 亚洲一区二区欧美| 久久国产日韩欧美精品| 国产真实乱子伦精品视频| 成人一区二区三区视频| 日本韩国欧美一区二区三区| 在线不卡的av| 国产视频在线观看一区二区三区| 中文字幕一区二区三区在线播放 | 精一区二区三区| 不卡的av在线播放| 3d成人动漫网站| 欧美国产丝袜视频| 亚洲成人av中文| 国产一区美女在线| 91国产丝袜在线播放| 欧美一区午夜视频在线观看| 国产亚洲一本大道中文在线| 一区二区欧美国产| 极品少妇xxxx精品少妇偷拍| 91尤物视频在线观看| 欧美一级日韩一级| 成人免费小视频| 日韩国产欧美一区二区三区| 成人看片黄a免费看在线| 欧美色中文字幕| 国产欧美一区二区精品忘忧草| 亚洲高清不卡在线观看| 国产精品99久久久久久似苏梦涵 | 91美女在线视频| 蜜乳av一区二区三区| 精品国产麻豆免费人成网站| 亚洲欧美一区二区三区国产精品| 奇米777欧美一区二区| 91在线视频免费91| 日韩免费一区二区三区在线播放| 国产精品国产馆在线真实露脸| 国产精品二三区| 韩国v欧美v亚洲v日本v| 欧美亚洲国产一卡| 国产丝袜美腿一区二区三区| 日韩成人精品在线观看| 99久久精品国产网站| 26uuu成人网一区二区三区| 亚洲国产人成综合网站| 成人毛片视频在线观看| 精品国内二区三区| 五月婷婷久久丁香| 在线观看91视频| 亚洲天堂福利av| 成人晚上爱看视频| 26uuu亚洲婷婷狠狠天堂| 日韩激情一二三区| 在线视频欧美精品| 最新久久zyz资源站| 国产盗摄女厕一区二区三区| 日韩欧美三级在线| 首页国产欧美日韩丝袜| 欧美日韩在线播| 亚洲一区二区在线视频| 色婷婷精品久久二区二区蜜臀av | 日韩欧美123| 丝袜美腿一区二区三区| 欧美亚洲图片小说| 亚洲欧美日韩在线| 不卡影院免费观看| 国产精品免费aⅴ片在线观看| 韩国v欧美v亚洲v日本v| 久久这里只有精品视频网| 日本成人在线网站| 91精品国产欧美一区二区18 | 亚洲视频在线一区二区| 丁香婷婷综合网| 国产视频一区在线播放| 国产精一区二区三区| 久久香蕉国产线看观看99| 久久精品国产成人一区二区三区| 欧美卡1卡2卡| 日韩激情视频在线观看| 7777精品伊人久久久大香线蕉经典版下载 | 中文字幕巨乱亚洲| 国产·精品毛片| 欧美韩国日本一区| 成人av综合一区| 亚洲色图丝袜美腿| 日本精品免费观看高清观看| 亚洲三级小视频| 在线观看中文字幕不卡| 丝瓜av网站精品一区二区| 在线综合+亚洲+欧美中文字幕| 青青青伊人色综合久久| 欧美精品一区男女天堂| 国产寡妇亲子伦一区二区| 国产精品毛片久久久久久| 不卡影院免费观看| 亚洲综合一二区| 欧美美女黄视频| 紧缚捆绑精品一区二区| 国产女人18水真多18精品一级做| www.欧美日韩国产在线| 一区二区三区资源| 欧美日韩在线播放三区| 精品在线观看视频| 亚洲欧美在线另类| 欧美三级日韩在线| 国模无码大尺度一区二区三区| 日本一二三不卡| 欧美在线视频全部完| 蜜臀av性久久久久蜜臀aⅴ流畅| 久久久久久9999| 一本在线高清不卡dvd| 天天色综合天天| 久久久99免费| 欧美三级中文字幕| 国模大尺度一区二区三区| 日韩一区有码在线| 欧美高清激情brazzers| 国产激情精品久久久第一区二区| 亚洲欧美另类久久久精品| 欧美精选午夜久久久乱码6080| 久久99久久久久久久久久久| 国产精品人成在线观看免费| 欧美日韩黄色影视| 丁香婷婷综合色啪| 爽爽淫人综合网网站| 中文字幕久久午夜不卡| 欧美日本视频在线| 高清国产一区二区| 日韩电影一区二区三区| 最近中文字幕一区二区三区| 日韩欧美一区中文| 久久综合一区二区| 色婷婷香蕉在线一区二区| 久久99国产精品成人| 亚洲国产欧美在线| 国产精品视频yy9299一区| 91精品久久久久久久99蜜桃|