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

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

?? os_time.c

?? ARM7開發全部源代碼經典.rar
?? 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一区二区三区免费野_久草精品视频
日韩精品一二三四| 亚洲欧美日韩精品久久久久| 欧美变态凌虐bdsm| 精品久久人人做人人爱| 亚洲精品一区二区在线观看| 欧美一区二区视频在线观看2022| 91免费国产视频网站| 99免费精品在线观看| 国产成人8x视频一区二区| 国产很黄免费观看久久| 国产高清在线观看免费不卡| 成人国产精品免费网站| 99精品视频中文字幕| va亚洲va日韩不卡在线观看| 91精彩视频在线| 欧美日本一区二区在线观看| 精品久久久久久久久久久久包黑料| 欧美精品一区二区久久久| 日本一区二区三区高清不卡| 亚洲素人一区二区| 亚洲一区二区三区自拍| 美女网站色91| 国产乱码一区二区三区| 成人app下载| 91精品国产综合久久福利软件| 日韩欧美国产三级| 一区二区免费在线| 成人一区二区三区在线观看| av亚洲精华国产精华| 91精品中文字幕一区二区三区| 精品国产免费久久| 天天做天天摸天天爽国产一区| 男人的天堂亚洲一区| 丁香天五香天堂综合| 8x福利精品第一导航| 国产精品你懂的在线欣赏| 美女精品一区二区| 91精品国产高清一区二区三区蜜臀 | 99久久精品一区| 日韩午夜精品电影| 婷婷国产v国产偷v亚洲高清| 91免费观看国产| 国产精品少妇自拍| 国产一区二区在线观看视频| 欧美日韩在线不卡| 一区二区三区.www| 这里只有精品99re| 天堂在线亚洲视频| 日韩一区二区视频| 精品一区二区三区影院在线午夜 | 午夜精品视频在线观看| 91麻豆国产福利在线观看| 国产欧美视频一区二区| av男人天堂一区| 亚洲欧美中日韩| 欧美午夜精品免费| 亚洲成人tv网| 欧美精品1区2区3区| 日本一区二区三级电影在线观看| 精东粉嫩av免费一区二区三区| 欧美大胆人体bbbb| 欧美日韩高清不卡| 免费成人在线影院| 亚洲美女偷拍久久| 欧美一级欧美三级在线观看| 国产一区在线视频| 亚洲六月丁香色婷婷综合久久| 色狠狠一区二区三区香蕉| 日韩制服丝袜av| 亚洲欧美日韩中文字幕一区二区三区| 欧美午夜一区二区| www.日韩大片| 美美哒免费高清在线观看视频一区二区 | 琪琪久久久久日韩精品| 欧美一区二区三区免费| 国产激情视频一区二区在线观看| 中文字幕一区二区三区色视频| 欧美日韩免费视频| av中文字幕不卡| 国产一区在线不卡| 国产麻豆91精品| 成人黄色片在线观看| 免费成人结看片| 丰满白嫩尤物一区二区| 日韩精品免费专区| 亚洲婷婷综合久久一本伊一区 | 国产精品午夜在线观看| 欧美精品一区二区三区很污很色的| 欧美一级一区二区| 欧美一级免费大片| 日韩精品一区二区三区蜜臀| 9191成人精品久久| 4hu四虎永久在线影院成人| 欧美日韩在线三区| 欧美日韩一区二区三区四区| 欧美乱妇20p| 久久精品夜色噜噜亚洲a∨| 国产欧美日韩在线看| 欧美韩国一区二区| 亚洲一区二区视频| 日本不卡不码高清免费观看| 美腿丝袜在线亚洲一区 | 国产v综合v亚洲欧| 成人av网站在线观看免费| 中文字幕亚洲精品在线观看 | 久久久久久毛片| 精品少妇一区二区| 日韩精品在线一区| 精品女同一区二区| 中文乱码免费一区二区| 亚洲第一会所有码转帖| 国产丶欧美丶日本不卡视频| 高清日韩电视剧大全免费| 在线观看国产一区二区| 制服.丝袜.亚洲.另类.中文| 日韩免费电影网站| 亚洲综合无码一区二区| 麻豆91在线看| 视频在线观看一区二区三区| 国产精品久久毛片av大全日韩| 国产日韩精品一区二区三区| 亚洲女与黑人做爰| 99国产精品一区| 国产午夜亚洲精品理论片色戒| 一区二区三区久久久| 成人毛片老司机大片| 91精品在线观看入口| 亚洲欧美国产毛片在线| 成人激情免费视频| 日韩精品综合一本久道在线视频| 亚洲曰韩产成在线| 一本在线高清不卡dvd| 久久久99久久精品欧美| 奇米一区二区三区av| 91极品视觉盛宴| 国产午夜精品一区二区三区四区| 日本成人在线电影网| 99久久精品国产观看| 久久久亚洲精品一区二区三区| 亚洲大片精品永久免费| 欧美一区二区网站| 国产精品538一区二区在线| 国产亚洲婷婷免费| www.亚洲色图| 亚洲国产一区视频| 777久久久精品| 成人性色生活片免费看爆迷你毛片| 国产三级欧美三级日产三级99| 国产成人精品三级麻豆| 国产欧美视频一区二区| aaa欧美色吧激情视频| 午夜免费欧美电影| 国产欧美日韩综合| 日本久久精品电影| 一区二区三国产精华液| 欧美一区二区三区四区久久| 久久99久久精品| 国产女主播在线一区二区| 国产成人福利片| 亚洲午夜免费电影| 国产偷v国产偷v亚洲高清| 99麻豆久久久国产精品免费优播| 亚洲精品水蜜桃| 国产精品国产三级国产aⅴ中文| 欧美一区二区三区色| 在线观看欧美黄色| 成人av在线一区二区| 日本不卡不码高清免费观看| 亚洲自拍欧美精品| 亚洲精品中文在线影院| 国产日韩成人精品| 久久亚洲精品国产精品紫薇| 日韩精品在线看片z| 日韩三级视频中文字幕| 欧美一区二区三区视频免费播放 | 欧美精品在线视频| 成人国产精品免费网站| 成人av在线网| 91网站最新地址| 99国产一区二区三精品乱码| 麻豆一区二区三| 国产在线看一区| 韩国精品主播一区二区在线观看| 九九视频精品免费| 久久99精品国产.久久久久| 日本三级韩国三级欧美三级| 日本伊人色综合网| 国产精品99久久久久久有的能看| 国产精品一品视频| 欧美性色aⅴ视频一区日韩精品| 91成人国产精品| 欧美日韩精品一区二区三区| 日韩女优电影在线观看| 久久―日本道色综合久久| 精品第一国产综合精品aⅴ| 久久欧美一区二区| 亚洲精品菠萝久久久久久久| 日本不卡在线视频| 成人va在线观看| 91精品国产色综合久久久蜜香臀|