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

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

?? os_time.c

?? Micrium-uCOS-II 2.86版
?? 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一区二区三区免费野_久草精品视频
91精品国产91久久久久久最新毛片| 国产91丝袜在线播放九色| 精品国产露脸精彩对白| 91免费小视频| 亚洲欧美日韩国产另类专区 | 欧美色倩网站大全免费| 久久99国产精品麻豆| 亚洲猫色日本管| 欧美zozozo| 欧美日韩精品一区二区三区四区| 成人在线视频首页| 久久精品99久久久| 一区二区久久久久久| 国产亚洲制服色| 日韩美女主播在线视频一区二区三区| 91亚洲国产成人精品一区二区三| 久久疯狂做爰流白浆xx| 亚洲国产成人高清精品| 最新欧美精品一区二区三区| 精品国产人成亚洲区| 91精品国产综合久久精品app | 激情五月激情综合网| 亚洲成人动漫一区| 欧美一区二区三区四区视频| 国产乱理伦片在线观看夜一区| 午夜电影久久久| 亚洲精品国产无天堂网2021| 国产精品午夜在线观看| 日韩激情中文字幕| 亚洲一区在线视频观看| 亚洲精品自拍动漫在线| 国产精品不卡在线| 国产精品视频一二三| 国产欧美一区二区精品忘忧草 | 精品一区中文字幕| 蜜臀av性久久久久蜜臀aⅴ| 首页国产丝袜综合| 亚洲第一主播视频| 午夜视频在线观看一区二区三区| 一区二区三区在线视频观看58 | 亚洲精品欧美激情| 中文字幕一区二区三区精华液| 中文字幕高清一区| 国产精品免费aⅴ片在线观看| 国产欧美精品一区二区色综合朱莉| 久久色成人在线| 欧美激情中文字幕| 亚洲欧洲三级电影| 亚洲男人的天堂网| 亚洲乱码国产乱码精品精98午夜| 亚洲欧美偷拍卡通变态| 国产精品久久久爽爽爽麻豆色哟哟 | 日韩欧美一级特黄在线播放| 日韩一区二区免费在线观看| 精品国精品自拍自在线| 久久嫩草精品久久久精品| 久久99精品久久只有精品| 久久av中文字幕片| 国产黄色成人av| 99久久精品国产导航| 欧美性大战久久| 91精品婷婷国产综合久久竹菊| 精品久久久久一区二区国产| 国产精品视频一二| 亚洲在线成人精品| 蜜臀a∨国产成人精品| 国产成人免费视频网站| 在线看不卡av| 日韩精品一区二区三区老鸭窝| 国产日韩一级二级三级| 亚洲激情自拍偷拍| 日韩高清不卡一区二区| 国产99久久久国产精品潘金网站| 色综合久久天天| 日韩亚洲欧美成人一区| 中文字幕第一区二区| 亚洲国产日韩一区二区| 激情伊人五月天久久综合| 色诱视频网站一区| 日韩三级中文字幕| 日韩伦理免费电影| 美女国产一区二区三区| eeuss鲁片一区二区三区在线看| 欧美日韩中文国产| 国产婷婷精品av在线| 亚洲444eee在线观看| 国产精品主播直播| 欧美午夜影院一区| 久久九九久久九九| 日日摸夜夜添夜夜添国产精品| 国产成人8x视频一区二区| 在线日韩av片| 国产色产综合色产在线视频 | av网站免费线看精品| 7777精品伊人久久久大香线蕉经典版下载| 国产亚洲制服色| 日韩激情视频在线观看| a4yy欧美一区二区三区| 日韩欧美国产一区二区三区| 亚洲一线二线三线视频| 国产成人精品影院| 欧美成人bangbros| 亚洲电影一区二区| 91亚洲国产成人精品一区二三| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲狠狠爱一区二区三区| 国产成人精品免费| 日韩免费看的电影| 亚洲www啪成人一区二区麻豆| 成人av电影在线观看| 久久久亚洲精华液精华液精华液| 天天av天天翘天天综合网| 色综合亚洲欧洲| 中文字幕一区二区在线观看| 国产精选一区二区三区| 日韩一级精品视频在线观看| 亚洲一区二区三区美女| 99riav一区二区三区| 中文字幕乱码亚洲精品一区| 国产美女av一区二区三区| 欧美白人最猛性xxxxx69交| 日本va欧美va精品发布| 欧美精品亚洲一区二区在线播放| 自拍偷拍国产精品| 91在线观看下载| 国产精品每日更新| 成人免费高清视频在线观看| 成人午夜短视频| 欧美成人精品高清在线播放| 日韩在线a电影| 欧美日韩午夜在线| 婷婷久久综合九色综合绿巨人| 欧美日韩一级大片网址| 亚洲成人在线免费| 4438成人网| 日韩av一级片| 日韩欧美在线综合网| 久久精品99国产国产精| 精品sm捆绑视频| 国产精品一区在线观看你懂的| 久久蜜臀中文字幕| 国产盗摄一区二区| 亚洲国产经典视频| 99久久精品国产毛片| 一区二区在线观看视频| 欧洲亚洲精品在线| 日韩和欧美一区二区| 精品日韩99亚洲| 高清日韩电视剧大全免费| 国产精品国产三级国产普通话蜜臀 | 精品福利在线导航| 99国产欧美久久久精品| 国产精品国产三级国产a| 91免费版在线看| 亚洲综合在线免费观看| 欧美日韩在线播放三区| 青青草国产精品亚洲专区无| 欧美成人综合网站| 成人av一区二区三区| 一区二区三区四区不卡在线| 欧美日韩电影在线| 激情六月婷婷久久| 国产精品免费丝袜| 欧美日韩精品一区二区三区蜜桃| 久久av中文字幕片| 日韩毛片一二三区| 91精品欧美综合在线观看最新| 国产一区二区三区四区五区美女| 国产精品欧美经典| 欧美伊人精品成人久久综合97| 日本强好片久久久久久aaa| 久久久久九九视频| 色菇凉天天综合网| 麻豆精品久久精品色综合| 欧美激情一区二区三区全黄| 日本韩国精品一区二区在线观看| 男男gaygay亚洲| 中文字幕五月欧美| 欧美成人精品福利| 色婷婷国产精品| 久国产精品韩国三级视频| 亚洲少妇中出一区| 日韩免费在线观看| 91激情在线视频| 国产一区日韩二区欧美三区| 亚洲一区二区在线观看视频 | 自拍偷拍亚洲欧美日韩| 日韩精品在线一区二区| 国产精品国产成人国产三级| 激情欧美日韩一区二区| 自拍偷拍亚洲激情| 精品久久久影院| 欧美在线三级电影| 国产一区二区三区电影在线观看 | 色嗨嗨av一区二区三区| 国内成人免费视频| 日本亚洲天堂网| 亚洲精品视频在线观看免费| 久久午夜免费电影| 日韩一区二区影院|