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

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

?? os_time.c

?? UCOS——FOR——UNSP2
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                           All Rights Reserved
*
*                                                  V2.00
*
* File : OS_TIME.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "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 (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();
        OSSched();                                                        /* 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.
*********************************************************************************************************
*/

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 = ticks / 65536L;                  /* Compute the integral number of 65536 tick delays   */
        ticks = ticks % 65536L;                  /* Obtain  the fractional number of ticks             */
        OSTimeDly(ticks);
        while (loops > 0) {
            OSTimeDly(32768);
            OSTimeDly(32768);
            loops--;
        }
        return (OS_NO_ERR);
    } else {
        return (OS_TIME_ZERO_DLY);
    }
}
/*$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
*********************************************************************************************************
*/

INT8U OSTimeDlyResume (INT8U prio)
{
    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)) {    /* See if task is ready to run              */
                OSRdyGrp               |= ptcb->OSTCBBitY; /* Make task ready to run                   */
                OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
                OS_EXIT_CRITICAL();
                OSSched();                                 /* 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       */
        }
    } else {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                        /* The task does not exist                  */
    }
}
/*$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
*********************************************************************************************************
*/

INT32U OSTimeGet (void)
{
    INT32U ticks;


    OS_ENTER_CRITICAL();
    ticks = OSTime;
    OS_EXIT_CRITICAL();
    return (ticks);
}

/*
*********************************************************************************************************
*                                            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
*********************************************************************************************************
*/

