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

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

?? os_time.c

?? KEIL平臺下,LPC23XX官方的UCOSii的移植文件,包含各種功能的測試程序.
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2007, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.85
*
* LICENSING TERMS:
* ---------------
*   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.  
* If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license 
* its use in your product. We provide ALL the source code for your convenience and to help you experience 
* uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a 
* licensing fee.
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include <ucos_ii.h>
#endif

/*
*********************************************************************************************************
*                                DELAY TASK 'n' TICKS   (n from 0 to 65535)
*
* Description: This function is called to delay execution of the currently running task until the
*              specified number of system ticks expires.  This, of course, directly equates to delaying
*              the current task for some time to expire.  No delay will result If the specified delay is
*              0.  If the specified delay is greater than 0 then, a context switch will result.
*
* Arguments  : ticks     is the time delay that the task will be suspended in number of clock 'ticks'.
*                        Note that by specifying 0, the task will not be delayed.
*
* Returns    : none
*********************************************************************************************************
*/

void  OSTimeDly (INT16U ticks)
{
    INT8U      y;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        return;
    }
    if (ticks > 0) {                             /* 0 means no delay!                                  */
        OS_ENTER_CRITICAL();
        y            =  OSTCBCur->OSTCBY;        /* Delay current task                                 */
        OSRdyTbl[y] &= ~OSTCBCur->OSTCBBitX;
        if (OSRdyTbl[y] == 0) {
            OSRdyGrp &= ~OSTCBCur->OSTCBBitY;
        }
        OSTCBCur->OSTCBDly = ticks;              /* Load ticks in TCB                                  */
        OS_EXIT_CRITICAL();
        OS_Sched();                              /* Find next task to run!                             */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                     DELAY TASK FOR SPECIFIED TIME
*
* Description: This function is called to delay execution of the currently running task until some time
*              expires.  This call allows you to specify the delay time in HOURS, MINUTES, SECONDS and
*              MILLISECONDS instead of ticks.
*
* Arguments  : hours     specifies the number of hours that the task will be delayed (max. is 255)
*              minutes   specifies the number of minutes (max. 59)
*              seconds   specifies the number of seconds (max. 59)
*              milli     specifies the number of milliseconds (max. 999)
*
* Returns    : OS_ERR_NONE
*              OS_ERR_TIME_INVALID_MINUTES
*              OS_ERR_TIME_INVALID_SECONDS
*              OS_ERR_TIME_INVALID_MS
*              OS_ERR_TIME_ZERO_DLY
*              OS_ERR_TIME_DLY_ISR
*
* Note(s)    : The resolution on the milliseconds depends on the tick rate.  For example, you can't do
*              a 10 mS delay if the ticker interrupts every 100 mS.  In this case, the delay would be
*              set to 0.  The actual delay is rounded to the nearest tick.
*********************************************************************************************************
*/

#if OS_TIME_DLY_HMSM_EN > 0
INT8U  OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U ms)
{
    INT32U ticks;
    INT16U loops;


    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        return (OS_ERR_TIME_DLY_ISR);
    }
#if OS_ARG_CHK_EN > 0
    if (hours == 0) {
        if (minutes == 0) {
            if (seconds == 0) {
                if (ms == 0) {
                    return (OS_ERR_TIME_ZERO_DLY);
                }
            }
        }
    }
    if (minutes > 59) {
        return (OS_ERR_TIME_INVALID_MINUTES);    /* Validate arguments to be within range              */
    }
    if (seconds > 59) {
        return (OS_ERR_TIME_INVALID_SECONDS);
    }
    if (ms > 999) {
        return (OS_ERR_TIME_INVALID_MS);
    }
#endif
                                                 /* Compute the total number of clock ticks required.. */
                                                 /* .. (rounded to the nearest tick)                   */
    ticks = ((INT32U)hours * 3600L + (INT32U)minutes * 60L + (INT32U)seconds) * OS_TICKS_PER_SEC
          + OS_TICKS_PER_SEC * ((INT32U)ms + 500L / OS_TICKS_PER_SEC) / 1000L;
    loops = (INT16U)(ticks >> 16);               /* Compute the integral number of 65536 tick delays   */
    ticks = ticks & 0xFFFFL;                     /* Obtain  the fractional number of ticks             */
    OSTimeDly((INT16U)ticks);
    while (loops > 0) {
        OSTimeDly((INT16U)32768u);
        OSTimeDly((INT16U)32768u);
        loops--;
    }
    return (OS_ERR_NONE);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                         RESUME A DELAYED TASK
