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

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

?? os_time.c

?? 一個著名的嵌入式實時操作系統源代碼UCOS-
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2003, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.76
*********************************************************************************************************
*/

#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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#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;



    cpu_sr = 0;                                                /* Prevent compiler warning             */
#endif    
    if (prio >= OS_LOWEST_PRIO) {
        return (OS_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = (OS_TCB *)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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产很黄免费观看久久| 欧美性色黄大片手机版| 丁香婷婷综合激情五月色| 成人av在线看| 日韩美女天天操| 一区二区不卡在线视频 午夜欧美不卡在| 午夜精品免费在线观看| 国产成人在线视频播放| 91精品久久久久久久99蜜桃| 国产精品丝袜一区| 麻豆精品一二三| 色94色欧美sute亚洲13| 国产校园另类小说区| 日本美女视频一区二区| 色综合婷婷久久| 国产亚洲欧洲997久久综合| 丝瓜av网站精品一区二区| 色婷婷av一区二区三区之一色屋| 久久综合九色综合欧美就去吻 | 一区二区三区日本| 国产黑丝在线一区二区三区| 国产精品人妖ts系列视频| 美女视频黄 久久| 欧美日韩中文字幕一区二区| 国产精品剧情在线亚洲| 国产精品综合二区| 久久久亚洲高清| 久久精品国内一区二区三区| 欧美一级黄色大片| 奇米精品一区二区三区四区 | 奇米精品一区二区三区在线观看| 精品88久久久久88久久久| 伊人夜夜躁av伊人久久| 99国产精品久久久| 中文字幕亚洲区| 成人av免费在线| 国产精品视频第一区| 成人99免费视频| 一色桃子久久精品亚洲| 99视频在线精品| 亚洲女爱视频在线| 欧美中文字幕一区二区三区| 亚洲五码中文字幕| 欧美三级在线看| 日本午夜一本久久久综合| 亚洲三级电影网站| 色婷婷综合久久久久中文一区二区 | 欧美三日本三级三级在线播放| 一二三区精品视频| 国产精品一级黄| 日本不卡在线视频| 欧美日韩在线播放三区四区| 亚洲国产综合在线| 69p69国产精品| 久久成人免费网| 中文字幕欧美国产| 成人精品高清在线| 亚洲一区二区精品视频| 717成人午夜免费福利电影| 久久精品理论片| 国产精品高潮久久久久无| 91看片淫黄大片一级在线观看| 亚洲第一电影网| 日韩欧美一区中文| 99国产精品99久久久久久| 亚洲午夜视频在线观看| 欧美va天堂va视频va在线| 粉嫩av亚洲一区二区图片| 中文字幕亚洲精品在线观看| 91精品一区二区三区在线观看| 国产一区二区三区综合| 国产精品自在欧美一区| 中文字幕中文乱码欧美一区二区| 欧美色涩在线第一页| 国产精品一区二区三区99| 亚洲欧美日韩成人高清在线一区| 欧美老女人在线| 成人三级在线视频| 午夜欧美一区二区三区在线播放| 久久色在线视频| 欧美日韩视频一区二区| 成人做爰69片免费看网站| 午夜av一区二区| 日本一区二区三级电影在线观看| 欧美日韩不卡一区| 成人性生交大片免费看在线播放| 日韩精品亚洲一区| 亚洲品质自拍视频| 国产亚洲精品超碰| 日韩精品中文字幕在线不卡尤物| 色综合色综合色综合| 国产激情视频一区二区在线观看 | 激情欧美一区二区三区在线观看| 国产精品狼人久久影院观看方式| 日韩情涩欧美日韩视频| 欧美日韩国产一二三| 成年人国产精品| 国产精品一级二级三级| 男女男精品视频| 亚洲一区av在线| 亚洲精品日韩专区silk| 国产精品免费久久久久| 久久这里只有精品首页| 欧美一区二区三区视频免费 | 在线观看亚洲a| 不卡的av网站| 高清国产一区二区三区| 韩国欧美一区二区| 激情都市一区二区| 美女视频黄 久久| 青青草伊人久久| 首页综合国产亚洲丝袜| 性久久久久久久久久久久| 亚洲综合色婷婷| 亚洲精品高清视频在线观看| 亚洲视频一区在线观看| 亚洲欧洲无码一区二区三区| 国产精品网曝门| 国产精品久久久久影视| 成人欧美一区二区三区| 国产精品美女久久久久aⅴ国产馆| 国产网站一区二区| 久久久精品中文字幕麻豆发布| 亚洲精品一线二线三线无人区| 欧美不卡一区二区三区| 26uuu另类欧美亚洲曰本| 久久免费美女视频| 国产精品区一区二区三区| 中文字幕欧美区| 亚洲精品一二三四区| 亚洲电影一区二区| 日韩成人一级片| 国内精品在线播放| 成人免费看黄yyy456| 91麻豆国产自产在线观看| 欧美性高清videossexo| 在线综合+亚洲+欧美中文字幕| 日韩精品一区二区三区三区免费 | 男人操女人的视频在线观看欧美 | 欧美日韩成人在线一区| 欧美一级日韩一级| 337p粉嫩大胆噜噜噜噜噜91av| 国产精品三级av| 亚洲高清免费观看| 国内外成人在线| 91视频一区二区三区| 欧美日韩aaa| 欧美激情在线看| 一区二区久久久久久| 久久黄色级2电影| jlzzjlzz亚洲女人18| 欧美剧情电影在线观看完整版免费励志电影| 91麻豆精品91久久久久久清纯 | 美国十次了思思久久精品导航| 国产麻豆精品视频| 在线观看国产日韩| 欧美成va人片在线观看| 亚洲欧美激情小说另类| 美美哒免费高清在线观看视频一区二区| 国产精品一区二区在线观看不卡 | 国产精品成人免费在线| 亚洲h精品动漫在线观看| 狠狠色2019综合网| 色偷偷成人一区二区三区91| 欧美成人猛片aaaaaaa| 亚洲精品高清视频在线观看| 狠狠色伊人亚洲综合成人| 日韩欧美亚洲国产另类 | 成人永久免费视频| 欧美视频自拍偷拍| 国产精品视频线看| 日本怡春院一区二区| 色噜噜狠狠成人中文综合| 精品对白一区国产伦| 亚洲成av人综合在线观看| 国产91精品一区二区麻豆网站| 在线观看91av| 亚洲日本免费电影| 成人午夜私人影院| 久久综合狠狠综合久久综合88 | 99久久伊人精品| 久久你懂得1024| 麻豆专区一区二区三区四区五区| 在线观看精品一区| 国产精品乱码一区二三区小蝌蚪| 久久99精品视频| 9191国产精品| 亚洲国产一区二区视频| 色综合久久精品| 中文字幕日韩欧美一区二区三区| 黄页视频在线91| 日韩午夜激情av| 奇米精品一区二区三区四区| 在线成人免费视频| 亚洲sss视频在线视频| 欧洲中文字幕精品| 亚洲综合另类小说| 在线这里只有精品| 一区二区高清免费观看影视大全| 91最新地址在线播放|