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

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

?? os_time.c

?? uC/OS-II V286 最新的源代碼版本
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                              (c) Copyright 1992-2007, Micrium, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.86
*
* 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本道色综合久久| 精品一区二区三区av| 97国产一区二区| 亚洲免费观看高清| 欧美日韩国产一级二级| 午夜精品久久久久久久 | 丝袜脚交一区二区| 欧美一级久久久久久久大片| 精品在线观看免费| 久久九九影视网| 91在线视频18| 日韩高清国产一区在线| 久久久久久久综合日本| www.亚洲精品| 亚洲va韩国va欧美va精品| 日韩一区二区在线看| 激情六月婷婷久久| **欧美大码日韩| 欧美日韩高清一区| 国产黑丝在线一区二区三区| **欧美大码日韩| 欧美一区午夜视频在线观看| 激情小说欧美图片| 一区二区三区四区不卡在线 | 中文字幕中文在线不卡住| 91丨九色丨蝌蚪丨老版| 午夜激情一区二区| 国产午夜亚洲精品午夜鲁丝片| 91麻豆精品一区二区三区| 日韩电影在线观看电影| 国产精品久久久久久久久果冻传媒| 欧美怡红院视频| 国产精品一卡二| 亚洲成人激情综合网| 精品国产免费久久| 欧洲精品一区二区| 国产成a人无v码亚洲福利| 婷婷亚洲久悠悠色悠在线播放| 久久久久久久性| 精品1区2区3区| 成人a级免费电影| 久久精品久久99精品久久| 中文字幕欧美一区| 欧美电影免费观看高清完整版 | 一区二区三区国产精品| 欧美哺乳videos| 欧美性生交片4| 国产不卡在线一区| 日韩av一区二区在线影视| 亚洲三级免费观看| 国产婷婷精品av在线| 日韩一区二区在线观看视频播放| 一本大道久久a久久综合| 国产呦萝稀缺另类资源| 亚洲成a人v欧美综合天堂下载| 中文字幕av一区二区三区高| 日韩免费看的电影| 欧美日韩一级视频| 色女孩综合影院| 成年人国产精品| 国产精品一卡二| 激情深爱一区二区| 免费观看一级欧美片| 亚洲线精品一区二区三区| 亚洲人成小说网站色在线| 久久精品欧美一区二区三区不卡| 欧美一级国产精品| 欧美一区二区精品久久911| 欧美亚洲动漫精品| 在线观看亚洲一区| 色一区在线观看| 欧美午夜理伦三级在线观看| 波多野洁衣一区| av一区二区不卡| jizz一区二区| 成人性色生活片| 国产成人a级片| 成人激情免费视频| 不卡一二三区首页| 91丨九色porny丨蝌蚪| av综合在线播放| 91丨九色丨蝌蚪丨老版| 一本久道中文字幕精品亚洲嫩| 91同城在线观看| 欧美综合一区二区| 欧美一区二区在线看| 这里只有精品99re| 欧美mv日韩mv| 中文字幕av一区 二区| 国产精品伦一区二区三级视频| 国产女人aaa级久久久级| 中文在线一区二区| 中文字幕一区二区三区色视频 | 91精品国产一区二区三区 | 久久久青草青青国产亚洲免观| 欧美成人欧美edvon| 2020国产精品自拍| 国产精品国产三级国产专播品爱网| 国产精品国产三级国产普通话99 | 有码一区二区三区| 亚洲成在人线免费| 久久99精品久久久久| 成人h精品动漫一区二区三区| 色综合激情久久| 欧美一区二区精品| 国产日韩欧美精品一区| 亚洲一区在线观看网站| 精品一区二区久久| 一本色道久久综合亚洲91| 日韩一区二区三区免费观看| 久久婷婷综合激情| 一区二区三区欧美激情| 免费成人美女在线观看.| 国产麻豆午夜三级精品| 94-欧美-setu| 欧美男人的天堂一二区| 久久中文娱乐网| 亚洲欧洲国产专区| 亚洲成人三级小说| 韩国v欧美v日本v亚洲v| 在线观看三级视频欧美| 91精品欧美久久久久久动漫| 久久久www成人免费无遮挡大片| 国产精品久久午夜夜伦鲁鲁| 夜夜精品视频一区二区| 国产一区91精品张津瑜| 日本久久电影网| 欧美zozozo| 亚洲视频免费观看| 久久国产欧美日韩精品| 色综合久久综合中文综合网| 日韩亚洲欧美在线观看| 国产精品美女一区二区三区 | av资源网一区| 51久久夜色精品国产麻豆| 亚洲国产精品成人久久综合一区| 亚洲成人av一区| 国产传媒一区在线| 精品国产123| 一区二区在线观看视频在线观看| 精品一区二区在线播放| 日本久久一区二区三区| 91精品久久久久久蜜臀| 亚洲一区精品在线| 成人一级视频在线观看| 69堂国产成人免费视频| 国产精品久久毛片av大全日韩| 捆绑变态av一区二区三区| 91国偷自产一区二区三区成为亚洲经典| 欧美一二三四区在线| 亚洲永久免费视频| 国产91精品露脸国语对白| 久久一区二区视频| 视频一区免费在线观看| 99国内精品久久| 亚洲精品一区二区三区在线观看 | 热久久久久久久| 色偷偷88欧美精品久久久| 久久欧美中文字幕| 青青草97国产精品免费观看无弹窗版 | 亚洲国产精品激情在线观看| 日韩av电影天堂| 欧美性xxxxxxxx| 欧美一区二区三区免费大片| 亚洲一区二区三区四区在线| 成人免费观看av| 久久久三级国产网站| 久久99精品久久久久婷婷| 日韩一区二区免费电影| 亚洲图片欧美激情| 99久久综合99久久综合网站| 国产视频一区二区三区在线观看| 日本不卡视频在线| 欧美在线观看视频在线| 亚洲福中文字幕伊人影院| 91久久精品国产91性色tv| 亚洲女与黑人做爰| 99久久国产免费看| 亚洲成人午夜电影| 欧美狂野另类xxxxoooo| 亚洲国产一区二区三区青草影视| 91尤物视频在线观看| 中文字幕日本乱码精品影院| 91年精品国产| 一区二区三区久久| 欧美视频你懂的| 亚洲第一福利一区| 欧美精品在线观看播放| 亚洲一卡二卡三卡四卡五卡| 欧美日韩一区高清| 日本亚洲电影天堂| 欧美一二三四在线| 一区二区免费视频| 精品日本一线二线三线不卡| 国产剧情av麻豆香蕉精品| 久久精品人人爽人人爽| 国产成人精品亚洲777人妖 | 欧美一卡二卡在线| 麻豆精品视频在线观看| 久久综合九色综合97_久久久|