*
* Description: This function is used resume a task that has been delayed through a call to either
*              OSTimeDly() or OSTimeDlyHMSM().  Note that you can call this function to resume a
*              task that is waiting for an event with timeout.  This would make the task look
*              like a timeout occurred.
*
*              Also, you cannot resume a task that has called OSTimeDlyHMSM() with a combined time that
*              exceeds 65535 clock ticks.  In other words, if the clock tick runs at 100 Hz then, you will
*              not be able to resume a delayed task that called OSTimeDlyHMSM(0, 10, 55, 350) or higher:
*
*                  (10 Minutes * 60 + 55 Seconds + 0.35) * 100 ticks/second.
*
* Arguments  : prio                      specifies the priority of the task to resume
*
* Returns    : OS_ERR_NONE               Task has been resumed
*              OS_ERR_PRIO_INVALID       if the priority you specify is higher that the maximum allowed
*                                        (i.e. >= OS_LOWEST_PRIO)
*              OS_ERR_TIME_NOT_DLY       Task is not waiting for time to expire
*              OS_ERR_TASK_NOT_EXIST     The desired task has not been created or has been assigned to a Mutex.
*********************************************************************************************************
*/

#if OS_TIME_DLY_RESUME_EN > 0
INT8U  OSTimeDlyResume (INT8U prio)
{
    OS_TCB    *ptcb;
#if OS_CRITICAL_METHOD == 3                                    /* Storage for CPU status register      */
    OS_CPU_SR  cpu_sr = 0;
#endif



    if (prio >= OS_LOWEST_PRIO) {
        return (OS_ERR_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = OSTCBPrioTbl[prio];                                 /* Make sure that task exist            */
    if (ptcb == (OS_TCB *)0) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                        /* The task does not exist              */
    }
    if (ptcb == OS_TCB_RESERVED) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                        /* The task does not exist              */
    }
    if (ptcb->OSTCBDly == 0) {                                 /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_ERR_TIME_NOT_DLY);                          /* Indicate that task was not delayed   */
    }

    ptcb->OSTCBDly = 0;                                        /* Clear the time delay                 */
    if ((ptcb->OSTCBStat & OS_STAT_PEND_ANY) != OS_STAT_RDY) {
        ptcb->OSTCBStat     &= ~OS_STAT_PEND_ANY;              /* Yes, Clear status flag               */
        ptcb->OSTCBStatPend  =  OS_STAT_PEND_TO;               /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBStatPend  =  OS_STAT_PEND_OK;
    }
    if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) == OS_STAT_RDY) {  /* Is task suspended?                   */
        OSRdyGrp               |= ptcb->OSTCBBitY;             /* No,  Make ready                      */
        OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
        OS_EXIT_CRITICAL();
        OS_Sched();                                            /* See if this is new highest priority  */
    } else {
        OS_EXIT_CRITICAL();                                    /* Task may be suspended                */
    }
    return (OS_ERR_NONE);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                         GET CURRENT SYSTEM TIME
*
* Description: This function is used by your application to obtain the current value of the 32-bit
*              counter which keeps track of the number of clock ticks.
*
* Arguments  : none
*
* Returns    : The current value of OSTime
*********************************************************************************************************
*/

#if OS_TIME_GET_SET_EN > 0
INT32U  OSTimeGet (void)
{
    INT32U     ticks;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    OS_ENTER_CRITICAL();
    ticks = OSTime;
    OS_EXIT_CRITICAL();
    return (ticks);
}
#endif

/*
*********************************************************************************************************
*                                            SET SYSTEM CLOCK
*
* Description: This function sets the 32-bit counter which keeps track of the number of clock ticks.
*
* Arguments  : ticks      specifies the new value that OSTime needs to take.
*
* Returns    : none
*********************************************************************************************************
*/

