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

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

?? os_time.c

?? 基于Verilog HDL的電梯系統(tǒng)設(shè)計(jì)
?? C
字號(hào):
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : OS_TIME.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "..\APP\includes.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    


    if (ticks > 0) {                                                      /* 0 means no delay!         */
        OS_ENTER_CRITICAL();
        if ((OSRdyTbl[OSTCBCur->OSTCBY] &= ~OSTCBCur->OSTCBBitX) == 0) {  /* Delay current task        */
            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 || minutes > 0 || seconds > 0 || milli > 0) {
        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(32768);
            OSTimeDly(32768);
            loops--;
        }
        return (OS_NO_ERR);
    }
    return (OS_TIME_ZERO_DLY);
}
#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    

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美成人高清电影在线| 日韩精品一区二区三区四区| 欧美日韩一区二区三区在线看| 欧美日韩视频不卡| 国产亚洲成年网址在线观看| 亚洲综合色婷婷| 国产不卡在线视频| 在线播放中文字幕一区| 国产精品妹子av| 久久精品国产免费| 欧美综合在线视频| 国产欧美日韩视频在线观看| 青青草原综合久久大伊人精品 | 91网址在线看| 精品久久一区二区三区| 午夜视频在线观看一区二区| a级高清视频欧美日韩| 久久精品亚洲麻豆av一区二区| 日产精品久久久久久久性色| 色www精品视频在线观看| 国产情人综合久久777777| 美女脱光内衣内裤视频久久网站| 欧美三级韩国三级日本一级| 亚洲视频每日更新| 97久久久精品综合88久久| 欧美国产日本韩| 国产精品性做久久久久久| 精品理论电影在线| 国产女同互慰高潮91漫画| 欧美国产禁国产网站cc| 成+人+亚洲+综合天堂| 亚洲欧洲日韩av| 国产成人午夜高潮毛片| 久久先锋影音av鲁色资源网| 蜜臀久久99精品久久久久宅男| 欧美视频一二三区| 亚洲一区二区三区四区的| 99久久伊人精品| 亚洲三级理论片| 色天天综合久久久久综合片| 国产精品久久久久久久久免费樱桃 | 不卡区在线中文字幕| 国产日韩欧美高清| av亚洲精华国产精华精华| 国产精品理伦片| 91丝袜美女网| 亚洲综合精品自拍| 国产mv日韩mv欧美| 国产一区二区在线电影| 国产成人一级电影| 国产精品初高中害羞小美女文| 99这里都是精品| 亚洲欧洲综合另类| 欧美亚洲国产bt| 久久精工是国产品牌吗| 精品国产乱码久久久久久影片| 国产精品一区二区久久不卡| 中文字幕一区二区三| 91黄色小视频| 男男gaygay亚洲| 久久九九久久九九| 91女厕偷拍女厕偷拍高清| 视频一区视频二区中文| 亚洲精品一区二区在线观看| 成人毛片视频在线观看| 亚洲成a人片在线观看中文| 日韩欧美一级精品久久| 99国产精品久久| 日韩电影免费在线观看网站| 久久久精品欧美丰满| 欧美四级电影网| 国产精品一级二级三级| 一区二区三区.www| 亚洲精品在线观看网站| 91丝袜美女网| 国模无码大尺度一区二区三区| 亚洲视频免费在线观看| 精品国产一区二区三区av性色| www.性欧美| 激情欧美一区二区三区在线观看| 亚洲私人影院在线观看| 精品免费国产二区三区| 欧美色偷偷大香| 国产91精品在线观看| 日本网站在线观看一区二区三区 | 久久亚洲免费视频| 在线免费视频一区二区| 狠狠色丁香婷综合久久| 亚洲不卡一区二区三区| 国产精品污网站| 精品对白一区国产伦| 欧美性猛交xxxx黑人交| 成人av电影在线| 国产永久精品大片wwwapp| 三级一区在线视频先锋| 亚洲欧洲国产专区| 久久久午夜精品理论片中文字幕| 欧美撒尿777hd撒尿| 91在线免费看| 成人综合婷婷国产精品久久蜜臀| 另类小说欧美激情| 日韩精品亚洲专区| 亚洲成人综合视频| 亚洲精品高清在线观看| 中文字幕第一区| 国产视频一区不卡| 久久综合色鬼综合色| 欧美精品在线一区二区三区| 99精品欧美一区二区三区小说| 国产色91在线| 日韩午夜精品视频| 一区二区三区在线视频免费观看| 久久精品夜色噜噜亚洲aⅴ| 精品美女被调教视频大全网站| 国产精品欧美极品| 26uuu欧美| 久久婷婷综合激情| 久久久国产精品午夜一区ai换脸| 久久亚洲精华国产精华液| 欧美成人激情免费网| 精品国产精品网麻豆系列| 日韩精品自拍偷拍| 精品美女一区二区三区| 久久久综合精品| 国产欧美日韩在线观看| 国产精品久久久久aaaa| 最新不卡av在线| 一级女性全黄久久生活片免费| 亚洲精品国产成人久久av盗摄| 亚洲一区在线观看视频| 亚洲成av人影院| 毛片基地黄久久久久久天堂| 激情小说亚洲一区| 成人精品一区二区三区中文字幕| 成人国产精品免费观看| 色老汉一区二区三区| 欧美一区二区三区日韩| 久久蜜臀精品av| 亚洲男同性恋视频| 亚瑟在线精品视频| 狠狠色丁香九九婷婷综合五月| 成人高清视频免费观看| 欧美在线观看一区二区| 日韩视频一区在线观看| 国产天堂亚洲国产碰碰| 1024亚洲合集| 日本不卡视频一二三区| 国产经典欧美精品| 在线亚洲欧美专区二区| 欧美成人一区二区三区片免费| 国产精品色哟哟| 亚洲第一福利视频在线| 国产精品一区一区三区| 欧美综合久久久| 久久嫩草精品久久久久| 亚洲精品乱码久久久久| 精品亚洲免费视频| 欧美在线你懂的| 国产日产亚洲精品系列| 日韩专区一卡二卡| av亚洲产国偷v产偷v自拍| 欧美人狂配大交3d怪物一区| 久久久久久久久蜜桃| 亚洲一区免费观看| 国产成人在线视频网站| 欧美电影一区二区三区| 国产精品久久久久影院亚瑟| 日本最新不卡在线| 色哟哟欧美精品| 日本一区二区免费在线观看视频| 日日夜夜精品免费视频| av不卡在线观看| 久久九九久久九九| 蜜桃精品在线观看| 欧美亚男人的天堂| 国产精品国模大尺度视频| 狠狠色综合日日| 欧美日韩视频专区在线播放| 国产精品久久99| 精品亚洲aⅴ乱码一区二区三区| 欧美午夜寂寞影院| 亚洲黄色免费电影| 成人国产精品免费观看动漫 | 日韩欧美www| 亚洲激情五月婷婷| 99久久精品国产麻豆演员表| 精品国产污网站| 日本欧美久久久久免费播放网| 色婷婷av久久久久久久| 亚洲欧美一区二区在线观看| 国产精品77777| 日韩欧美久久久| 人禽交欧美网站| 日韩视频中午一区| 热久久免费视频| 欧美美女直播网站| 亚洲无线码一区二区三区| 欧美揉bbbbb揉bbbbb| 午夜精品在线看| 91精品在线观看入口|