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

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

?? os_time.c

?? 學習嵌入式arm的資料
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2001, 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) == 0x00) {  /* 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一区二区三区免费野_久草精品视频
欧美日韩三级视频| 久久青草欧美一区二区三区| 国产一区二三区好的| 性做久久久久久久免费看| 亚洲婷婷在线视频| 国产精品污www在线观看| 亚洲精品在线免费观看视频| 日韩三级视频在线看| 日韩精品一区二区三区三区免费| 日韩一区国产二区欧美三区| 日韩欧美一区二区视频| 日韩视频免费观看高清完整版| 欧美日韩国产经典色站一区二区三区| 欧美日韩视频一区二区| 欧美久久一二区| 日韩欧美一级二级三级| 精品日韩在线一区| 国产欧美日韩一区二区三区在线观看| 久久久久综合网| 国产精品久久久久久久久免费相片| 国产精品久久久久久久久晋中| 亚洲欧洲日韩女同| 亚洲午夜视频在线| 亚欧色一区w666天堂| 国产精品一线二线三线| 成人激情免费网站| 日本乱人伦aⅴ精品| 91精品久久久久久久91蜜桃 | 精品精品国产高清一毛片一天堂| 欧美va天堂va视频va在线| www一区二区| 亚洲精品国产高清久久伦理二区| 五月激情综合网| 高清久久久久久| 在线视频你懂得一区| 精品国产乱码久久久久久1区2区| 国产精品久99| 人人狠狠综合久久亚洲| 国产一区二区福利视频| 日韩视频在线一区二区| 色婷婷精品久久二区二区蜜臂av| 制服.丝袜.亚洲.另类.中文 | 色综合色综合色综合色综合色综合| 亚洲欧美在线另类| 亚洲成人1区2区| 日精品一区二区| 国产成人a级片| 美女一区二区视频| 99re66热这里只有精品3直播 | 粉嫩高潮美女一区二区三区| 欧美中文字幕亚洲一区二区va在线| 久久久久久久久久久久久女国产乱| 亚洲欧美福利一区二区| 极品少妇xxxx偷拍精品少妇| 成人综合婷婷国产精品久久| 欧美少妇性性性| 欧美日本一区二区三区| 亚洲久草在线视频| 亚洲国产精品av| 国产在线精品不卡| 9人人澡人人爽人人精品| 久久久精品天堂| 国产精品三级电影| 国产激情视频一区二区三区欧美 | 国产精品白丝在线| 亚洲午夜免费电影| 久久久久久久久久久久久女国产乱 | 亚洲国产精品成人久久综合一区| 国产农村妇女精品| 国产精品自在欧美一区| 黄一区二区三区| 欧美不卡一区二区三区四区| 国产精品国产三级国产aⅴ原创| 亚洲第一精品在线| 夫妻av一区二区| 国产精品一区二区久久不卡| 久久九九国产精品| 日韩国产在线观看| 日韩一二三四区| 一区二区三区精品视频在线| 色婷婷亚洲精品| 久久久久久久久久久黄色| 国产高清精品网站| 91麻豆精品国产91久久久资源速度| 激情丁香综合五月| 亚洲精品一区二区三区蜜桃下载| 亚洲女与黑人做爰| 欧洲精品中文字幕| 国产精品麻豆视频| 在线视频综合导航| 国产精品三级av| 欧美影院一区二区| 国产亚洲综合在线| 午夜伊人狠狠久久| 26uuu亚洲| 久久99国产精品免费| 国产精品无人区| 国产精品911| 一区二区三区四区国产精品| 成人理论电影网| 99久久99久久综合| 亚洲成人先锋电影| 色狠狠桃花综合| 久久精品国产精品亚洲综合| 4438x成人网最大色成网站| 人禽交欧美网站| 337p亚洲精品色噜噜狠狠| 日本不卡视频在线观看| 日韩欧美的一区二区| 亚洲一区欧美一区| 欧美电影免费观看高清完整版在线观看| 亚洲一二三区不卡| 久久久亚洲精品石原莉奈| 久久国产乱子精品免费女| 中文字幕一区二区三| 91啪亚洲精品| 久久福利视频一区二区| 91精品国产欧美一区二区| 99久久婷婷国产| 亚洲国产一区二区视频| 国产精品久久久久影院色老大| 成人一区二区三区视频| 久久国产人妖系列| 国产精品丝袜久久久久久app| 亚洲.国产.中文慕字在线| 日韩天堂在线观看| 国产乱子伦视频一区二区三区| 亚洲aaa精品| 7777精品伊人久久久大香线蕉经典版下载| 国产精品亚洲午夜一区二区三区| 91麻豆免费看片| 丁香亚洲综合激情啪啪综合| 久久精品99国产精品日本| 国产精品美日韩| 欧美一区二区三区的| 成人丝袜高跟foot| 久久超碰97人人做人人爱| 色94色欧美sute亚洲线路一ni| 日韩精品欧美精品| 国产人伦精品一区二区| 日韩免费在线观看| 91麻豆蜜桃一区二区三区| 欧美日韩高清影院| 91福利精品视频| 麻豆精品一二三| 美女一区二区久久| 国产精品初高中害羞小美女文| 欧美日韩亚洲丝袜制服| 国产精品亚洲综合一区在线观看| 亚洲精品欧美激情| 日韩一区二区免费视频| 日韩网站在线看片你懂的| 91美女片黄在线观看| 麻豆国产欧美一区二区三区| 亚洲精品伦理在线| 久久日韩精品一区二区五区| 欧美性受xxxx黑人xyx| 国产一区二区三区视频在线播放| 国产精品久久久一本精品| 69堂成人精品免费视频| 国产麻豆一精品一av一免费| 亚洲综合色区另类av| 国产日本欧洲亚洲| 精品免费日韩av| 欧美日韩精品一区二区在线播放| 国产a精品视频| 久久99精品久久久久婷婷| 一区二区三区四区高清精品免费观看| 91麻豆免费观看| 欧美三级中文字幕| 91麻豆国产福利在线观看| 国产麻豆精品视频| 久久99精品视频| 看电视剧不卡顿的网站| 亚洲国产成人精品视频| 国产精品久久久久影院| 久久久夜色精品亚洲| 欧美亚洲综合一区| 99久久精品国产精品久久| 国产精品一二三| 国产一区二区三区在线观看免费视频| 奇米777欧美一区二区| 日韩高清电影一区| 偷偷要91色婷婷| 亚洲电影在线播放| 国产精品高潮呻吟久久| 日本欧美肥老太交大片| 丝袜诱惑亚洲看片| 偷拍一区二区三区| 亚洲成人精品一区二区| 亚洲一级在线观看| 亚洲va天堂va国产va久| 亚洲大片免费看| 国产精品国产自产拍在线| 丝袜美腿一区二区三区| 日韩黄色小视频| 精品一区二区三区免费毛片爱| 日韩一区精品字幕| 蜜臀精品一区二区三区在线观看| 婷婷国产v国产偷v亚洲高清|