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

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

?? os_time.c

?? uCOSII V2.80 FOR arm IAR4.10 編譯器
?? 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一区二区三区免费野_久草精品视频
亚洲天堂成人网| 久久久久国产一区二区三区四区| 国产精品对白交换视频| 成人黄动漫网站免费app| 亚洲欧美综合色| 日本黄色一区二区| 天堂精品中文字幕在线| 欧美电影免费观看高清完整版 | 日韩免费看的电影| 国产一区免费电影| 中文字幕中文字幕中文字幕亚洲无线 | 91精品国产欧美一区二区成人| 美女www一区二区| 久久亚洲精华国产精华液| 99视频热这里只有精品免费| 亚洲成a天堂v人片| 精品福利一区二区三区| 成人国产精品免费观看视频| 一区二区成人在线视频| 欧美一区二区三级| 高清成人免费视频| 夜夜嗨av一区二区三区四季av| 欧美乱妇15p| 国产成人av影院| 一区二区成人在线观看| 日韩美女视频在线| 99r国产精品| 美洲天堂一区二卡三卡四卡视频 | 美国一区二区三区在线播放| 中文欧美字幕免费| 欧美精品欧美精品系列| 粉嫩在线一区二区三区视频| 亚瑟在线精品视频| 国产精品人妖ts系列视频| 欧美精品在线视频| 成人黄色免费短视频| 免费的成人av| 亚洲精品欧美综合四区| 久久综合九色欧美综合狠狠| 欧美在线高清视频| 国产精品66部| 日韩黄色片在线观看| 中文字幕一区二区三区在线观看| 欧美理论电影在线| 97久久超碰精品国产| 久久精品国产一区二区三区免费看| 亚洲图片激情小说| 久久久777精品电影网影网| 欧美日韩久久一区| av一区二区不卡| 激情综合一区二区三区| 无吗不卡中文字幕| 亚洲视频精选在线| 欧美国产精品v| 日韩欧美电影一区| 欧美性xxxxxxxx| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 欧美日韩一区二区在线观看| 成人久久视频在线观看| 激情小说欧美图片| 免费黄网站欧美| 日本中文字幕一区| 亚洲成人激情av| 亚洲综合成人在线| 亚洲愉拍自拍另类高清精品| 国产精品国产三级国产aⅴ入口 | 国产精品热久久久久夜色精品三区| 欧美va天堂va视频va在线| 91精品国产综合久久福利软件| 欧美日韩午夜精品| 色婷婷综合在线| 色综合色综合色综合色综合色综合| 国产成人超碰人人澡人人澡| 韩国v欧美v日本v亚洲v| 久久99精品国产| 久久精品国产亚洲高清剧情介绍 | 中文字幕高清一区| 国产精品久久久久久久第一福利| 国产视频一区不卡| 日本一区二区三区电影| 中文字幕乱码久久午夜不卡| 国产日韩欧美电影| 欧美国产成人精品| 国产精品传媒入口麻豆| 亚洲人成小说网站色在线| 国产精品久久久久久一区二区三区| 国产精品萝li| 亚洲精品大片www| 亚洲国产一区在线观看| 日韩av电影免费观看高清完整版在线观看 | 欧美日韩免费电影| 91精品国产一区二区三区| 欧美成人a在线| 国产性天天综合网| 国产精品卡一卡二卡三| 亚洲人成影院在线观看| 亚洲电影在线免费观看| 美女一区二区三区在线观看| 国产一区 二区| 波多野洁衣一区| 欧美在线一二三四区| 欧美精品第一页| 久久亚洲欧美国产精品乐播 | 亚洲综合色成人| 老色鬼精品视频在线观看播放| 国产精品综合二区| 97久久精品人人爽人人爽蜜臀 | av一区二区三区四区| 欧美天堂一区二区三区| 日韩免费看网站| 自拍偷拍国产亚洲| 日韩高清欧美激情| 成人自拍视频在线观看| 欧美色手机在线观看| 精品国产99国产精品| 国产精品久久毛片av大全日韩| 亚洲综合视频在线观看| 国产麻豆精品在线观看| 99久久国产免费看| 91麻豆精品国产综合久久久久久| 久久日韩粉嫩一区二区三区 | 三级久久三级久久久| 国产经典欧美精品| 欧美日本一区二区| 中文av一区特黄| 秋霞电影网一区二区| 97久久精品人人澡人人爽| 欧美电影免费观看高清完整版| 成人免费一区二区三区视频| 美女视频一区二区| 色老头久久综合| 国产精品久久毛片a| 久久国产尿小便嘘嘘尿| 一本久久综合亚洲鲁鲁五月天| 亚洲精品一区二区三区福利| 亚洲夂夂婷婷色拍ww47| 成人性生交大片免费看在线播放| 7777精品伊人久久久大香线蕉的| 国产精品三级视频| 黄色资源网久久资源365| 欧美视频第二页| 综合电影一区二区三区| 国产成人在线视频网址| 欧美日韩精品一二三区| 亚洲靠逼com| 国产99精品视频| 欧美一级免费大片| 亚洲福利视频导航| 91色在线porny| 国产亚洲欧美在线| 加勒比av一区二区| 欧美一区二区三级| 日韩成人dvd| 欧美日韩精品免费观看视频| 综合精品久久久| 成人aa视频在线观看| 久久一二三国产| 美腿丝袜亚洲色图| 在线综合亚洲欧美在线视频| 香蕉av福利精品导航| 在线免费不卡电影| 亚洲欧美另类小说视频| 成人激情av网| 国产精品麻豆一区二区| 成人黄色在线网站| 国产精品久久久久影院亚瑟 | 亚洲精品国产第一综合99久久 | 午夜私人影院久久久久| 91福利在线导航| 亚洲精选在线视频| 色婷婷久久一区二区三区麻豆| 一区免费观看视频| 色悠久久久久综合欧美99| 一区二区三区四区av| 在线精品亚洲一区二区不卡| 亚洲综合色网站| 777奇米成人网| 日本不卡123| 久久中文娱乐网| 成人一二三区视频| 国产精品灌醉下药二区| 色中色一区二区| 亚洲第四色夜色| 日韩一区二区麻豆国产| 久久av中文字幕片| 国产日韩欧美麻豆| 91网站最新地址| 亚洲成人免费在线| 精品国产精品一区二区夜夜嗨| 国产在线国偷精品免费看| 中文天堂在线一区| 欧美日韩亚洲综合| 久久er99精品| 亚洲私人影院在线观看| 欧美午夜一区二区| 国产一区二区在线视频| 亚洲人成伊人成综合网小说| 欧美精品免费视频| 国产不卡视频在线播放| 亚洲免费三区一区二区|