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

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

?? os_time.c

?? 我現在需要看幾個論文。。今年馬上畢業。。急著用
?? 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一区二区三区免费野_久草精品视频
国产精品久久久久一区| 日本不卡视频在线| 久久99精品网久久| 99视频超级精品| 4hu四虎永久在线影院成人| 国产精品视频麻豆| 久久97超碰色| 欧美电影影音先锋| 亚洲精品美国一| 国产成+人+日韩+欧美+亚洲| 欧美一区二区三区四区五区| 国产成人在线色| 欧美精品久久99久久在免费线 | 国产成人精品在线看| 欧美日韩专区在线| 国产精品福利一区| 国产成人在线影院| 久久综合资源网| 蜜桃久久av一区| 91精选在线观看| 亚洲第一福利视频在线| 91蜜桃网址入口| 亚洲视频小说图片| 99久久精品免费看国产免费软件| 久久久久久免费网| 国模无码大尺度一区二区三区 | 色8久久人人97超碰香蕉987| 国产精品久久免费看| 成人精品一区二区三区中文字幕| 国产三级欧美三级| 国产91在线观看丝袜| 国产精品美女久久福利网站| 国产风韵犹存在线视精品| 久久综合狠狠综合久久激情| 精品亚洲成a人| 久久精品无码一区二区三区| 国产精品996| 亚洲国产精品传媒在线观看| www.亚洲精品| 有码一区二区三区| 欧美精品久久一区| 久久电影网站中文字幕| 国产日韩欧美高清| 91女神在线视频| 日本午夜一本久久久综合| 日韩欧美在线不卡| 国产精品一二三四| 自拍偷拍亚洲综合| 欧美日韩激情在线| 久久66热re国产| 久久精品日产第一区二区三区高清版 | 日韩福利电影在线观看| 精品蜜桃在线看| 粗大黑人巨茎大战欧美成人| 一二三四社区欧美黄| 91精品国产乱| 国产精品亚洲成人| 亚洲精品免费一二三区| 欧美一区二区三区电影| 国产99久久久久| 亚洲一区二区三区四区在线观看| 欧美一级夜夜爽| a美女胸又www黄视频久久| 亚洲午夜久久久久久久久电影院| 日韩视频中午一区| 99久久久无码国产精品| 日韩不卡一区二区| 亚洲欧洲韩国日本视频| 欧美一区二区三区白人| av在线一区二区三区| 人禽交欧美网站| 亚洲欧美综合色| 欧美变态tickling挠脚心| 色婷婷综合激情| 狠狠狠色丁香婷婷综合激情| 亚洲一二三级电影| 国产精品国产三级国产a| 日韩亚洲欧美中文三级| 91在线精品一区二区| 美女www一区二区| 一区二区三区**美女毛片| 久久奇米777| 91在线无精精品入口| 精品一区在线看| 亚洲第一狼人社区| 亚洲精品日韩一| 国产精品久久久久久久久久免费看 | 亚洲国产日产av| 国产精品久线在线观看| 精品电影一区二区| 69久久99精品久久久久婷婷| 91免费看视频| 成人精品视频.| 国产乱色国产精品免费视频| 日韩av午夜在线观看| 亚洲曰韩产成在线| 亚洲欧美激情一区二区| 中文字幕 久热精品 视频在线 | 欧美一区三区二区| 欧洲亚洲国产日韩| 色婷婷av一区二区三区软件| 成人福利在线看| 成人性生交大合| 粉嫩绯色av一区二区在线观看| 免费久久99精品国产| 日本系列欧美系列| 日本不卡一二三| 久久精品国产免费看久久精品| 日韩高清在线观看| 男女性色大片免费观看一区二区| 日韩在线一区二区三区| 日韩 欧美一区二区三区| 日韩avvvv在线播放| 男女男精品视频| 久草这里只有精品视频| 卡一卡二国产精品| 国产最新精品免费| 国产综合久久久久久久久久久久| 国内精品免费**视频| 国产精品一区久久久久| 国产一区二区在线视频| 国产高清视频一区| 色综合视频一区二区三区高清| 菠萝蜜视频在线观看一区| 91一区二区在线观看| 色综合久久88色综合天天6| 在线观看国产一区二区| 7777精品伊人久久久大香线蕉 | 成人黄页在线观看| 99精品视频一区| 欧美日韩亚洲综合在线 | 欧美日韩亚洲综合一区二区三区| 在线91免费看| 久久午夜免费电影| 亚洲日本成人在线观看| 亚洲在线观看免费| 韩国成人在线视频| 99精品欧美一区二区三区综合在线| 日本韩国一区二区| 日韩视频在线你懂得| 中日韩免费视频中文字幕| 亚洲精品视频免费看| 免费高清在线一区| 99精品国产热久久91蜜凸| 欧美三级日韩在线| 久久久久久久久久美女| 一区二区三区日韩精品视频| 美女一区二区视频| 欧美日韩一区不卡| 日韩三级高清在线| 亚洲视频狠狠干| 麻豆精品在线观看| 91香蕉视频黄| 亚洲精品一区二区三区蜜桃下载 | 国产91精品一区二区麻豆网站 | 久久综合色8888| 1024国产精品| 美女久久久精品| 色狠狠色狠狠综合| 久久日韩粉嫩一区二区三区 | 国产精品久久久一本精品| 一区二区三区在线视频观看| 精品一区二区三区在线观看国产 | 麻豆精品一区二区三区| 91麻豆免费看片| 久久午夜电影网| 蜜桃久久久久久| 欧美精品一二三| 亚洲美女偷拍久久| 国产99久久久国产精品潘金网站| 欧美一区二区三区电影| 一区二区三区影院| 北条麻妃一区二区三区| 精品国产麻豆免费人成网站| 图片区小说区国产精品视频| 色婷婷亚洲一区二区三区| 久久久国产午夜精品| 蜜臀a∨国产成人精品| 欧美午夜不卡在线观看免费| 国产精品盗摄一区二区三区| 国精产品一区一区三区mba视频| 91精品国产福利在线观看| 亚洲香蕉伊在人在线观| 99re这里只有精品首页| 日本一区二区三区国色天香| 久久99在线观看| 欧美福利一区二区| 亚洲你懂的在线视频| 99久久精品99国产精品| 国产女人aaa级久久久级| 九色综合国产一区二区三区| 日韩欧美一级二级| 久草热8精品视频在线观看| 欧美一区二区私人影院日本| 视频一区视频二区中文| 欧美影院一区二区三区| 亚洲线精品一区二区三区八戒| 欧美午夜视频网站| 图片区日韩欧美亚洲| 欧美一二三四在线|