#if OS_TIME_GET_SET_EN > 0
void  OSTimeSet (INT32U ticks)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99精品久久久久婷婷| 欧美视频日韩视频| 欧美视频三区在线播放| 久久综合久久久久88| 亚洲午夜激情av| 丰满白嫩尤物一区二区| 欧美一卡在线观看| 亚洲日本va在线观看| 国产精品一区二区久久精品爱涩| 欧美日韩电影在线播放| 亚洲色图欧洲色图婷婷| 成人av资源网站| 久久综合色综合88| 美女视频黄a大片欧美| 欧美视频一区二区三区四区| 一区视频在线播放| 国产成人精品三级麻豆| 久久久91精品国产一区二区精品| 天天影视色香欲综合网老头| 欧美亚洲免费在线一区| 国产精品不卡在线| av中文一区二区三区| 国产色婷婷亚洲99精品小说| 国内精品在线播放| 欧美成人综合网站| 日本aⅴ精品一区二区三区 | 亚洲精品高清在线观看| 成人性视频网站| 日本一区二区三区高清不卡| 国产呦精品一区二区三区网站| 欧美一区二区三区啪啪| 日韩av午夜在线观看| 欧美精品乱码久久久久久| 亚洲成人一区二区| 91精品国产免费| 麻豆精品久久精品色综合| 欧美大片一区二区三区| 久久99最新地址| 欧美mv和日韩mv的网站| 国产成人综合亚洲网站| 国产精品成人免费| 色综合av在线| 亚洲chinese男男1069| 在线电影国产精品| 免费成人在线网站| 337p日本欧洲亚洲大胆色噜噜| 国产乱码精品一区二区三区五月婷 | 91精品久久久久久久91蜜桃| 三级在线观看一区二区| 精品美女一区二区三区| 国产成人在线色| 亚洲男女毛片无遮挡| 欧美性videosxxxxx| 日日夜夜精品视频免费| 久久久精品国产99久久精品芒果| 国产白丝网站精品污在线入口| 国产精品美女久久久久aⅴ| 色婷婷综合久久久中文一区二区 | 欧美日韩免费在线视频| 日韩av一二三| 欧美韩国日本综合| 欧美日韩国产综合一区二区三区| 精东粉嫩av免费一区二区三区| 久久精子c满五个校花| 色呦呦网站一区| 久久成人久久爱| 亚洲女子a中天字幕| 欧美电视剧免费观看| av不卡在线播放| 乱一区二区av| 一区二区三区欧美激情| 久久婷婷国产综合国色天香| 欧美综合一区二区| 狠狠色丁香婷婷综合| 亚洲一级在线观看| 中文字幕不卡三区| 欧美丰满高潮xxxx喷水动漫| 成人午夜av在线| 另类欧美日韩国产在线| 美女免费视频一区二区| 1区2区3区精品视频| 精品成人a区在线观看| 欧美性欧美巨大黑白大战| 国产乱一区二区| 日本不卡一区二区三区高清视频| 国产精品高潮呻吟久久| 日韩欧美国产综合在线一区二区三区| 99国内精品久久| 国产精品99久久久| 麻豆91在线播放| 日本不卡一二三| 亚洲国产成人高清精品| 中文字幕制服丝袜成人av| 久久精品人人做人人综合| 在线电影院国产精品| 欧美色图激情小说| 色婷婷综合久久久久中文| 不卡电影一区二区三区| 国产精品一区免费在线观看| 日本午夜一区二区| 婷婷综合另类小说色区| 亚洲伊人色欲综合网| 日韩伦理免费电影| 1000精品久久久久久久久| 中文av字幕一区| 中文字幕中文字幕一区| 中文字幕亚洲精品在线观看| 日本一区二区三区在线不卡| 国产日韩欧美在线一区| 久久精品欧美日韩| 欧美激情一区不卡| 中文字幕视频一区| 一区在线观看免费| 亚洲欧美日韩人成在线播放| 中文字幕一区三区| 亚洲精品乱码久久久久久| 亚洲精品第1页| 亚洲第一主播视频| 国产福利91精品一区| 国产成人在线色| av资源站一区| 欧美在线啊v一区| 欧美另类久久久品| 日韩美女在线视频| 国产亚洲精品福利| 中文字幕亚洲成人| 亚洲综合激情网| 日本午夜一本久久久综合| 麻豆一区二区99久久久久| 国内精品视频一区二区三区八戒| 精品一区二区国语对白| 国产乱理伦片在线观看夜一区| 成人免费高清视频在线观看| 99国产精品久久久久久久久久 | 亚洲人成在线观看一区二区| 亚洲人成网站色在线观看| 亚洲在线视频一区| 婷婷开心久久网| 久草这里只有精品视频| 成人性视频网站| 91九色最新地址| 91精品国产日韩91久久久久久| 精品国产乱码久久久久久夜甘婷婷 | 国产精品亚洲一区二区三区妖精| 粉嫩aⅴ一区二区三区四区五区| 不卡视频一二三四| 欧美精品在线一区二区| 精品第一国产综合精品aⅴ| 国产精品久久久久久久第一福利 | 亚洲色图欧美偷拍| 免费观看一级欧美片| 成人精品电影在线观看| 欧美精品久久99久久在免费线| 欧美va在线播放| 亚洲精品综合在线| 经典三级视频一区| 91精品91久久久中77777| 欧美久久久久久久久中文字幕| 久久久久久久网| 日韩精品电影在线| 成人黄色777网| 欧美一区二区性放荡片| 亚洲天堂2016| 国产精选一区二区三区| 在线观看欧美精品| 久久一留热品黄| 奇米888四色在线精品| 91影院在线观看| 欧美一区二区三区成人| 国产精品免费av| 精品在线观看视频| 欧美日韩综合在线| 亚洲欧洲成人精品av97| 精品一区二区日韩| 91精品国产丝袜白色高跟鞋| 亚洲男人天堂av网| 国产69精品久久99不卡| 欧美tickle裸体挠脚心vk| 天堂午夜影视日韩欧美一区二区| av男人天堂一区| 久久亚洲影视婷婷| 国产一区二区视频在线播放| 日韩一区二区三区三四区视频在线观看 | 亚洲成av人片在线观看| 99热99精品| 国产欧美精品一区二区色综合 | 色婷婷综合久久| 国产精品成人午夜| 不卡一区二区在线| 中文字幕一区二区三区四区不卡| 国产剧情一区二区| 欧美激情一区二区在线| 国产经典欧美精品| 欧美国产欧美综合| 国产不卡免费视频| 国产精品国产馆在线真实露脸 | 午夜视频一区二区| 欧美日韩成人综合在线一区二区| 一区二区三区日韩精品视频| 色综合一区二区三区|