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

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

?? os_time.c

?? uc/os原代碼
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2005, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.80
*********************************************************************************************************
*/

#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 (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_NO_ERR
*              OS_TIME_INVALID_MINUTES
*              OS_TIME_INVALID_SECONDS
*              OS_TIME_INVALID_MS
*              OS_TIME_ZERO_DLY
*
* 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 milli)
{
    INT32U ticks;
    INT16U loops;


#if OS_ARG_CHK_EN > 0
    if (hours == 0) {
        if (minutes == 0) {
            if (seconds == 0) {
                if (milli == 0) {
                    return (OS_TIME_ZERO_DLY);
                }
            }
        }
    }
    if (minutes > 59) {
        return (OS_TIME_INVALID_MINUTES);        /* Validate arguments to be within range              */
    }
    if (seconds > 59) {
        return (OS_TIME_INVALID_SECONDS);
    }
    if (milli > 999) {
        return (OS_TIME_INVALID_MILLI);
    }
#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)milli + 500L / OS_TICKS_PER_SEC) / 1000L;
    loops = (INT16U)(ticks / 65536L);            /* Compute the integral number of 65536 tick delays   */
    ticks = ticks % 65536L;                      /* Obtain  the fractional number of ticks             */
    OSTimeDly((INT16U)ticks);
    while (loops > 0) {
        OSTimeDly((INT16U)32768u);
        OSTimeDly((INT16U)32768u);
        loops--;
    }
    return (OS_NO_ERR);
}
#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_NO_ERR                 Task has been resumed
*              OS_PRIO_INVALID           if the priority you specify is higher that the maximum allowed
*                                        (i.e. >= OS_LOWEST_PRIO)
*              OS_TIME_NOT_DLY           Task is not waiting for time to expire
*              OS_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_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = OSTCBPrioTbl[prio];                                 /* Make sure that task exist            */
    if (ptcb == (OS_TCB *)0) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                            /* The task does not exist              */
    }
    if (ptcb == (OS_TCB *)1) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                            /* The task does not exist              */
    }
    if (ptcb->OSTCBDly == 0) {                                 /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_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->OSTCBPendTO  = TRUE;                             /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBPendTO  = FALSE;
    }
    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_NO_ERR);
}
#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一区二区三区免费野_久草精品视频
8x福利精品第一导航| 国内精品国产三级国产a久久| 免费观看30秒视频久久| 欧美日韩黄视频| 日韩精品电影在线观看| 欧美精品丝袜中出| 午夜精品福利一区二区蜜股av| 色综合久久99| 日韩激情视频在线观看| 欧美一级欧美一级在线播放| 日韩高清国产一区在线| 5月丁香婷婷综合| 蜜臀av在线播放一区二区三区| 欧美一区二区三区色| 国内精品久久久久影院一蜜桃| 国产欧美一二三区| 色婷婷av一区二区三区软件| 亚洲成人动漫av| 国产欧美日韩麻豆91| 91亚洲永久精品| 免费一区二区视频| 综合久久国产九一剧情麻豆| 精品日产卡一卡二卡麻豆| 亚洲免费色视频| 色偷偷88欧美精品久久久| 国产一区二区免费视频| 国产电影一区在线| 午夜在线电影亚洲一区| 欧美一区二区啪啪| 国产iv一区二区三区| 午夜精品久久久久久久久久久| 8x福利精品第一导航| 欧美午夜精品一区| 日本成人在线视频网站| 欧美激情艳妇裸体舞| 欧美性三三影院| 久久久精品tv| 欧美刺激午夜性久久久久久久 | 国产乱理伦片在线观看夜一区| 人妖欧美一区二区| 午夜精品在线看| 亚洲一区视频在线| 一区二区不卡在线播放| 一区二区三区自拍| 亚洲色图.com| 亚洲卡通动漫在线| 亚洲精品乱码久久久久久日本蜜臀| 国产亚洲人成网站| 国产午夜精品久久久久久久| 国产亚洲1区2区3区| 中文字幕一区在线观看视频| 国产日本亚洲高清| 成人av在线网站| 欧美一级黄色录像| 亚洲成人福利片| 在线视频综合导航| 2017欧美狠狠色| 一区二区三区四区蜜桃| 日韩av成人高清| 国产91高潮流白浆在线麻豆| 成人手机电影网| 91精品午夜视频| 日韩欧美高清在线| **性色生活片久久毛片| 精品一区精品二区高清| 久久99国产精品久久| 成人成人成人在线视频| 欧美少妇一区二区| 日本一区二区不卡视频| 最好看的中文字幕久久| 亚洲网友自拍偷拍| 成人高清视频在线观看| 欧美久久免费观看| 亚洲黄色录像片| 国产剧情一区二区三区| 欧美色图天堂网| 日韩视频一区二区三区在线播放| 国产欧美一区二区三区在线看蜜臀 | 岛国精品在线观看| 日韩欧美国产小视频| 亚洲激情自拍视频| 国产 日韩 欧美大片| 日韩欧美久久一区| 午夜精品福利久久久| 欧美精品tushy高清| 亚洲国产你懂的| 337p亚洲精品色噜噜| 日日骚欧美日韩| 精品电影一区二区三区| 亚洲成人你懂的| 91美女在线看| 亚洲国产成人在线| 黄页网站大全一区二区| 欧美精品乱人伦久久久久久| 最新热久久免费视频| 成人一区二区视频| 久久久久久久精| 国产成人av一区二区| 国产精品―色哟哟| 91免费视频大全| 亚洲综合精品自拍| 久久尤物电影视频在线观看| 久久精品久久99精品久久| 欧美xxxxxxxx| 91免费观看在线| 亚洲午夜精品一区二区三区他趣| 日本丶国产丶欧美色综合| 五月天中文字幕一区二区| 8v天堂国产在线一区二区| 蜜臀久久久99精品久久久久久| 精品国产伦理网| 99在线视频精品| 琪琪一区二区三区| 久久精品亚洲乱码伦伦中文 | 九九在线精品视频| 综合激情成人伊人| 日韩欧美一区中文| 91丨porny丨在线| 韩国v欧美v日本v亚洲v| 亚洲柠檬福利资源导航| 精品欧美乱码久久久久久| 色偷偷88欧美精品久久久| 国产一区二区三区美女| 亚洲1区2区3区视频| 中文无字幕一区二区三区 | 日韩一区中文字幕| 久久久久综合网| 欧美一区二区三区系列电影| 91在线你懂得| 成人污视频在线观看| 久久99精品久久久久久国产越南 | 99国内精品久久| 国产成人免费高清| 精品在线播放免费| 蜜臀精品久久久久久蜜臀| 亚洲电影第三页| 一区二区三区四区不卡视频| 日本一区二区成人| 中文字幕免费在线观看视频一区| 日韩欧美一卡二卡| 精品久久人人做人人爽| 欧美一区二区免费观在线| 51精品国自产在线| 日韩欧美高清dvd碟片| 精品国产乱码久久久久久1区2区 | 成人av电影免费在线播放| 激情综合网激情| 国产精品一色哟哟哟| 国产91精品精华液一区二区三区| 国产精品白丝av| 婷婷综合在线观看| 秋霞影院一区二区| 蜜桃一区二区三区在线| 国产一区二区三区黄视频| 粉嫩aⅴ一区二区三区四区| 波多野结衣中文字幕一区 | 在线观看日韩高清av| 欧美情侣在线播放| 日韩欧美精品三级| 亚洲色图视频网| 美腿丝袜一区二区三区| 不卡av免费在线观看| 欧美日韩一区二区三区视频| 精品国偷自产国产一区| 亚洲欧洲日韩av| 婷婷一区二区三区| 国产精品一区免费在线观看| 在线这里只有精品| 国产欧美一区二区三区鸳鸯浴| 亚洲综合精品久久| 国产美女av一区二区三区| 欧美色视频一区| 国产精品电影一区二区三区| 免费观看一级欧美片| 在线观看视频一区二区| 国产欧美日韩不卡免费| 另类小说欧美激情| 欧美日韩色综合| 亚洲最新视频在线观看| 国产成人午夜精品5599| 欧美电影一区二区| 亚洲福利视频一区| 欧美性大战久久久久久久蜜臀| 久久精品夜色噜噜亚洲aⅴ| 激情偷乱视频一区二区三区| 91.麻豆视频| 蜜桃视频在线一区| 91精品婷婷国产综合久久竹菊| 一区二区三区四区激情| 一本到三区不卡视频| 一区二区三区高清| 欧美视频三区在线播放| 亚洲摸摸操操av| 欧美熟乱第一页| 丝袜美腿亚洲一区二区图片| 欧美日韩小视频| 免费高清在线一区| 国产亚洲欧美日韩日本| 成人国产精品免费观看| 亚洲欧美在线视频|