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

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

?? os_time.c

?? ucosII操作系統移植源代碼(包括詳細的移植步驟和心得)。
?? C
字號:
/*
*********************************************************************************************************
*                                                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 "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();
        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)
{
   
    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)
{
    
    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)
{
    


    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性色综合网| av亚洲精华国产精华| 亚洲一卡二卡三卡四卡五卡| 国产日产欧美一区二区视频| 欧美大片在线观看| 日韩片之四级片| 欧美www视频| 久久久久久毛片| 国产精品午夜春色av| 日韩毛片精品高清免费| 亚洲欧美成aⅴ人在线观看| 日韩毛片高清在线播放| 亚洲一区在线视频| 五月婷婷久久丁香| 狠狠色狠狠色综合| 成人午夜激情片| 色哟哟亚洲精品| 777欧美精品| 久久女同精品一区二区| 国产精品亲子乱子伦xxxx裸| 中文字幕一区免费在线观看 | 成人av午夜影院| 色综合天天综合狠狠| 国产精品黄色在线观看| 自拍偷拍欧美精品| 午夜精品久久久久| 国产精华液一区二区三区| 99久久久精品| 日韩欧美一区二区视频| 中文乱码免费一区二区| 亚洲电影一级黄| 国产麻豆午夜三级精品| 972aa.com艺术欧美| 在线综合亚洲欧美在线视频| 久久婷婷国产综合国色天香| 最新高清无码专区| 精品无码三级在线观看视频| 99精品黄色片免费大全| 欧美电影免费观看完整版| 亚洲四区在线观看| 久久99这里只有精品| 色视频欧美一区二区三区| 日韩欧美二区三区| 亚洲精品久久7777| 国产激情精品久久久第一区二区 | 偷拍与自拍一区| 风间由美性色一区二区三区| 欧美日韩国产大片| 亚洲国产成人一区二区三区| 日本亚洲最大的色成网站www| 成人丝袜18视频在线观看| 欧美一级高清片| 亚洲午夜精品网| 成人免费黄色在线| 亚洲精品在线一区二区| 五月激情综合婷婷| 色婷婷综合久久久中文字幕| 久久久综合激的五月天| 麻豆视频一区二区| 欧美日韩国产系列| 一区二区三区欧美日| 99国产精品国产精品毛片| 国产亚洲一区字幕| 国产一区二区影院| 欧美大片国产精品| 久久国产精品99精品国产| 欧美高清一级片在线| 亚洲国产视频在线| 欧美午夜精品一区二区三区| 国产精品久久久久久久岛一牛影视| 精品写真视频在线观看| 精品欧美一区二区三区精品久久| 三级不卡在线观看| 欧美精品电影在线播放| 日韩精品色哟哟| 欧美一区二区三区四区高清| 五月婷婷久久丁香| 69p69国产精品| 免费成人美女在线观看| 日韩久久精品一区| 黄色小说综合网站| 久久精品亚洲麻豆av一区二区| 韩国精品在线观看| 国产免费久久精品| 暴力调教一区二区三区| 亚洲欧美另类综合偷拍| 欧美四级电影网| 蜜臀av亚洲一区中文字幕| 日韩午夜在线影院| 国产精品123| 亚洲素人一区二区| 9191精品国产综合久久久久久| 琪琪一区二区三区| 国产日韩三级在线| 99视频有精品| 午夜久久福利影院| 精品欧美一区二区久久| zzijzzij亚洲日本少妇熟睡| 亚洲综合色噜噜狠狠| 91精品欧美一区二区三区综合在| 麻豆精品在线看| 1024成人网| 51精品秘密在线观看| 国产高清在线观看免费不卡| 日韩一区在线播放| 欧美顶级少妇做爰| 成人中文字幕合集| 午夜视频久久久久久| 精品少妇一区二区三区日产乱码| 成人美女视频在线观看| 水蜜桃久久夜色精品一区的特点| 2024国产精品| 欧美性大战xxxxx久久久| 国产成人精品免费在线| 亚洲一区二区三区美女| 久久色.com| 精品视频一区二区三区免费| 国产综合久久久久久鬼色| 亚洲激情在线激情| 国产色产综合色产在线视频| 69堂精品视频| 91免费视频观看| 国产精品一二三四| 日本伊人午夜精品| 亚洲国产精品久久艾草纯爱 | va亚洲va日韩不卡在线观看| 亚洲国产视频在线| 亚洲婷婷综合久久一本伊一区| 欧美一区二区三区在线电影| 白白色 亚洲乱淫| 激情都市一区二区| 五月激情综合色| 一区二区三区四区不卡在线| 欧美国产97人人爽人人喊| 精品久久免费看| 欧美一区二区三区在线观看| 色婷婷久久久久swag精品| 国产福利一区在线| 极品少妇xxxx精品少妇| 丝袜诱惑制服诱惑色一区在线观看| 中文字幕一区二区三区精华液 | 中文字幕在线一区| 久久久久国产一区二区三区四区| 欧美色倩网站大全免费| 在线一区二区三区四区五区| 成人动漫av在线| 国产成人av电影在线观看| 国产一区欧美日韩| 国产在线精品不卡| 国产裸体歌舞团一区二区| 久久99久国产精品黄毛片色诱| 奇米一区二区三区| 丝袜美腿亚洲一区二区图片| 天天综合天天做天天综合| 午夜电影久久久| 午夜成人在线视频| 另类综合日韩欧美亚洲| 久久99久久99| 国产a久久麻豆| 白白色亚洲国产精品| 一本到不卡免费一区二区| 91福利在线看| 777色狠狠一区二区三区| 91精品国产91久久久久久最新毛片| 欧美精品一二三区| wwwwxxxxx欧美| 国产精品三级视频| 亚洲手机成人高清视频| 亚洲成人激情自拍| 麻豆免费精品视频| 成人爱爱电影网址| 欧美日韩国产首页| 精品伦理精品一区| 亚洲国产成人在线| 一区二区三区高清| 伦理电影国产精品| 国产成人精品午夜视频免费| 91久久精品一区二区三| 日韩久久免费av| 亚洲人成亚洲人成在线观看图片| 一区二区三区四区国产精品| 毛片一区二区三区| 成人性生交大片免费看视频在线 | 色婷婷久久久久swag精品 | 麻豆成人91精品二区三区| 国产乱理伦片在线观看夜一区| 成人av小说网| 日韩一级二级三级| 中文字幕的久久| 日本中文在线一区| 懂色av一区二区夜夜嗨| 欧美日本在线播放| 国产免费久久精品| 美女视频免费一区| 91首页免费视频| 亚洲精品在线一区二区| 性做久久久久久久久| 国产成人h网站| 51午夜精品国产| 亚洲影视在线播放|