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

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

?? os_time.c

?? arm與ucos的經典仿真
?? 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一区二区三区免费野_久草精品视频
精品一区精品二区高清| 中文文精品字幕一区二区| 中文字幕在线不卡视频| 欧美另类久久久品| 北条麻妃国产九九精品视频| 国产精品一区二区三区99| 国产福利视频一区二区三区| 国产经典欧美精品| 91网站黄www| 欧美日韩一区成人| 91麻豆精品国产| 精品国产91九色蝌蚪| 国产精品盗摄一区二区三区| 依依成人综合视频| 免费观看一级特黄欧美大片| 粉嫩高潮美女一区二区三区 | 亚洲第一在线综合网站| 欧美电视剧在线观看完整版| 色婷婷综合五月| 不卡一区二区三区四区| 男男gaygay亚洲| 国产真实乱子伦精品视频| 成人午夜免费av| 欧美年轻男男videosbes| 波多野结衣中文字幕一区| 日韩—二三区免费观看av| 国产精品乱人伦中文| 中文字幕一区在线| 亚洲视频1区2区| 国产精品网站导航| 亚洲综合av网| 国产精品自拍在线| 欧美日韩视频一区二区| 欧美国产成人在线| 精品一区二区综合| 正在播放亚洲一区| 亚洲精品视频在线观看网站| 国产乱国产乱300精品| 欧美三级资源在线| 亚洲成va人在线观看| 日本韩国欧美在线| 亚洲欧洲av另类| 成人精品国产一区二区4080| 久久综合久久99| 寂寞少妇一区二区三区| 日韩三级视频在线看| 性做久久久久久久免费看| 91国偷自产一区二区使用方法| 国产精品久久久久久久久免费相片 | 麻豆精品视频在线观看免费| 在线观看一区二区视频| 午夜欧美大尺度福利影院在线看| 在线观看日韩毛片| 午夜精品视频在线观看| 欧美一卡二卡三卡四卡| 精品一区二区久久| 国产欧美日韩三区| 欧美在线观看一二区| 日韩中文字幕亚洲一区二区va在线| 在线播放欧美女士性生活| 日韩精品电影一区亚洲| 久久久高清一区二区三区| 久久精品国产亚洲aⅴ| 久久综合国产精品| 欧美日韩亚洲不卡| 久久国产精品一区二区| 亚洲黄网站在线观看| 精品少妇一区二区三区视频免付费| 国产·精品毛片| 日韩不卡手机在线v区| 国产精品毛片大码女人| 91精品国产aⅴ一区二区| 国产麻豆精品视频| 亚洲成人av电影在线| 中文字幕一区二区三区在线不卡| 91精品国产综合久久小美女| 成人小视频在线| 国产一区999| 天天爽夜夜爽夜夜爽精品视频| 国产亚洲美州欧州综合国| 欧美日韩黄色一区二区| 91网站最新地址| 成人在线视频一区| 国产激情91久久精品导航| 久久机这里只有精品| 蜜臀久久99精品久久久久宅男| 亚洲免费视频中文字幕| 亚洲人妖av一区二区| 中文乱码免费一区二区| 国产精品午夜电影| 国产精品视频免费| 国产精品久久久久毛片软件| 国产日韩欧美高清| 国产日产欧美一区| 欧美国产日本韩| 亚洲色欲色欲www| 亚洲三级免费电影| 五月婷婷综合网| 久久99精品久久久久久久久久久久 | 欧洲精品在线观看| 欧美日韩黄色一区二区| 精品久久久久一区二区国产| 久久久久久日产精品| 国产精品传媒视频| 亚洲妇熟xx妇色黄| 理论片日本一区| av一区二区三区黑人| 欧美系列在线观看| 日韩欧美国产午夜精品| 日本不卡视频在线| 久久99国内精品| 色诱视频网站一区| 777色狠狠一区二区三区| 久久伊人中文字幕| 亚洲欧美另类在线| 国模娜娜一区二区三区| 色爱区综合激月婷婷| 精品对白一区国产伦| 亚洲午夜视频在线| 国产亚洲欧美日韩日本| 欧美va在线播放| 久久这里只有精品6| 亚洲成人免费看| 91在线播放网址| 久久久精品蜜桃| 免费在线观看视频一区| 欧美日韩午夜影院| **网站欧美大片在线观看| 精品一二三四在线| 9191成人精品久久| 亚洲国产精品一区二区久久| 色综合久久中文字幕| 亚洲欧美二区三区| 一本久久综合亚洲鲁鲁五月天| 国产精品久久久久久久久免费樱桃| 精品一区二区三区av| 精品日韩一区二区三区| 视频一区中文字幕| 91精品午夜视频| 六月丁香综合在线视频| 欧美变态凌虐bdsm| 国产精品白丝jk黑袜喷水| 久久久欧美精品sm网站| 国产成人av一区二区三区在线| 国产精品成人免费在线| 91视频观看免费| 亚洲不卡在线观看| 久久久久久久av麻豆果冻| 风间由美性色一区二区三区| 国产精品久久福利| 欧美三级中文字| 国产一区二区三区精品欧美日韩一区二区三区 | 国产精品系列在线播放| 综合久久一区二区三区| 欧美系列亚洲系列| 国产成人在线影院| 尤物视频一区二区| 久久综合九色综合欧美亚洲| av一本久道久久综合久久鬼色| 亚洲第一二三四区| 国产精品久久综合| 日韩精品中文字幕在线一区| 成人在线视频一区二区| 日韩高清国产一区在线| 日本一区二区综合亚洲| 欧美一区二区三区视频免费播放| 国产成人免费视频网站高清观看视频 | 日韩欧美第一区| 欧洲色大大久久| 99久久国产免费看| 国产精品一卡二卡在线观看| 亚洲午夜久久久| 1024亚洲合集| 欧美极品xxx| 欧美大片一区二区三区| 欧美日韩精品免费观看视频| 色天天综合色天天久久| 95精品视频在线| 97久久精品人人做人人爽50路| 国产乱码精品一区二区三区忘忧草| 日本视频免费一区| 美女视频网站黄色亚洲| 日韩不卡一二三区| 久久精品72免费观看| 久草精品在线观看| 国产精品一品视频| 成人午夜看片网址| 91老师国产黑色丝袜在线| 色呦呦网站一区| 9191久久久久久久久久久| 日韩精品一区二区在线观看| 精品国产精品网麻豆系列| 国产日韩欧美a| 亚洲人亚洲人成电影网站色| 亚洲国产成人av| 精品一区二区三区香蕉蜜桃 | 欧美色图一区二区三区| 欧美精品自拍偷拍| 久久九九99视频| 亚洲成人三级小说|