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

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

?? os_time.c

?? uc/os2.52源代碼 基于ARM7實驗箱平臺
?? 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 "..\APP\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一区二区三区免费野_久草精品视频
91麻豆蜜桃一区二区三区| 色综合天天在线| 日韩一级黄色大片| 国产裸体歌舞团一区二区| 亚洲精品日日夜夜| 日韩免费高清电影| 91浏览器打开| 91老师片黄在线观看| 色综合天天综合| 欧美色综合天天久久综合精品| 国产精品综合久久| 日韩电影一区二区三区| 综合久久综合久久| 久久精品无码一区二区三区| 欧美精三区欧美精三区| 成人国产视频在线观看| 九九**精品视频免费播放| 一区二区三区91| 中文字幕亚洲欧美在线不卡| www国产成人| 日韩欧美不卡在线观看视频| 国产人久久人人人人爽| 欧美精品日韩精品| 精品国产免费一区二区三区四区| 在线观看视频91| 99免费精品视频| 国产成人啪午夜精品网站男同| 美国十次了思思久久精品导航| 亚洲bt欧美bt精品| 亚洲国产视频在线| 亚洲国产视频在线| 国产美女精品在线| 色94色欧美sute亚洲线路二| jizz一区二区| 欧美区视频在线观看| 欧美图区在线视频| 久久综合久久综合久久| 亚洲免费看黄网站| 亚洲在线一区二区三区| 一区二区三区欧美日韩| 经典三级视频一区| 在线看国产一区| 国产女同互慰高潮91漫画| 一区二区三区不卡视频| 粉嫩av一区二区三区粉嫩 | www.av精品| 欧美男人的天堂一二区| 亚洲国产成人在线| 国产精品成人一区二区三区夜夜夜| 国产精品视频一二| 亚洲色大成网站www久久九九| 日韩福利电影在线| 91麻豆免费视频| 日本一区二区三区电影| 日韩国产精品大片| 91视频国产资源| 国产欧美精品一区aⅴ影院 | 国产精品私人影院| 蜜桃av一区二区三区| 91国产福利在线| ...av二区三区久久精品| 国产一区二区精品在线观看| 日韩视频123| 日韩精品电影在线观看| 久久99精品久久久久| 精品视频资源站| 26uuuu精品一区二区| 日日摸夜夜添夜夜添精品视频| 色悠悠久久综合| 精品久久久久一区二区国产| 亚洲色图一区二区| 成人av在线播放网站| 中文字幕第一页久久| 国产一区二区免费视频| 久久久久久99精品| 视频在线在亚洲| 91超碰这里只有精品国产| 国产清纯美女被跳蛋高潮一区二区久久w| 日本不卡视频在线| 色综合中文综合网| 亚洲伦在线观看| 91视频国产资源| 亚洲精品视频免费看| 在线观看日韩电影| 亚洲一区二区在线免费看| 欧美日韩精品免费观看视频| 亚洲国产欧美在线人成| 欧美精品乱码久久久久久按摩| 亚洲国产一区在线观看| 91精品国产综合久久精品麻豆| 日本欧美肥老太交大片| 欧美一级片免费看| 亚洲一区在线观看免费| 欧美日韩国产123区| 老司机午夜精品99久久| 欧美区一区二区三区| 蜜桃视频免费观看一区| 国产日韩欧美电影| 91在线精品一区二区| 欧美韩国日本不卡| 91麻豆免费视频| 日韩电影一区二区三区四区| 久久精品一区二区三区不卡牛牛| 成人黄色一级视频| 亚洲一区二区三区四区的| 精品久久久久久久久久久久久久久| 国产在线不卡一区| 亚洲综合在线电影| 精品国产免费一区二区三区四区| 不卡av电影在线播放| 午夜久久久久久电影| 欧美日韩三级在线| 国产乱人伦偷精品视频免下载| 亚洲色图在线播放| 精品久久久久久久久久久久包黑料 | 精品女同一区二区| 99精品视频在线观看| 青青草国产成人av片免费| 亚洲国产精品成人久久综合一区| 欧美在线观看视频一区二区| 久久99精品久久久久久| 亚洲综合视频在线观看| 国产欧美精品在线观看| 日韩午夜三级在线| 91在线码无精品| 国产综合成人久久大片91| 26uuu另类欧美亚洲曰本| 在线观看不卡一区| 成人性生交大片免费看视频在线| 国产精品伦一区二区三级视频| 欧美日韩国产成人在线91| 成人午夜在线免费| 九九热在线视频观看这里只有精品| 亚洲欧美激情插| 欧美国产在线观看| 久久这里只精品最新地址| 欧美日韩精品是欧美日韩精品| www.久久精品| 成人av网站免费| 粉嫩av一区二区三区在线播放 | 樱花影视一区二区| 国产精品不卡视频| 亚洲国产经典视频| 国产清纯在线一区二区www| 26uuu另类欧美| 久久亚洲综合色一区二区三区| 欧美一区二区三区不卡| 51久久夜色精品国产麻豆| 6080亚洲精品一区二区| 在线观看91精品国产入口| 在线观看视频欧美| 欧美丝袜第三区| 欧美日韩免费观看一区二区三区| 色婷婷久久综合| 色狠狠综合天天综合综合| 一道本成人在线| 欧美亚洲精品一区| 欧美日本视频在线| 欧美日韩亚洲综合| 欧美群妇大交群的观看方式| 欧美区在线观看| 欧美电视剧免费观看| 日韩视频在线永久播放| 精品sm在线观看| 久久精品亚洲麻豆av一区二区 | 2019国产精品| 欧美国产精品一区二区三区| 国产女同性恋一区二区| 亚洲欧美综合色| 亚洲国产精品一区二区www| 日本特黄久久久高潮| 精品中文字幕一区二区| 国产成人精品免费网站| 色综合色综合色综合色综合色综合 | 日韩欧美一级片| 久久精品欧美日韩精品| 中文字幕一区二区三区四区| 一区二区三区影院| 日韩va亚洲va欧美va久久| 国模无码大尺度一区二区三区| 国产suv精品一区二区6| 91蝌蚪porny九色| 日韩一区二区免费在线电影| 国产午夜精品一区二区三区四区| 亚洲丝袜制服诱惑| 日本sm残虐另类| 99re66热这里只有精品3直播 | 亚洲欧美一区二区久久| 免费成人在线视频观看| 国产精品小仙女| 在线观看www91| 国产欧美日韩精品一区| 午夜精品aaa| 成人深夜视频在线观看| 欧美剧情片在线观看| 中文文精品字幕一区二区| 日韩专区在线视频| 91影院在线观看| 日韩精品一区二区三区swag| 亚洲欧美电影一区二区|