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

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

?? os_time.c

?? AVR的UCO/S-II
?? 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 OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    


    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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    


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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天做天天爱| 欧美精品一区二区高清在线观看| 欧美亚洲国产一卡| 久久亚洲影视婷婷| 图片区小说区国产精品视频| 国产91精品免费| 欧美日本国产视频| 综合激情网...| 久久成人麻豆午夜电影| 欧美亚洲另类激情小说| 国产精品情趣视频| 国产精品2024| 欧美一二三四区在线| 亚洲图片自拍偷拍| 91免费版在线| 欧美国产激情一区二区三区蜜月| 青青青爽久久午夜综合久久午夜| 色婷婷激情综合| 国产精品美女久久久久久久| 激情综合五月婷婷| 日韩欧美视频在线| 五月婷婷综合在线| 欧美色图12p| 亚洲成av人影院| 99精品一区二区| 日本一区二区三区久久久久久久久不| 日韩1区2区3区| 在线播放中文字幕一区| 亚洲成a人v欧美综合天堂| 色欧美乱欧美15图片| 亚洲同性gay激情无套| 97久久精品人人澡人人爽| 26uuu另类欧美亚洲曰本| 激情久久五月天| 欧美不卡在线视频| 久久国产尿小便嘘嘘尿| 日韩视频免费观看高清在线视频| 日韩精品一级二级| 日韩一区二区在线看片| 日韩国产精品久久久| 日韩欧美视频一区| 极品美女销魂一区二区三区免费 | 一二三四社区欧美黄| 91社区在线播放| 亚洲自拍偷拍九九九| 欧美日韩国产综合一区二区三区| 亚洲电影在线免费观看| 91精品国模一区二区三区| 美女精品自拍一二三四| 久久先锋资源网| 99久久精品国产网站| 亚洲国产aⅴ天堂久久| 日韩欧美国产午夜精品| 国产在线一区二区| **性色生活片久久毛片| 欧美日韩亚州综合| 九色综合狠狠综合久久| 国产精品卡一卡二卡三| 欧美日韩亚洲国产综合| 韩国女主播一区| 亚洲欧美日韩久久精品| 欧美日本免费一区二区三区| 国产一区中文字幕| 一区二区三区四区激情 | 日韩vs国产vs欧美| 久久综合九色综合欧美就去吻| 成人午夜视频网站| 天天做天天摸天天爽国产一区| 欧美大度的电影原声| 91蝌蚪porny九色| 日本女优在线视频一区二区| 国产婷婷一区二区| 欧美日韩精品福利| 粉嫩欧美一区二区三区高清影视| 亚洲综合在线观看视频| 26uuu亚洲| 欧美日韩中文国产| 成人免费高清在线| 日本美女一区二区三区| 亚洲女同女同女同女同女同69| 日韩你懂的在线观看| 91久久精品一区二区| 国产真实乱对白精彩久久| 午夜精品福利一区二区三区av | 国产自产视频一区二区三区| 亚洲综合男人的天堂| 国产农村妇女毛片精品久久麻豆| 7777精品伊人久久久大香线蕉经典版下载| 国产成人免费在线观看不卡| 免费在线观看一区| 亚洲在线视频网站| 中文字幕制服丝袜一区二区三区 | 国产亚洲综合色| 欧美一区三区四区| 欧美色图天堂网| 91丝袜高跟美女视频| 国产成人一区二区精品非洲| 美腿丝袜亚洲三区| 亚洲伊人色欲综合网| 亚洲精品写真福利| 亚洲人成亚洲人成在线观看图片| 久久夜色精品国产欧美乱极品| 欧美日韩高清一区二区不卡 | 99久久婷婷国产精品综合| 国产麻豆成人精品| 成人一区二区三区视频在线观看 | 欧美一区二区视频在线观看| 在线看日韩精品电影| 色综合av在线| 在线亚洲一区观看| 在线亚洲欧美专区二区| 91久久精品一区二区| 色伊人久久综合中文字幕| 91性感美女视频| 99久久er热在这里只有精品15| 成人av午夜影院| 99视频国产精品| 91在线一区二区三区| 99精品欧美一区二区蜜桃免费 | 国产在线一区二区| 狠狠色狠狠色综合系列| 国产一区二区三区日韩| 国产大片一区二区| 9l国产精品久久久久麻豆| av一二三不卡影片| 色悠久久久久综合欧美99| 91久久精品日日躁夜夜躁欧美| 色偷偷88欧美精品久久久| 精品视频一区二区三区免费| 欧美电影影音先锋| 欧美精品一区二区三区蜜桃 | 国产精品影视在线观看| 国产精品一级片| 色先锋aa成人| 欧美丝袜丝交足nylons图片| 91精品啪在线观看国产60岁| 日韩欧美二区三区| 国产日韩欧美在线一区| 国产精品国产精品国产专区不蜜| 夜夜亚洲天天久久| 久久电影国产免费久久电影| 成人性色生活片免费看爆迷你毛片| 99久久精品国产网站| 欧美日韩国产a| 久久久久久夜精品精品免费| 国产精品福利一区二区三区| 亚洲网友自拍偷拍| 国产成人无遮挡在线视频| 一本到三区不卡视频| 欧美一级欧美三级在线观看| 久久久国产精华| 亚洲一二三区视频在线观看| 久99久精品视频免费观看| 99re视频精品| 精品成人在线观看| 伊人一区二区三区| 国产一区在线观看视频| 在线观看不卡视频| 国产午夜精品美女毛片视频| 一区二区三区高清在线| 激情av综合网| 欧美日韩三级在线| 国产精品毛片大码女人| 日韩二区三区四区| 白白色 亚洲乱淫| 日韩一级成人av| 亚洲精品国产品国语在线app| 精品亚洲国内自在自线福利| 91浏览器入口在线观看| 国产网站一区二区| 青青草国产成人99久久| 色噜噜狠狠色综合中国| 国产欧美日韩在线观看| 青青草91视频| 在线观看欧美精品| 国产精品国产三级国产普通话99 | 午夜av电影一区| 91浏览器入口在线观看| 欧美激情艳妇裸体舞| 国产一区二区调教| 日韩免费在线观看| 日韩制服丝袜av| 欧美在线观看视频一区二区三区| 久久蜜桃一区二区| 久久69国产一区二区蜜臀| 欧美一区二区三区在线观看视频| 亚洲伊人色欲综合网| 色一区在线观看| 亚洲婷婷国产精品电影人久久| 国产在线看一区| 欧美成人福利视频| 日本成人在线网站| 欧美精品一级二级| 亚洲午夜激情网页| 欧美日韩国产天堂| 污片在线观看一区二区| 欧美午夜一区二区| 无吗不卡中文字幕| 欧美一区二区三区四区五区| 日韩一区精品视频|