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

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

?? os_time.c

?? LPC2106開發板上面的uCOS移植代碼最新版2.83
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2006, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.83
*********************************************************************************************************
*/

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



    if (prio >= OS_LOWEST_PRIO) {
        return (OS_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = 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  = OS_TRUE;                          /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBPendTO  = OS_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 = 0;
#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 = 0;
#endif



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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产jizzjizz一区二区| 国产99精品国产| 国产区在线观看成人精品| 在线影视一区二区三区| 国产在线精品免费| 无码av免费一区二区三区试看| 久久久影院官网| 91精品一区二区三区久久久久久| 国产jizzjizz一区二区| 麻豆一区二区三| 一区二区三区 在线观看视频| 国产欧美日韩另类一区| 日韩一区二区三区电影在线观看| 色综合激情久久| 成人精品免费看| 国产尤物一区二区在线| 日韩福利视频导航| 伊人一区二区三区| 国产精品青草久久| 2017欧美狠狠色| 日韩一级精品视频在线观看| 欧美日韩一区成人| 色乱码一区二区三区88| 成人黄动漫网站免费app| 黄色精品一二区| 九九精品视频在线看| 日韩电影在线免费| 午夜激情综合网| 亚洲小少妇裸体bbw| 亚洲精品视频自拍| 自拍偷拍国产精品| 国产精品三级av在线播放| 久久蜜臀中文字幕| 久久久久久**毛片大全| 久久色在线视频| 精品国产伦理网| 欧美精品一区二区三区蜜桃| 精品日韩在线观看| 欧美xxxx老人做受| 欧美成人午夜电影| 欧美va亚洲va| 精品福利一区二区三区免费视频| 欧美一级片免费看| 欧美一区二区在线观看| 日韩一区二区三区免费看| 欧美一级一区二区| 2020国产精品| 国产精品嫩草99a| 中文字幕亚洲视频| 亚洲免费av观看| 亚洲一区影音先锋| 亚洲1区2区3区视频| 婷婷激情综合网| 奇米影视一区二区三区小说| 蜜臀av性久久久久蜜臀av麻豆| 久久精品免费观看| 国产成人自拍网| 99国产精品久| 欧美日韩国产中文| 日韩欧美一区二区视频| 久久影院午夜论| 国产精品白丝在线| 亚洲一区二区视频在线观看| 午夜精品久久久久久久久| 免费一级欧美片在线观看| 国产乱人伦偷精品视频不卡| 成人免费三级在线| 欧美色男人天堂| 欧美不卡123| 最近中文字幕一区二区三区| 亚洲最大的成人av| 蜜桃视频免费观看一区| 国产另类ts人妖一区二区| 91色porny在线视频| 欧美日韩国产经典色站一区二区三区 | 亚洲国产一区二区视频| 免费观看日韩av| 99视频有精品| 日韩三级中文字幕| 国产精品欧美一区喷水| 粉嫩蜜臀av国产精品网站| 99久久精品国产一区| 91精品国模一区二区三区| 久久精品一区四区| 亚洲国产日韩精品| 国产精品456露脸| 欧美三级电影网站| 国产片一区二区| 亚洲成人免费在线观看| 国产精品自在在线| 欧美日韩久久一区二区| 国产日韩欧美激情| 色综合久久综合网| 日韩免费高清av| 亚洲精品国产视频| 国产乱码精品一区二区三区忘忧草| 色美美综合视频| 国产日本欧洲亚洲| 日本系列欧美系列| 日本乱人伦一区| 久久免费偷拍视频| 免费看日韩a级影片| 91玉足脚交白嫩脚丫在线播放| 日韩精品中文字幕一区| 一区二区三区中文字幕在线观看| 国产在线不卡一区| 欧美一级国产精品| 一区二区三区美女视频| 成人av网址在线| 日韩精品在线一区| 日韩精品亚洲专区| 91精品1区2区| 亚洲欧洲成人精品av97| 狠狠色丁香九九婷婷综合五月| 欧美色综合网站| 亚洲人一二三区| 国产成人在线免费| 精品国产一区二区亚洲人成毛片| 日韩精品久久久久久| 91福利国产精品| 亚洲日韩欧美一区二区在线| 国产成人免费视频网站 | 国产成人免费xxxxxxxx| 欧美成人女星排行榜| 日韩国产欧美在线视频| 欧美日韩一卡二卡三卡| 一区二区三区波多野结衣在线观看| 成人免费视频caoporn| 久久久综合精品| 国产剧情一区二区三区| www久久精品| 国产综合成人久久大片91| 日韩欧美成人午夜| 久久草av在线| 久久综合色天天久久综合图片| 日韩二区三区在线观看| 日韩午夜激情av| 麻豆精品新av中文字幕| 日韩午夜在线观看| 久久国产福利国产秒拍| 欧美大片在线观看一区二区| 另类综合日韩欧美亚洲| 精品处破学生在线二十三| 国内精品免费在线观看| 久久青草欧美一区二区三区| 国产精品亚洲综合一区在线观看| 久久这里只精品最新地址| 国产成人午夜99999| 国产精品卡一卡二卡三| 99国产精品久久久久久久久久| 亚洲伦理在线精品| 欧美日韩精品二区第二页| 日本成人在线一区| www日韩大片| 99久久精品情趣| 亚洲午夜免费视频| 91精品国产一区二区三区| 精品一区二区在线视频| 欧美精彩视频一区二区三区| 色综合久久综合网欧美综合网| 亚洲国产欧美一区二区三区丁香婷| 欧美一区二区免费观在线| 国产精品一二三| 一区二区三区波多野结衣在线观看 | 久久精品视频网| 成人免费视频国产在线观看| 一区二区三区日韩在线观看| 欧美日韩国产天堂| 国产伦精品一区二区三区视频青涩 | 福利电影一区二区| 亚洲精品免费电影| 7777精品伊人久久久大香线蕉的| 国产麻豆精品视频| 伊人婷婷欧美激情| 精品免费国产一区二区三区四区| 国产91在线观看丝袜| 亚洲影视资源网| 日韩欧美一级二级三级久久久| 成人精品gif动图一区| 一区二区三区四区视频精品免费 | 国产精品三级久久久久三级| 欧美激情一二三区| 国产精品影音先锋| 自拍偷拍欧美精品| 欧美高清www午色夜在线视频| 国内精品第一页| 亚洲人妖av一区二区| 欧美三级日韩三级国产三级| 丁香亚洲综合激情啪啪综合| 一卡二卡欧美日韩| 日韩欧美专区在线| 一本色道**综合亚洲精品蜜桃冫| 日韩影院免费视频| 国产精品看片你懂得| 精品国产一区二区三区久久影院 | 欧美伊人久久大香线蕉综合69| 日韩不卡免费视频| 亚洲一区在线观看网站| 久久久综合视频| 欧美日韩精品三区|