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

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

?? os_time.c

?? 在ATEML公司EB40/40a/42/63/55開發(fā)板上運行的uCOS-II v2.0。
?? 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一区二区三区免费野_久草精品视频
国产亚洲综合av| 久久99精品国产麻豆婷婷洗澡| 亚洲一二三区不卡| 狠狠色丁香久久婷婷综| 欧美色图免费看| 欧美国产激情一区二区三区蜜月| 亚洲国产日韩av| 99精品国产视频| 久久久久久久久99精品| 日本成人在线网站| 91国产精品成人| 国产精品麻豆一区二区| 精品无人码麻豆乱码1区2区| 欧美日韩精品高清| 亚洲欧美视频一区| a在线欧美一区| 国产亚洲成aⅴ人片在线观看| 蜜桃一区二区三区在线| 欧美日韩国产在线观看| 亚洲一区二区三区影院| 色综合久久综合网| 综合欧美亚洲日本| www.欧美色图| 国产精品福利电影一区二区三区四区| 狠狠久久亚洲欧美| 精品久久久网站| 日韩主播视频在线| 制服丝袜一区二区三区| 午夜亚洲国产au精品一区二区| 色综合网站在线| 国产精品伦一区二区三级视频| 国产在线观看一区二区| 久久日一线二线三线suv| 麻豆成人免费电影| 久久蜜桃一区二区| 国产成人h网站| 久久女同精品一区二区| 国产91丝袜在线观看| 久久久777精品电影网影网| 国产成人亚洲精品青草天美| 久久久久久久久久久久久久久99| 国产一区二区免费视频| 国产精品久久免费看| 一本色道a无线码一区v| 亚洲国产日韩在线一区模特| 在线不卡a资源高清| 日本亚洲一区二区| 精品久久国产字幕高潮| 国产成人日日夜夜| 亚洲激情图片小说视频| 欧美日韩在线播放三区四区| 免费看欧美女人艹b| 国产午夜亚洲精品午夜鲁丝片| 成人av在线资源网站| 一区二区三国产精华液| 日韩欧美国产综合一区| 国产成人精品午夜视频免费| 亚洲女子a中天字幕| 欧美高清hd18日本| 国产在线国偷精品免费看| 中文字幕字幕中文在线中不卡视频| 一本大道久久a久久综合婷婷| 日日欢夜夜爽一区| 久久精品一区二区三区av| 91视频一区二区三区| 日本欧美一区二区三区乱码| 国产欧美一区二区三区在线看蜜臀 | 亚洲日穴在线视频| 欧美高清一级片在线| 成人av在线播放网站| 日韩av午夜在线观看| 中文字幕一区二区三区在线播放 | 欧美日韩电影一区| 国产精品一二三四区| 性做久久久久久久久| 国产日韩精品久久久| 欧美日韩一级二级三级| 成人午夜精品在线| 蜜臀国产一区二区三区在线播放| 中文字幕亚洲在| 精品卡一卡二卡三卡四在线| 欧美日韩中文国产| 波多野结衣精品在线| 麻豆精品在线看| 亚洲欧美色综合| 日本一区二区不卡视频| 日韩欧美的一区二区| 日本高清无吗v一区| 高清国产一区二区| 精品一区二区三区影院在线午夜| 一区二区三区日韩在线观看| 国产精品丝袜一区| 久久精品一区二区三区四区| 日韩欧美在线综合网| 在线观看www91| 99国产精品一区| 成人激情开心网| 国产91在线看| 国产成人午夜精品影院观看视频| 青青草原综合久久大伊人精品| 亚洲一区视频在线| 亚洲欧美另类久久久精品2019| 国产精品色哟哟网站| 国产欧美一区二区精品性色超碰| 欧美变态tickling挠脚心| 日韩一区二区三区在线观看| 91精品国产综合久久婷婷香蕉 | 久久精品亚洲乱码伦伦中文| 精品日韩一区二区三区| 欧美大片一区二区三区| 91精品国产欧美日韩| 3d成人h动漫网站入口| 欧美三片在线视频观看| 欧美熟乱第一页| 欧美人与z0zoxxxx视频| 欧美色爱综合网| 欧美一区国产二区| 欧美精品第1页| 欧美精品乱码久久久久久按摩 | 日韩激情一区二区| 蜜桃精品视频在线| 九九在线精品视频| 国产精品自产自拍| 成人app网站| 在线精品国精品国产尤物884a| 91国偷自产一区二区三区成为亚洲经典 | 日本视频在线一区| 极品少妇xxxx偷拍精品少妇| 国产精品一区二区你懂的| 成人性视频网站| 欧美综合色免费| 欧美一区二区三区四区久久| 2014亚洲片线观看视频免费| 国产欧美精品区一区二区三区| 亚洲欧美日韩小说| 日韩综合在线视频| 国产伦精一区二区三区| 99久久99久久免费精品蜜臀| 欧美日韩一区成人| 26uuu成人网一区二区三区| 国产精品视频yy9299一区| 一区二区三区在线观看动漫| 日本午夜一本久久久综合| 福利一区二区在线观看| 日本韩国一区二区三区| 日韩精品一区二区三区四区 | 北条麻妃国产九九精品视频| 91九色02白丝porn| 精品久久久三级丝袜| 亚洲天堂精品视频| 久久精品国产免费看久久精品| 成人一区二区三区| 欧美性高清videossexo| 国产丝袜欧美中文另类| 亚洲成人在线免费| 不卡一区二区三区四区| 91精品久久久久久久99蜜桃| 一色屋精品亚洲香蕉网站| 美女尤物国产一区| 91看片淫黄大片一级| 日韩精品专区在线影院观看 | 久久精品99久久久| 色噜噜狠狠一区二区三区果冻| 日韩写真欧美这视频| 一区二区日韩电影| 国产成人精品免费| 欧美成人一区二区| 亚洲一区免费视频| 99re视频这里只有精品| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 成人网男人的天堂| 日韩亚洲欧美一区| 亚洲国产成人精品视频| 成人黄色网址在线观看| 精品国产91久久久久久久妲己 | 欧美亚洲高清一区| 中文字幕日本不卡| 国产精品一区二区在线观看不卡| 7777精品伊人久久久大香线蕉| **网站欧美大片在线观看| 粉嫩嫩av羞羞动漫久久久| 欧美精品一区二区三区四区 | 日韩一区二区视频在线观看| 亚洲国产日韩精品| 色天使久久综合网天天| 国产精品国产精品国产专区不片| 国产成人av自拍| 精品日产卡一卡二卡麻豆| 日本va欧美va瓶| 欧美精品精品一区| 天堂久久久久va久久久久| 欧美日韩亚州综合| 亚洲午夜激情网页| 在线国产亚洲欧美| 亚洲一区国产视频| 欧美日韩国产一二三| 亚洲第一会所有码转帖| 欧美精品一级二级| 青青草97国产精品免费观看无弹窗版| 欧美剧在线免费观看网站|