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

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

?? os_time.c

?? 完整ucos, 可以在s3c440x上行
?? 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
*********************************************************************************************************
*/

#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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT8U      y;


    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 (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);
    }
                                                 /* 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 MUST NOT call this function to resume a
*              task that is waiting for an event with timeout.  This situation would make the task look
*              like a timeout occurred (unless you desire this effect).  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
*********************************************************************************************************
*/

#if OS_TIME_DLY_RESUME_EN > 0
INT8U  OSTimeDlyResume (INT8U prio)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    OS_TCB    *ptcb;


    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) {
        if (ptcb->OSTCBDly != 0) {                         /* See if task is delayed                   */
            ptcb->OSTCBDly  = 0;                           /* Clear the time delay                     */
            if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) == OS_STAT_RDY) {  /* See if task is ready to run  */
                OSRdyGrp               |= ptcb->OSTCBBitY;             /* Make task ready to run       */
                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);
        } else {
            OS_EXIT_CRITICAL();
            return (OS_TIME_NOT_DLY);                      /* Indicate that task was not delayed       */
        }
    }
    OS_EXIT_CRITICAL();
    return (OS_TASK_NOT_EXIST);                            /* The task does not exist                  */
}
#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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT32U     ticks;


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


    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级高清片在线观看| 国产成人综合自拍| 91精品国产入口| 奇米综合一区二区三区精品视频| 欧美一二三区在线观看| 韩国成人福利片在线播放| 久久婷婷色综合| 亚洲一线二线三线视频| 99久久99久久精品国产片果冻| 国产精品久久久久久久久免费樱桃| 不卡视频在线观看| 一区二区三区中文字幕电影| 欧美二区乱c少妇| 久久99国产精品久久| 国产日产欧产精品推荐色| av高清不卡在线| 亚洲va欧美va国产va天堂影院| 国产亚洲成av人在线观看导航| 99国产一区二区三精品乱码| 亚洲超碰精品一区二区| 久久麻豆一区二区| 日本韩国欧美一区二区三区| 蜜臀av一区二区在线免费观看| 亚洲国产成人自拍| 欧美日韩成人综合在线一区二区| 国产精品一区在线| 亚洲成人动漫av| 国产欧美日韩不卡免费| 欧美日本精品一区二区三区| 国产suv一区二区三区88区| 亚洲第一在线综合网站| 久久精品视频在线免费观看| 欧美中文字幕一二三区视频| 国产一区二区电影| 图片区小说区区亚洲影院| 国产欧美日韩视频在线观看| 678五月天丁香亚洲综合网| 菠萝蜜视频在线观看一区| 男人的天堂亚洲一区| 亚洲三级在线免费| 国产亚洲精品中文字幕| 日韩午夜小视频| 91国产免费观看| 成人精品亚洲人成在线| 免费人成黄页网站在线一区二区 | 午夜欧美大尺度福利影院在线看 | 懂色av一区二区三区免费观看| 亚洲伊人伊色伊影伊综合网| 中文字幕欧美区| 欧美xfplay| 欧美精品一级二级| 一本色道综合亚洲| 成人97人人超碰人人99| 黄色精品一二区| 偷偷要91色婷婷| 一区二区三区小说| 亚洲乱码精品一二三四区日韩在线| 精品国产乱码久久久久久浪潮 | 裸体一区二区三区| 亚洲大片在线观看| 亚洲美女偷拍久久| 亚洲欧美另类图片小说| 综合中文字幕亚洲| 国产精品素人视频| 欧美国产日产图区| 国产日韩高清在线| 欧美国产成人在线| 国产区在线观看成人精品| 欧美精品一区二区三区高清aⅴ| 4438x亚洲最大成人网| 一区二区三区中文字幕在线观看| 国产精品网站一区| 国产精品日日摸夜夜摸av| 欧美国产日韩在线观看| 国产精品久久久久一区| 国产精品拍天天在线| 国产精品无码永久免费888| 欧美韩国一区二区| 中文字幕制服丝袜成人av| 国产精品国产三级国产| 成人欧美一区二区三区白人| 国产精品久久久久久亚洲毛片| 国产欧美日韩激情| 亚洲男同性视频| 一区二区三区欧美激情| 亚洲韩国精品一区| 日韩va欧美va亚洲va久久| 男男视频亚洲欧美| 国内精品伊人久久久久av影院 | 久久精品国产999大香线蕉| 毛片av一区二区| 国产精品自拍网站| 91一区一区三区| 欧洲色大大久久| 777午夜精品免费视频| 欧美xxxxxxxx| 国产精品盗摄一区二区三区| 亚洲宅男天堂在线观看无病毒| 亚洲高清视频的网址| 免费成人在线视频观看| 国产mv日韩mv欧美| 91国产精品成人| 日韩一区二区三区视频在线观看| 久久久蜜桃精品| 亚洲天堂2016| 男男gaygay亚洲| 成人午夜电影小说| 欧美日韩一区成人| 国产日韩综合av| 一个色妞综合视频在线观看| 美女www一区二区| 波多野结衣亚洲| 欧美一级一区二区| 最新日韩av在线| 免费精品视频在线| 成a人片国产精品| 在线播放中文字幕一区| 国产精品高潮久久久久无| 天天影视色香欲综合网老头| 国产盗摄一区二区三区| 欧美日韩国产天堂| 国产精品午夜在线观看| 蜜臀av一级做a爰片久久| 99久久精品免费看国产 | 欧美午夜影院一区| 国产日韩欧美综合一区| 日韩黄色免费电影| 99久久久精品免费观看国产蜜| 日韩午夜激情视频| 综合av第一页| 国产专区欧美精品| 中文字幕高清一区| 天堂一区二区在线| 91免费在线视频观看| 精品国产一区二区精华| 香蕉成人啪国产精品视频综合网| 懂色av中文一区二区三区| 日韩三级精品电影久久久| 亚洲一区二区不卡免费| 成人免费视频视频| 久久综合成人精品亚洲另类欧美| 亚洲h精品动漫在线观看| 成人h动漫精品一区二| 精品国产三级a在线观看| 午夜精品久久久久久久久久 | 亚洲国产你懂的| 粉嫩av一区二区三区在线播放| 欧美电视剧在线观看完整版| 五月婷婷综合网| 欧美性做爰猛烈叫床潮| 亚洲精品网站在线观看| 国产91在线观看| 久久久久久久电影| 韩国三级在线一区| 精品国产精品一区二区夜夜嗨| 午夜精品爽啪视频| 欧美精品第一页| 午夜私人影院久久久久| 精品婷婷伊人一区三区三| 夜夜精品视频一区二区| 91亚洲大成网污www| 亚洲色图20p| 色拍拍在线精品视频8848| 亚洲精品乱码久久久久久久久| a4yy欧美一区二区三区| 1024亚洲合集| 91丨porny丨户外露出| 亚洲天堂中文字幕| 在线中文字幕一区二区| 亚洲国产另类av| 欧美日韩中字一区| 日本成人在线网站| 26uuu欧美| 国产传媒一区在线| 中文字幕在线观看不卡| 色婷婷av一区二区三区之一色屋| 一区二区三区色| 欧美性猛片aaaaaaa做受| 日韩精品福利网| 欧美成人一区二区三区在线观看| 国产一区二三区| 国产精品女主播av| 日本一区二区成人在线| 成人av动漫在线| 亚洲综合色区另类av| 7777精品伊人久久久大香线蕉超级流畅| 日韩精品视频网站| 欧美videossexotv100| 成人丝袜高跟foot| 亚洲国产精品一区二区尤物区| 欧美高清视频www夜色资源网| 精品亚洲欧美一区| 国产精品欧美精品| 在线观看成人免费视频| 六月婷婷色综合| 国产精品毛片无遮挡高清| 欧美日韩中文另类| 国产精一区二区三区| 一区二区三区 在线观看视频| 日韩一级片网址|