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

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

?? os_time.c

?? ucos2.52多處理器平臺移植源代碼
?? 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一区二区三区免费野_久草精品视频
久久se这里有精品| 国产在线精品一区二区夜色| 欧美国产精品劲爆| 久久亚洲综合色| 精品粉嫩aⅴ一区二区三区四区| 欧美一区二区三区在线视频 | 国产一区在线精品| 久久99国产精品尤物| 韩国女主播一区二区三区| 国产在线国偷精品产拍免费yy | 国产999精品久久久久久绿帽| 激情小说亚洲一区| 国产成人av自拍| 色综合视频在线观看| 欧美日精品一区视频| 91精品国产91综合久久蜜臀| 精品国精品国产尤物美女| 久久久久久久久久久久电影| 1000部国产精品成人观看| 一区二区三区资源| 日韩一区精品视频| 国产福利精品导航| 欧美性xxxxxxxx| 欧美一级一级性生活免费录像| 精品毛片乱码1区2区3区| 国产精品白丝在线| 日韩一区欧美二区| 成人午夜免费av| 欧美久久久久久久久久| 久久精品一二三| 午夜视黄欧洲亚洲| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 欧美影院精品一区| 精品国产乱码久久久久久老虎| 亚洲欧美日韩一区二区| 久久国产精品露脸对白| 99精品视频在线观看| 在线播放亚洲一区| 中文字幕中文字幕中文字幕亚洲无线| 亚洲成人中文在线| 99久久久免费精品国产一区二区| 欧美精品色一区二区三区| 国产欧美精品一区| 秋霞成人午夜伦在线观看| 91免费视频网| 日本一区二区免费在线观看视频 | 99久久久久久| 精品国产a毛片| 亚洲成人动漫av| 91美女片黄在线观看91美女| 精品国产91洋老外米糕| 天天综合色天天综合| 色诱视频网站一区| 国产精品剧情在线亚洲| 国内精品伊人久久久久影院对白| 欧美猛男超大videosgay| 国产精品乱人伦中文| 韩国毛片一区二区三区| 在线电影一区二区三区| 亚洲午夜精品在线| 欧洲另类一二三四区| 国产精品少妇自拍| 国产毛片精品一区| 久久久精品日韩欧美| 韩国女主播成人在线| 欧美大片免费久久精品三p| 午夜av区久久| 欧美日韩一区高清| 亚洲无人区一区| 欧美性大战久久久| 亚洲午夜精品久久久久久久久| 色综合久久99| 伊人开心综合网| 一本色道久久综合亚洲aⅴ蜜桃| 中文字幕人成不卡一区| 99热精品一区二区| 亚洲乱码中文字幕综合| 色综合夜色一区| 亚洲一级在线观看| 欧美亚洲尤物久久| 五月婷婷综合在线| 日韩视频在线一区二区| 精品一区二区在线视频| 久久人人97超碰com| 成人av午夜电影| 亚洲黄网站在线观看| 欧美日本免费一区二区三区| 美女高潮久久久| 精品蜜桃在线看| 成人性生交大片免费看在线播放| 自拍偷拍亚洲综合| 欧美午夜在线一二页| 蜜臀av一区二区在线免费观看| 日韩写真欧美这视频| 国产激情偷乱视频一区二区三区| 国产精品对白交换视频| 欧美性受xxxx黑人xyx性爽| 蜜臀av性久久久久av蜜臀妖精| 久久久国产一区二区三区四区小说| caoporm超碰国产精品| 亚洲成精国产精品女| 欧美tickle裸体挠脚心vk| 99久久精品国产观看| 免费亚洲电影在线| 国产欧美日韩一区二区三区在线观看| 成人av在线网| 久久精品国产精品青草| 国产精品久久久久aaaa| 欧美一区二区三区成人| 成人高清在线视频| 日本伊人色综合网| 亚洲日本丝袜连裤袜办公室| 欧美一级一区二区| 91免费版pro下载短视频| 美女爽到高潮91| 一区二区三区蜜桃| 久久久久国产精品人| 欧美精品123区| 91视频在线观看| 国内久久精品视频| 日韩av电影免费观看高清完整版 | 亚洲伦理在线精品| 久久久激情视频| 欧美一区二区视频网站| 色偷偷久久一区二区三区| 免费黄网站欧美| 一区二区三区中文在线| 国产欧美日韩在线看| 欧美成人a∨高清免费观看| 欧美伊人久久大香线蕉综合69| 成人免费观看av| 国产一区在线不卡| 久久99精品久久久久| 日本在线不卡一区| 亚洲123区在线观看| 亚洲欧美另类综合偷拍| 欧美国产欧美亚州国产日韩mv天天看完整 | 国产一区二区三区高清播放| 日本成人在线不卡视频| 国产精品乱人伦中文| 国产欧美日韩中文久久| 精品国产百合女同互慰| 欧美情侣在线播放| 欧美日韩亚洲综合在线 | 欧美日韩国产天堂| 91福利在线看| 91小视频在线| 一本一本久久a久久精品综合麻豆| 床上的激情91.| 国产成人aaa| 丰满放荡岳乱妇91ww| 国产成人免费在线观看不卡| 国产一区二区不卡老阿姨| 精品一区二区三区蜜桃| 国产伦精一区二区三区| 国产成人综合自拍| 成人美女在线视频| 91丨九色丨黑人外教| 91官网在线观看| 欧美高清精品3d| 日韩女同互慰一区二区| 精品av久久707| 欧美国产综合一区二区| 国产欧美中文在线| 国产精品成人在线观看| 亚洲精品免费视频| 午夜精品久久久久久久99水蜜桃| 首页综合国产亚洲丝袜| 精品一区二区三区在线观看国产| 国产suv精品一区二区883| 波多野结衣精品在线| 欧美三级电影一区| 欧美电影免费观看高清完整版在线| 久久色在线观看| 亚洲欧美一区二区久久| 热久久免费视频| 成人丝袜视频网| 欧美精品一二三| 欧美国产精品久久| 亚洲成av人片观看| 国产精品亚洲午夜一区二区三区 | 91精品国产综合久久久久久漫画| 日韩你懂的电影在线观看| 国产精品网曝门| 午夜久久电影网| 成人a免费在线看| 欧美精品自拍偷拍动漫精品| 国产欧美1区2区3区| 午夜精品久久久久久久久久久| 国产精品亚洲一区二区三区妖精| 日本道色综合久久| 久久综合色鬼综合色| 一区二区欧美在线观看| 国产麻豆日韩欧美久久| 欧美日韩一本到| 亚洲视频精选在线| 国产一区二区91| 91精品蜜臀在线一区尤物| 亚洲精品美国一| 成人福利在线看|