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

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

?? os_time.c

?? protues仿真ARM ARM的I2C
?? 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    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷综合久久久久中文| 麻豆精品一区二区av白丝在线| 黑人精品欧美一区二区蜜桃| 91精品国产一区二区三区蜜臀| 日本在线播放一区二区三区| 日韩午夜激情免费电影| 精品一区二区三区的国产在线播放| www激情久久| 99视频一区二区三区| 亚洲自拍偷拍九九九| 欧美人妇做爰xxxⅹ性高电影| 久久成人久久鬼色| 国产精品久久久久久久久动漫| 99久久精品国产精品久久| 亚洲午夜国产一区99re久久| 日韩欧美精品在线视频| 波多野结衣中文字幕一区| 一区二区三区不卡视频| 日韩美女一区二区三区| 成人午夜私人影院| 亚洲一区在线观看视频| 欧美精品一区二区三区四区| av中文一区二区三区| 亚洲福利一二三区| 欧美高清在线一区二区| 欧美日韩视频专区在线播放| 精品中文字幕一区二区| 中文字幕综合网| 日韩精品一区二区三区视频播放 | 亚洲一区二区偷拍精品| 欧美不卡一二三| 色香蕉成人二区免费| 精品一区二区三区视频在线观看 | 日韩中文字幕区一区有砖一区 | 日韩和的一区二区| 国产精品美日韩| 日韩一区二区视频在线观看| av在线播放一区二区三区| 日本怡春院一区二区| 日韩毛片在线免费观看| 日韩精品在线一区| 日本精品裸体写真集在线观看 | 欧美成人一区二区三区片免费 | 99久久伊人久久99| 亚洲成人激情综合网| 在线看不卡av| 国产一区中文字幕| 日韩精品高清不卡| 欧美不卡视频一区| 奇米精品一区二区三区在线观看| 91麻豆精品国产91久久久久| 91精品国产91久久综合桃花| 日韩视频一区二区三区在线播放 | 免费成人av在线| 国产一区二区三区黄视频| 国产风韵犹存在线视精品| 成人动漫精品一区二区| 色狠狠综合天天综合综合| 欧美日本在线观看| 久久婷婷一区二区三区| 亚洲欧美综合在线精品| 亚洲一区视频在线观看视频| 蜜臀av性久久久久蜜臀aⅴ| 国产最新精品精品你懂的| 波多野结衣一区二区三区| 欧美中文一区二区三区| 欧美不卡一区二区三区四区| 中文字幕第一区| 亚洲va天堂va国产va久| 国产精品一区二区三区乱码 | 日本韩国一区二区三区视频| 91麻豆精品国产91久久久久久| 久久你懂得1024| 轻轻草成人在线| 成人小视频免费在线观看| 欧美性大战久久| 久久色.com| 亚洲人精品一区| 免费观看成人av| 成人aa视频在线观看| 欧美日韩大陆在线| 国产欧美日韩视频在线观看| 亚洲成在人线在线播放| 国产91露脸合集magnet| 精品视频全国免费看| 欧美激情综合在线| 日本欧美加勒比视频| 不卡的av在线播放| 欧美一级黄色片| 亚洲欧美日韩电影| 国产在线视频不卡二| 欧美午夜精品久久久| 欧美国产成人精品| 免费成人在线观看| 在线观看免费成人| 国产精品乱码人人做人人爱| 青青草91视频| 在线观看日韩精品| 国产精品电影一区二区| 韩国v欧美v日本v亚洲v| 欧美美女网站色| 樱花影视一区二区| 成人理论电影网| 精品国产不卡一区二区三区| 午夜影院在线观看欧美| 91麻豆swag| 国产精品无遮挡| 国产精品123| 欧美电影精品一区二区| 日韩国产成人精品| 91久久国产最好的精华液| 国产精品美女视频| 国产成人在线免费| 日韩欧美国产电影| 男人操女人的视频在线观看欧美| 欧美特级限制片免费在线观看| 亚洲图片另类小说| 成人av电影在线| 中文字幕第一区| 成人永久aaa| 国产网站一区二区| 国产成人午夜片在线观看高清观看| 精品成人一区二区三区| 免费在线看成人av| 日韩欧美一区二区免费| 麻豆成人久久精品二区三区红 | 蜜臀av一区二区| 欧美肥妇free| 日本欧美韩国一区三区| 欧美在线免费视屏| 亚洲福利一区二区| 制服丝袜av成人在线看| 日韩在线卡一卡二| 日韩视频在线一区二区| 免费高清在线一区| 精品久久人人做人人爽| 国产一区二区三区四| 国产日韩欧美高清在线| 菠萝蜜视频在线观看一区| 亚洲天堂网中文字| 欧美视频在线不卡| 免费av网站大全久久| 精品1区2区在线观看| 国产福利一区在线| 国产精品久久影院| 欧美性xxxxxx少妇| 日韩电影免费一区| 久久综合久久综合亚洲| 国产69精品久久777的优势| 国产女主播视频一区二区| av中文一区二区三区| 亚洲午夜在线电影| 日韩午夜小视频| 国产91精品免费| 一区二区三区精品久久久| 欧美日韩免费视频| 韩国av一区二区| 国产精品妹子av| 欧美日韩国产在线播放网站| 久久电影网站中文字幕| 国产欧美日本一区视频| 91国产视频在线观看| 美女一区二区久久| 欧美激情艳妇裸体舞| 91久久线看在观草草青青| 青娱乐精品视频在线| 中文字幕乱码久久午夜不卡| 日本久久电影网| 韩日av一区二区| 亚洲日本va午夜在线电影| 欧美久久久久久久久中文字幕| 国产在线精品不卡| 亚洲免费大片在线观看| 欧美一区二区三区视频在线 | 一区二区免费看| 精品剧情在线观看| 91浏览器在线视频| 久久99久久99精品免视看婷婷 | 亚洲国产欧美日韩另类综合| 精品三级在线观看| 色欲综合视频天天天| 狠狠色综合日日| 亚洲国产一区视频| 国产亚洲精品aa| 91麻豆精品国产无毒不卡在线观看 | 亚洲人一二三区| 久久影院午夜论| 欧美日韩专区在线| 成人国产精品视频| 精品一区二区三区在线播放视频| 亚洲精品免费在线观看| xvideos.蜜桃一区二区| 色狠狠桃花综合| 成人黄色网址在线观看| 麻豆国产精品777777在线| 亚洲精品老司机| 国产精品伦一区| 久久久777精品电影网影网| 7777精品伊人久久久大香线蕉的 | 欧美色爱综合网|