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

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

?? os_time.c

?? 這是一個(gè)UCOS程序
?? C
字號(hào):
/*
*********************************************************************************************************
*                                                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    

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女精品自拍一二三四| 欧美少妇一区二区| 亚洲精品免费电影| 欧美视频在线播放| 青青青伊人色综合久久| 久久综合一区二区| 99久久99久久久精品齐齐 | 中文字幕中文字幕一区二区 | 99久久免费国产| 亚洲影视在线播放| 日韩美女视频在线| 高清视频一区二区| 一区二区日韩电影| 日韩精品一区二| 丁香六月综合激情| 亚洲电影一区二区| 26uuu国产电影一区二区| 99国产欧美另类久久久精品| 亚洲成人一区在线| 久久噜噜亚洲综合| 色天天综合久久久久综合片| 奇米色一区二区| 国产精品盗摄一区二区三区| 欧美精品久久久久久久久老牛影院| 久久国产精品第一页| 国产精品久久久久一区| 欧美日韩视频不卡| 国产精品99久久久久久久女警| 亚洲激情中文1区| 日韩精品一区二区三区老鸭窝| eeuss鲁一区二区三区| 午夜精品国产更新| 中文字幕乱码亚洲精品一区| 欧美视频第二页| 国产成人免费9x9x人网站视频| 亚洲国产一区二区三区 | 洋洋成人永久网站入口| 精品奇米国产一区二区三区| 97国产精品videossex| 免费成人美女在线观看| 亚洲人成在线播放网站岛国| 日韩视频一区二区三区在线播放| 不卡的电影网站| 麻豆精品新av中文字幕| 亚洲视频资源在线| 奇米色777欧美一区二区| 国产精品国产自产拍高清av王其 | 日本午夜精品视频在线观看| 国产精品高潮久久久久无| 欧美高清精品3d| 99久久精品久久久久久清纯| 久久se精品一区二区| 亚洲一区二区四区蜜桃| 国产精品天天看| 日韩精品一区二区三区视频播放| 在线观看视频91| 成人免费av在线| 欧美一级日韩一级| av影院午夜一区| 久久国产精品无码网站| 亚洲成人一区在线| 亚洲图片激情小说| 久久久99精品免费观看| 日韩亚洲欧美高清| 欧美系列在线观看| av亚洲精华国产精华精华| 国产自产2019最新不卡| 日韩电影在线一区| 一区二区三区久久久| 国产精品国产精品国产专区不蜜| 欧美精品一区二区三区蜜桃| 欧美夫妻性生活| 欧美伊人久久久久久久久影院| 99久久精品免费看国产免费软件| 国产精品原创巨作av| 老司机精品视频一区二区三区| 香蕉成人啪国产精品视频综合网| 自拍偷拍欧美精品| 国产精品视频一二三区| 久久久久久久久久久电影| 欧美本精品男人aⅴ天堂| 91精品国产手机| 欧美美女bb生活片| 欧美综合久久久| 色综合天天综合网国产成人综合天| 国产精品1区二区.| 免费视频一区二区| 丝袜亚洲另类欧美综合| 香蕉久久一区二区不卡无毒影院 | 欧美另类久久久品| 在线国产电影不卡| 欧洲激情一区二区| 色狠狠色狠狠综合| 色天使久久综合网天天| 色哟哟欧美精品| 一本大道久久a久久综合| 99re热这里只有精品视频| 成人美女视频在线看| 成人aa视频在线观看| 成人av在线看| 93久久精品日日躁夜夜躁欧美| 不卡影院免费观看| 99精品视频一区| 91偷拍与自偷拍精品| 91视频www| 欧美在线制服丝袜| 欧美体内she精视频| 欧美日韩国产欧美日美国产精品| 欧美视频中文字幕| 欧美日本韩国一区| 欧美久久久影院| 日韩欧美123| 久久久不卡影院| 中文字幕一区二区三区四区不卡| 国产精品乱人伦| 亚洲精品乱码久久久久久黑人| 一区二区三区av电影| 香蕉加勒比综合久久| 老司机精品视频一区二区三区| 精品一区免费av| 国产成人自拍网| 91年精品国产| 欧美曰成人黄网| 8x福利精品第一导航| 日韩欧美第一区| 国产欧美精品一区二区色综合朱莉| 国产精品嫩草99a| 一区二区三区国产精品| 视频一区在线视频| 国产一区二区三区四| 成人网在线播放| 在线亚洲人成电影网站色www| 欧美日韩国产综合久久 | 亚洲精品videosex极品| 午夜精品123| 激情综合五月天| 99视频在线精品| 欧美日韩一二三| 欧美xxxxxxxx| 国产精品久久久久7777按摩| 亚洲国产欧美日韩另类综合| 日本伊人精品一区二区三区观看方式| 激情国产一区二区| 成人av免费在线观看| 欧美日韩亚洲综合在线| 精品国产伦一区二区三区观看体验| 欧美国产丝袜视频| 亚洲综合成人在线视频| 久久国产日韩欧美精品| 成人a免费在线看| 欧美酷刑日本凌虐凌虐| 国产亚洲精久久久久久| 夜夜精品浪潮av一区二区三区| 麻豆精品久久精品色综合| 成人精品亚洲人成在线| 欧美日韩综合在线| 国产日韩一级二级三级| 亚洲综合在线第一页| 国产美女精品人人做人人爽 | 一本一本大道香蕉久在线精品| 91精品久久久久久蜜臀| 国产精品久久久久影院老司| 天涯成人国产亚洲精品一区av| 国产aⅴ精品一区二区三区色成熟| 欧美三级三级三级爽爽爽| 久久综合狠狠综合| 亚洲愉拍自拍另类高清精品| 国产精品一二三四区| 欧美日韩在线播放一区| 国产亚洲欧美一区在线观看| 香蕉成人伊视频在线观看| 成人一区二区三区| 欧美精品日日鲁夜夜添| 国产精品视频免费| 日产国产欧美视频一区精品 | 精品久久久久久最新网址| 亚洲黄色片在线观看| 国产一区二区不卡老阿姨| 欧美日韩在线三区| 国产精品不卡一区二区三区| 精品一二三四区| 欧美私模裸体表演在线观看| 国产欧美精品区一区二区三区| 天使萌一区二区三区免费观看| 91视频一区二区三区| 久久婷婷一区二区三区| 日韩av中文在线观看| 色综合久久天天| 欧美国产丝袜视频| 精品一区二区三区日韩| 欧美人妇做爰xxxⅹ性高电影| 国产精品美女久久久久高潮| 麻豆成人综合网| 欧美精品自拍偷拍| 亚洲视频电影在线| 成人污视频在线观看| 亚洲精品一区二区精华| 午夜伊人狠狠久久| 在线精品视频一区二区三四| 国产精品乱人伦|