void OSTimeSet (INT32U ticks)
{
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人动漫在线免费观看| caoporn国产一区二区| 国产盗摄精品一区二区三区在线| 99国产精品国产精品毛片| 欧美日韩国产乱码电影| 国产精品狼人久久影院观看方式| 青青草成人在线观看| 99riav一区二区三区| 久久久久99精品一区| 日韩精品一级中文字幕精品视频免费观看 | 亚洲一区二区中文在线| 秋霞午夜鲁丝一区二区老狼| 色诱亚洲精品久久久久久| 久久综合九色综合97_久久久 | 色天使色偷偷av一区二区| 国产亚洲人成网站| 久久激五月天综合精品| 欧美日韩国产影片| 亚洲精品视频一区| 99综合电影在线视频| 国产亲近乱来精品视频| 韩国精品久久久| 日韩欧美一级二级| 秋霞成人午夜伦在线观看| 欧美日韩国产中文| 亚洲国产一区二区视频| 色播五月激情综合网| 中文字幕日韩一区| 成人va在线观看| 国产精品亲子伦对白| 国产一区二区视频在线播放| 欧美精品久久一区二区三区| 亚洲自拍欧美精品| 欧美在线观看一区| 一区二区三区四区视频精品免费| 欧美一级高清片在线观看| 日韩制服丝袜先锋影音| 欧美军同video69gay| 日韩av一区二区在线影视| 欧美一区二区在线播放| 日韩国产欧美在线播放| 91精品国产高清一区二区三区| 石原莉奈在线亚洲二区| 日韩午夜av电影| 久久精品国内一区二区三区| 精品国产乱码久久久久久蜜臀 | 欧美成人午夜电影| 精品一区二区日韩| 久久色成人在线| 粉嫩绯色av一区二区在线观看| 中文字幕不卡在线观看| 一本色道**综合亚洲精品蜜桃冫 | 亚瑟在线精品视频| 日韩一区二区精品| 国产福利一区二区三区视频在线 | 亚洲一区欧美一区| 在线综合亚洲欧美在线视频| 久久99九九99精品| 日韩美女精品在线| 制服丝袜一区二区三区| 国产在线精品免费av| 国产精品萝li| 欧美日韩一区二区三区高清| 久久成人免费日本黄色| 久久久久国产精品免费免费搜索| 白白色 亚洲乱淫| 亚洲h在线观看| 亚洲国产高清在线| 欧美三级电影在线观看| 国产一区 二区| 亚洲综合色区另类av| 精品福利在线导航| 91国偷自产一区二区开放时间| 日韩成人精品在线观看| 免费精品视频在线| 国产精品你懂的| 91精品国产麻豆| 日本高清不卡一区| 国产激情91久久精品导航| 一区二区三区欧美| 久久久久久黄色| 欧美精品久久久久久久多人混战 | 亚洲精品视频一区二区| 精品裸体舞一区二区三区| 99久久精品免费看| 国内精品免费**视频| 亚洲国产精品视频| 国产精品乱子久久久久| 日韩欧美视频一区| 欧美唯美清纯偷拍| 不卡一卡二卡三乱码免费网站| 日本不卡一二三| 一区二区三区蜜桃网| 欧美激情艳妇裸体舞| 欧美一区日韩一区| 亚洲视频一区二区免费在线观看| 日本中文一区二区三区| 成人高清在线视频| 韩国三级电影一区二区| 香蕉加勒比综合久久| 国产精品美女久久久久aⅴ国产馆| 91精品国产色综合久久ai换脸 | 欧美成人三级电影在线| 欧洲视频一区二区| jvid福利写真一区二区三区| 国内精品自线一区二区三区视频| 国产黄色成人av| 韩国欧美国产一区| 国产在线精品一区二区夜色| 蜜臀av一区二区在线观看| 亚洲午夜精品17c| 亚洲影院久久精品| 亚洲免费电影在线| 亚洲日本韩国一区| 一区二区三区四区不卡视频| 亚洲视频中文字幕| 亚洲精品国产精华液| 亚洲综合久久久久| 亚洲国产一区二区在线播放| 亚洲成人tv网| 天堂一区二区在线| 日韩二区三区在线观看| 日韩和欧美的一区| 麻豆精品视频在线观看免费| 日韩高清不卡一区| 美女脱光内衣内裤视频久久影院| 喷白浆一区二区| 国产在线一区观看| 国产成人av一区二区三区在线观看| 国产一区二区成人久久免费影院| 国产精品一卡二卡| 不卡一二三区首页| 在线看日本不卡| 91精品国产色综合久久| 亚洲成人av在线电影| 天堂av在线一区| 国产一区二区福利| 99精品视频一区| 欧美日韩电影一区| 精品成a人在线观看| 国产精品网友自拍| 一区二区三区四区蜜桃| 男女男精品视频网| 成人一区二区在线观看| 91福利在线播放| 欧美成人一区二区三区片免费| 亚洲国产精品精华液ab| 亚洲国产精品久久一线不卡| 久久精品国产澳门| 91女厕偷拍女厕偷拍高清| 欧美日韩三级视频| 国产亚洲精品福利| 午夜精品福利久久久| 国产成人福利片| 7777精品伊人久久久大香线蕉完整版| 精品久久久久久无| 一区二区视频在线| 国产一区二区不卡| 欧美羞羞免费网站| 久久网这里都是精品| 亚洲国产精品久久人人爱| 国产精品亚洲第一| 欧美精品视频www在线观看| 国产精品剧情在线亚洲| 日产精品久久久久久久性色| 成人a免费在线看| 日韩欧美亚洲国产另类| 亚洲嫩草精品久久| 国产精品综合一区二区三区| 欧美色涩在线第一页| 国产精品入口麻豆九色| 蜜桃视频一区二区| 欧美在线视频你懂得| 国产精品你懂的| 国产一区二区三区四区五区入口| 欧美视频中文一区二区三区在线观看| 亚洲国产精品ⅴa在线观看| 久久99精品一区二区三区 | 亚洲一区二区三区不卡国产欧美| 国产专区综合网| 日韩一区二区麻豆国产| 亚洲国产综合色| 不卡av电影在线播放| wwwwww.欧美系列| 日日欢夜夜爽一区| 欧美色男人天堂| 一区二区国产视频| 91久久久免费一区二区| 国产精品黄色在线观看| 国产不卡视频在线观看| 精品成人在线观看| 久久国产精品99精品国产| 678五月天丁香亚洲综合网| 亚洲亚洲人成综合网络| 色一情一伦一子一伦一区| 亚洲欧美日本韩国| 日本久久一区二区三区| 亚洲欧美日韩一区二区| 91欧美激情一区二区三区成人| 日韩毛片精品高清免费|