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

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

?? os_time.c

?? 基于44B0的uCOS程序
?? 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一区二区三区免费野_久草精品视频
亚洲激情校园春色| 欧美中文字幕一二三区视频| 972aa.com艺术欧美| 欧美卡1卡2卡| 中文字幕日韩一区| 麻豆视频观看网址久久| 972aa.com艺术欧美| 久久久久久久久久久久久夜| 午夜婷婷国产麻豆精品| 成人精品视频一区二区三区尤物| 欧美一区二区三区成人| 亚洲在线视频网站| 成人激情图片网| 久久人人超碰精品| 久久99精品久久久久久| 欧美精品自拍偷拍| 一区二区三区丝袜| 91玉足脚交白嫩脚丫在线播放| 欧美不卡一区二区| 另类调教123区| 欧美一二三在线| 日韩 欧美一区二区三区| 色婷婷综合在线| 亚洲欧美另类在线| 91蜜桃婷婷狠狠久久综合9色| 国产精品毛片大码女人| 国产成人综合精品三级| 国产日韩av一区| 国产白丝网站精品污在线入口| 日韩精品专区在线影院重磅| 免费人成网站在线观看欧美高清| 欧美日韩中文另类| 无吗不卡中文字幕| 欧美一区二视频| 蜜桃av一区二区在线观看| 91精品国产91热久久久做人人| 一区二区欧美国产| 欧美三级乱人伦电影| 亚洲午夜精品网| 欧美电影在线免费观看| 日韩国产精品久久久久久亚洲| 91精品国产综合久久久久久漫画 | 在线观看亚洲精品视频| 亚洲精品欧美综合四区| 91黄视频在线观看| 天天综合色天天综合色h| 欧美一区二区成人| 精油按摩中文字幕久久| 亚洲国产激情av| 92国产精品观看| 亚洲国产精品一区二区www | 亚洲一区二区免费视频| 7878成人国产在线观看| 激情文学综合插| 欧美国产日本韩| 欧美午夜一区二区三区| 日本不卡高清视频| 中文一区一区三区高中清不卡| 91浏览器入口在线观看| 日本va欧美va欧美va精品| 精品福利一区二区三区免费视频| 国产福利一区二区三区视频在线| 成人免费在线播放视频| 欧美日韩一级视频| 国产精品综合在线视频| 亚洲裸体xxx| www成人在线观看| 91免费看片在线观看| 免费不卡在线视频| 一区二区中文字幕在线| 91精品国产乱| 91豆麻精品91久久久久久| 久久99精品国产.久久久久久| 亚洲视频在线一区观看| 精品少妇一区二区三区在线视频| 91蜜桃在线免费视频| 国产尤物一区二区在线| 亚洲综合久久av| 国产精品美女久久久久久久 | 中文字幕免费观看一区| 777xxx欧美| 99精品1区2区| 国产精品一区二区在线看| 日本少妇一区二区| 亚洲国产成人porn| 国产精品午夜免费| 精品国产亚洲在线| 6080亚洲精品一区二区| 色综合一个色综合| 国产99精品在线观看| 久久国产精品色| 首页国产丝袜综合| 亚洲激情综合网| 最近日韩中文字幕| 中文字幕 久热精品 视频在线| 精品国产电影一区二区| 欧美一区二区私人影院日本| 色综合久久中文字幕综合网| 成人一区二区在线观看| 国产精品综合一区二区三区| 久久99精品久久只有精品| 日韩av不卡在线观看| 日韩激情视频在线观看| 午夜天堂影视香蕉久久| 天天亚洲美女在线视频| 亚洲www啪成人一区二区麻豆 | 欧美日韩精品系列| 欧美日韩色一区| 欧美性色综合网| 欧美日韩精品综合在线| 欧美色图12p| 欧美日韩一区中文字幕| 欧美日韩免费一区二区三区视频| 色狠狠一区二区三区香蕉| 91福利精品第一导航| 欧洲一区在线观看| 欧美日韩亚洲综合一区二区三区| 91黄色免费版| 欧美日韩久久一区| 日韩一区二区三区在线视频| 欧美不卡在线视频| 久久久蜜桃精品| 国产精品毛片无遮挡高清| 亚洲女子a中天字幕| 一区二区三区日韩精品视频| 日韩中文字幕区一区有砖一区| 青娱乐精品在线视频| 国产一区激情在线| 99国产麻豆精品| 欧美日韩国产小视频| 日韩三级在线免费观看| 久久亚洲精精品中文字幕早川悠里 | 亚洲成人av一区二区三区| 午夜电影久久久| 激情亚洲综合在线| 91香蕉视频黄| 欧美精品在线视频| 亚洲精品一区二区三区影院| 国产日韩欧美综合一区| 18欧美亚洲精品| 天堂一区二区在线免费观看| 国内精品自线一区二区三区视频| 国产99久久久精品| 欧美日韩在线直播| 日韩欧美一二三区| 国产精品久久777777| 亚洲成年人影院| 懂色av一区二区三区免费观看| 日本丶国产丶欧美色综合| 欧美不卡一区二区| 亚洲精品视频在线看| 老司机一区二区| 色妹子一区二区| 精品久久久久久久久久久久包黑料| 国产精品久久久久久久久晋中 | 国产成人免费网站| 欧美午夜精品一区| 国产日韩欧美a| 五月天一区二区| 成人午夜私人影院| 欧美日韩国产精品自在自线| 国产日韩欧美a| 美女脱光内衣内裤视频久久网站 | 91精品国产综合久久小美女| 国产精品家庭影院| 久久国产福利国产秒拍| 色网站国产精品| 日本一二三不卡| 免费成人小视频| 欧美图区在线视频| 国产精品女主播av| 久久疯狂做爰流白浆xx| 欧美日韩在线一区二区| 最好看的中文字幕久久| 国产成人夜色高潮福利影视| 欧美巨大另类极品videosbest| 亚洲视频香蕉人妖| 粉嫩蜜臀av国产精品网站| 日韩一区二区免费在线观看| 一区二区三区在线观看国产| 成人小视频在线观看| www国产精品av| 免费在线观看成人| 91精品国产高清一区二区三区| 亚洲男人都懂的| 成人白浆超碰人人人人| 国产视频一区二区在线观看| 国精产品一区一区三区mba桃花 | 欧美日韩国产综合视频在线观看| 亚洲人成影院在线观看| 成人美女在线视频| 欧美激情中文字幕| 东方aⅴ免费观看久久av| 精品成a人在线观看| 狠狠色狠狠色合久久伊人| 日韩欧美在线123| 免费看欧美女人艹b| 日韩女同互慰一区二区| 蜜臀av一区二区| 久久综合色8888|