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

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

?? os_time.c

?? 給一個調試好的UCOS源代碼與大家分享
?? 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();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
五月开心婷婷久久| 久久久久国产成人精品亚洲午夜| 欧美视频日韩视频| 日韩一级黄色大片| 久久影视一区二区| 亚洲视频 欧洲视频| 日韩不卡一区二区| 国产91丝袜在线播放| 色猫猫国产区一区二在线视频| 欧美女孩性生活视频| 久久精品男人的天堂| 一区二区三区在线观看动漫| 久久国产三级精品| 成人精品gif动图一区| 欧美肥妇free| 国产欧美精品一区| 偷拍日韩校园综合在线| 粉嫩aⅴ一区二区三区四区| 欧美日韩精品一区二区天天拍小说| 99精品视频中文字幕| 欧美一区二区三区播放老司机| 欧美国产1区2区| 日韩在线播放一区二区| 丰满亚洲少妇av| 欧美二区三区91| 国产精品久久久久9999吃药| 奇米在线7777在线精品| 日本丶国产丶欧美色综合| 久久人人爽人人爽| 五月婷婷激情综合| av一区二区不卡| 欧美大黄免费观看| 亚洲第一电影网| av一区二区三区在线| 久久蜜臀精品av| 日本一不卡视频| 欧洲激情一区二区| 国产精品麻豆视频| 国产麻豆视频精品| 欧美一区二区三区婷婷月色| 亚洲狼人国产精品| 成人蜜臀av电影| 久久日韩粉嫩一区二区三区| 日韩av在线播放中文字幕| 91搞黄在线观看| 亚洲欧洲成人精品av97| 国产乱人伦偷精品视频不卡| 欧美一级日韩不卡播放免费| 亚洲一区二区三区自拍| av不卡一区二区三区| 国产蜜臀97一区二区三区| 韩国成人在线视频| 欧美一区二区福利在线| 综合自拍亚洲综合图不卡区| 国产激情一区二区三区桃花岛亚洲| 日韩一区二区三区视频| 亚洲18色成人| 欧洲一区二区三区在线| 国产精品久久国产精麻豆99网站| 国产一区二区三区免费观看| 成人av电影在线观看| 黄一区二区三区| 亚洲美女区一区| 欧美一二三在线| 久久99国产精品久久99 | av不卡免费在线观看| 国产精品二区一区二区aⅴ污介绍| 欧美在线高清视频| 蜜臀91精品一区二区三区| 国产一区二区视频在线| 国产suv一区二区三区88区| 国产精品五月天| 538prom精品视频线放| 亚洲电影激情视频网站| 日韩免费观看高清完整版| 国精产品一区一区三区mba视频| 日韩一区二区免费视频| youjizz久久| 狠狠色狠狠色综合系列| 国产成人免费在线| 成人国产精品免费观看动漫| 奇米影视一区二区三区小说| 日韩专区中文字幕一区二区| 久久久亚洲精品石原莉奈| 91在线视频播放地址| 免费高清不卡av| 亚洲一区在线播放| 日本一区二区在线不卡| 欧美日韩国产一级| 成人国产精品免费观看视频| 久久99精品久久只有精品| 亚洲人成网站精品片在线观看| 日韩区在线观看| 色综合av在线| 成人av在线观| 国产在线不卡一区| 日韩中文字幕一区二区三区| 中文一区二区完整视频在线观看| 欧美伊人精品成人久久综合97| 国产成人av在线影院| 美女任你摸久久 | 一区二区三区在线视频免费 | 国产精品视频免费看| 国产精品你懂的| 国产亚洲女人久久久久毛片| 日韩女优视频免费观看| 日韩欧美一区二区久久婷婷| 色久优优欧美色久优优| 国产成人精品免费视频网站| 麻豆专区一区二区三区四区五区| 亚洲乱码中文字幕综合| 天天色天天爱天天射综合| 色婷婷一区二区三区四区| 日韩免费福利电影在线观看| 一区二区三区蜜桃网| 欧美夫妻性生活| 波多野结衣中文字幕一区| 亚洲成人午夜影院| 久久精品视频在线看| 在线看国产一区二区| 经典一区二区三区| 亚洲色图一区二区三区| 91.xcao| 久久av中文字幕片| 国内精品久久久久影院一蜜桃| 久久www免费人成看片高清| 久88久久88久久久| 国产夫妻精品视频| 亚洲色图欧洲色图| 亚洲三级在线看| 午夜影院在线观看欧美| 成人在线综合网| 精品视频1区2区| 日本欧美一区二区三区乱码| 粉嫩欧美一区二区三区高清影视| 欧美视频一二三区| 日韩精品一二三四| 在线不卡免费av| 精品一区二区三区影院在线午夜 | 91精品国产综合久久香蕉麻豆| 欧美一区二区大片| 亚洲视频免费在线观看| 精品无码三级在线观看视频| 国产精品一区在线观看你懂的| 97精品久久久午夜一区二区三区 | 成人av在线网站| 国产高清成人在线| 亚洲一区免费观看| 国产精品你懂的| 日韩欧美在线网站| 欧美日韩中文精品| aaa亚洲精品| 国产黄色91视频| 久久精品国产久精国产| 亚洲尤物视频在线| 亚洲色图欧洲色图| 中文av字幕一区| 26uuu欧美日本| 欧美一区二区三区在线看| 色综合一区二区三区| 国产成人精品影视| 国产在线麻豆精品观看| 日韩精品一卡二卡三卡四卡无卡| 一区二区三区毛片| 亚洲激情av在线| 亚洲天堂成人网| 亚洲天堂成人在线观看| 国产精品成人免费在线| 久久久国产一区二区三区四区小说| 日韩欧美一二三区| 欧美一区日本一区韩国一区| 欧美日精品一区视频| 欧洲在线/亚洲| 欧美专区亚洲专区| 欧美无人高清视频在线观看| 色综合久久天天| 色综合激情久久| 色网站国产精品| 91麻豆swag| 日本伦理一区二区| 在线免费观看不卡av| 在线观看一区二区视频| 日本韩国欧美三级| 91高清在线观看| 欧美日韩一卡二卡三卡 | 亚洲观看高清完整版在线观看 | 色综合中文字幕| 在线中文字幕不卡| 欧美写真视频网站| 欧美美女激情18p| 欧美高清性hdvideosex| 日韩欧美一区二区视频| 日韩欧美专区在线| 久久精品网站免费观看| 国产精品免费久久| 亚洲精品免费电影| 图片区小说区国产精品视频 | 久久久99精品久久| 国产精品视频一区二区三区不卡| 国产精品乱码人人做人人爱|