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

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

?? os_time.c

?? c代碼的操作系統 已經移植使用到產品上的內核
?? 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) reentrant
{
    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) reentrant
{
    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) reentrant
{
    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) reentrant
{
    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) reentrant
{
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
另类小说视频一区二区| 免费观看成人av| 中文字幕+乱码+中文字幕一区| 日韩一区二区三区高清免费看看| 欧美乱熟臀69xxxxxx| 在线播放视频一区| 欧美一区二区视频在线观看2020| 欧美一级久久久久久久大片| 91精品国模一区二区三区| 欧美一二区视频| 2017欧美狠狠色| 国产精品久久国产精麻豆99网站| 日韩毛片一二三区| 亚洲成在人线在线播放| 免费观看在线综合| 成人少妇影院yyyy| 91同城在线观看| 717成人午夜免费福利电影| 欧美va在线播放| 中日韩免费视频中文字幕| 亚洲六月丁香色婷婷综合久久| 亚洲综合在线观看视频| 麻豆精品久久精品色综合| 国产一区二区三区精品视频 | 在线看国产一区| 欧美一区二区三区在| 欧美精品一区二区三区在线播放 | 美女脱光内衣内裤视频久久影院| 国产乱理伦片在线观看夜一区| 成人精品鲁一区一区二区| 欧美色偷偷大香| 久久麻豆一区二区| 亚洲精品视频一区| 久久黄色级2电影| 不卡av电影在线播放| 欧美日韩精品一区视频| 久久精品夜夜夜夜久久| 亚洲综合一区在线| 国产成a人亚洲| 欧美精品一二三| 国产精品电影一区二区三区| 热久久国产精品| 欧洲日韩一区二区三区| 久久婷婷国产综合精品青草| 亚洲国产欧美在线人成| 国产成人在线免费观看| 91精品国产综合久久久久久久久久| 久久九九99视频| 日本中文在线一区| 欧美在线三级电影| 国产精品视频在线看| 美国av一区二区| 欧美日韩和欧美的一区二区| 国产精品福利一区| 国产宾馆实践打屁股91| 日韩三级.com| 免费观看在线综合色| 精品视频一区三区九区| 一区二区三区波多野结衣在线观看| 国产精品自拍毛片| 2021国产精品久久精品| 日本中文字幕一区二区视频| 欧美女孩性生活视频| 亚洲图片欧美综合| 在线亚洲免费视频| 一区二区在线观看视频在线观看| 成人高清在线视频| 中文一区在线播放| 国产成人免费网站| 欧美激情一区在线观看| 国产成人综合视频| 国产精品美日韩| 99麻豆久久久国产精品免费| 国产精品理论片在线观看| 高清在线不卡av| 国产精品美女久久久久久2018| 国产**成人网毛片九色| 国产精品免费免费| 在线精品视频免费播放| 亚洲图片一区二区| 日韩一区二区免费高清| 久热成人在线视频| 久久久精品蜜桃| fc2成人免费人成在线观看播放 | 欧美日韩亚洲另类| 日本不卡在线视频| 亚洲精品在线免费观看视频| 粉嫩欧美一区二区三区高清影视| 欧美国产日韩a欧美在线观看| 91丨porny丨最新| 一区二区三区视频在线观看| 欧美日韩精品一区二区三区四区| 日日夜夜免费精品| www久久精品| 91色在线porny| 婷婷国产在线综合| 久久久精品一品道一区| 91麻豆免费视频| 天堂在线亚洲视频| 亚洲精品在线电影| 91在线一区二区| 亚洲成人久久影院| 久久噜噜亚洲综合| 欧美天堂亚洲电影院在线播放| 日韩专区中文字幕一区二区| 精品美女一区二区| 91久久人澡人人添人人爽欧美| 日韩精品亚洲一区| 国产精品入口麻豆原神| 欧美日韩国产在线播放网站| 国产精品一区三区| 亚洲一区二区三区影院| 久久久欧美精品sm网站| 欧美日韩精品一区二区三区 | www.一区二区| 日本免费新一区视频| 日本一区二区成人| 日本精品一级二级| 国产成人午夜99999| 丝袜亚洲另类丝袜在线| 国产精品久久久久一区二区三区 | 亚洲欧洲成人av每日更新| 欧美精品在线视频| 色综合中文字幕| 国产成人亚洲精品狼色在线| 亚洲1区2区3区4区| 国产精品不卡在线| 久久综合久久综合久久| 777亚洲妇女| 欧美视频一区在线| 成人av在线一区二区三区| 青青草国产精品亚洲专区无| 一二三四区精品视频| 国产精品网曝门| 精品久久人人做人人爰| 欧美一区二区三区不卡| 欧洲色大大久久| 91国偷自产一区二区三区成为亚洲经典 | 成人高清视频在线观看| 久久国产乱子精品免费女| 亚洲www啪成人一区二区麻豆| 亚洲天堂久久久久久久| 国产精品女人毛片| 欧美激情一区在线| 久久久电影一区二区三区| 精品国产乱码久久久久久1区2区 | 久久99深爱久久99精品| 奇米一区二区三区av| 日韩国产精品91| 日本aⅴ精品一区二区三区| 午夜天堂影视香蕉久久| 日韩激情一二三区| 日韩精品一二三| 美日韩黄色大片| 国内精品久久久久影院薰衣草| 久久91精品久久久久久秒播| 久久成人麻豆午夜电影| 麻豆精品精品国产自在97香蕉| 美女视频一区在线观看| 国产一区二区三区蝌蚪| 成人污污视频在线观看| av成人免费在线观看| 色视频一区二区| 欧美日韩一区二区三区四区五区| 欧美三区在线视频| 日韩精品中文字幕在线不卡尤物| 日韩欧美一区在线| 国产日韩精品一区二区三区 | 久久影视一区二区| 久久久久久久久久久久久女国产乱| 欧美成人精精品一区二区频| 26uuu国产电影一区二区| 国产色婷婷亚洲99精品小说| 国产精品成人免费在线| 亚洲国产一区二区三区| 麻豆精品视频在线观看| 粉嫩高潮美女一区二区三区| 91视频国产观看| 宅男在线国产精品| 欧美激情一区二区| 亚洲在线成人精品| 喷水一区二区三区| 高清成人免费视频| 欧美视频第二页| 久久亚区不卡日本| 一区二区三区中文在线观看| 日韩影视精彩在线| 大胆亚洲人体视频| 欧美精品电影在线播放| 国产日韩欧美不卡在线| av成人老司机| 懂色中文一区二区在线播放| 成人av资源网站| 337p亚洲精品色噜噜噜| 国产精品久久免费看| 看片网站欧美日韩| 日本韩国精品在线| 国产亚洲精品超碰| 亚洲国产欧美另类丝袜| 国产高清无密码一区二区三区|