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

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

?? os_core.c

?? 實(shí)現(xiàn)ucos任務(wù)調(diào)度時(shí)保存LCD上的顯示信息
?? 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 code 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 code 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) KCREENTRANT
{
#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) KCREENTRANT
{
    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) KCREENTRANT
{
#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) KCREENTRANT
{
#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) KCREENTRANT
{
#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()

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品成a人在线观看| 欧美一区二区三区在线看| 青草国产精品久久久久久| 亚洲靠逼com| 亚洲国产成人精品视频| 精品系列免费在线观看| 麻豆免费看一区二区三区| 免费不卡在线观看| 日韩电影在线观看网站| 国产成人精品免费视频网站| 国产不卡高清在线观看视频| 国产一区二区电影| 欧美视频在线一区| 久久久噜噜噜久噜久久综合| 国产午夜精品在线观看| 亚洲欧美一区二区三区久本道91| 日韩国产欧美在线播放| 成人免费福利片| 91精品国产品国语在线不卡| 久久久影院官网| 毛片av一区二区| 91成人在线观看喷潮| 欧美变态tickle挠乳网站| 亚洲人123区| 国产精品1024| 日韩一区二区在线观看| 亚洲综合av网| 国产精品中文有码| 欧美一个色资源| 日韩成人免费电影| 91国产免费看| 日韩美女视频19| 久久99这里只有精品| 欧美一级黄色片| 久久精品99国产精品日本| 色婷婷激情一区二区三区| 国产精品高潮呻吟| 丰满岳乱妇一区二区三区| 国产婷婷一区二区| 成人免费看的视频| 久久精品人人爽人人爽| 成人午夜在线视频| 国产精品你懂的在线| 色老综合老女人久久久| 亚洲资源中文字幕| 欧美精品xxxxbbbb| 国产一区999| 亚洲欧美另类图片小说| 色婷婷久久综合| 免费成人在线观看视频| 欧美一卡在线观看| 国产剧情在线观看一区二区| 国产精品初高中害羞小美女文| 成人精品免费看| 香蕉久久夜色精品国产使用方法 | 久久精品人人爽人人爽| 成人h精品动漫一区二区三区| 亚洲人成网站影音先锋播放| av网站免费线看精品| 亚洲国产裸拍裸体视频在线观看乱了 | 欧美日韩一区二区三区在线| 国产乱码精品一区二区三区忘忧草 | 视频一区欧美精品| 中文字幕在线不卡一区| 2欧美一区二区三区在线观看视频| 国产综合色视频| 日本中文一区二区三区| 欧美激情综合在线| 日韩精品一区二区三区老鸭窝| 成人高清视频在线| 日本欧美韩国一区三区| 亚洲一区二区中文在线| 亚洲欧美偷拍三级| 一本大道久久a久久精二百| 蜜臀av性久久久久av蜜臀妖精| 亚洲综合在线五月| 精品国产乱码91久久久久久网站| 在线观看区一区二| 欧洲国产伦久久久久久久| 国产大陆a不卡| 国产一区91精品张津瑜| 国产激情一区二区三区| 喷白浆一区二区| 麻豆传媒一区二区三区| 黄色资源网久久资源365| 日韩高清在线电影| 精品在线观看视频| 国产在线播精品第三| 国产精品综合在线视频| 成人久久视频在线观看| av高清不卡在线| 一本到一区二区三区| 欧洲色大大久久| 91精品久久久久久久久99蜜臂| 日韩欧美一区二区视频| 日韩一区二区三区在线视频| 欧美videofree性高清杂交| 国产清纯美女被跳蛋高潮一区二区久久w| 欧美一区二区三区免费大片 | 久久久五月婷婷| 亚洲欧洲av色图| 亚洲国产成人porn| 国产乱码精品一区二区三区av | 日韩精品一级中文字幕精品视频免费观看 | 成人综合在线观看| 欧美视频一二三区| 国产女人aaa级久久久级| 亚洲美女在线国产| 国产乱码字幕精品高清av | 中文字幕字幕中文在线中不卡视频| 日韩中文字幕不卡| 欧美福利视频导航| 亚洲精品国产品国语在线app| 国产成人在线观看| 欧美一级高清大全免费观看| 亚洲欧美综合另类在线卡通| 韩国欧美国产一区| 91精品国产入口| 午夜私人影院久久久久| 一本大道综合伊人精品热热| 欧美—级在线免费片| 国产精品白丝av| 国产夜色精品一区二区av| 日本中文字幕一区| 精品久久久久久无| 国产精品亚洲视频| 国产精品精品国产色婷婷| 成人a区在线观看| 国产精品久久久久aaaa樱花| 99精品在线观看视频| 国产精品毛片a∨一区二区三区| 成人的网站免费观看| 日韩一区有码在线| 色噜噜狠狠色综合中国| 亚洲激情五月婷婷| 91精品国产综合久久香蕉麻豆| 久久99久久精品欧美| 中文字幕高清不卡| 91国在线观看| 久久se精品一区二区| 久久精品欧美日韩精品| 色拍拍在线精品视频8848| 亚洲尤物视频在线| 欧美成人一区二区| 成人一区二区三区| 水蜜桃久久夜色精品一区的特点 | 麻豆一区二区三区| 欧美韩日一区二区三区| 欧美日本免费一区二区三区| 久久99国产精品久久99| 一区av在线播放| 久久精品一区二区三区四区| 色欧美片视频在线观看在线视频| 天堂精品中文字幕在线| 国产精品乱码一区二区三区软件 | 午夜av电影一区| 国产视频亚洲色图| 欧美日韩亚州综合| 成人国产精品免费网站| 久久国产精品第一页| 亚洲午夜av在线| 亚洲色图欧美激情| 久久伊99综合婷婷久久伊| 欧美福利视频导航| 欧美亚洲自拍偷拍| 91麻豆精品视频| 99视频有精品| 99国产精品久久久久久久久久久| 黑人巨大精品欧美一区| 久久99久久99小草精品免视看| 日韩国产精品久久久久久亚洲| 亚洲欧美成人一区二区三区| 亚洲人成影院在线观看| 国产精品国产a级| 综合在线观看色| ...xxx性欧美| 亚洲成人一区在线| 视频一区二区三区入口| 国产精品一区二区三区四区| 色999日韩国产欧美一区二区| 欧美日韩精品三区| 国产欧美一区二区精品秋霞影院| 中文乱码免费一区二区| 一区二区三区四区中文字幕| 日本欧美在线看| 国产成人免费高清| 欧美日韩免费不卡视频一区二区三区| 2021久久国产精品不只是精品| 一区二区三区美女| 激情五月播播久久久精品| 在线影院国内精品| 国产欧美日韩视频在线观看| 麻豆精品久久久| 欧美主播一区二区三区| 久久这里只有精品首页| 亚洲在线视频网站| 国产一区二区三区视频在线播放| 99免费精品视频| 国产网红主播福利一区二区| 蜜桃一区二区三区在线观看|