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

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

?? os_time.c

?? LPC2104/5/6嵌入式系統程序實例,帶有PROTUES7.1仿真文件,適合做入門指導
?? 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一区二区三区免费野_久草精品视频
成人一区二区三区中文字幕| 国产午夜亚洲精品不卡| 欧美va日韩va| 亚洲区小说区图片区qvod| 日本午夜一本久久久综合| www.成人网.com| 日韩一级免费一区| 一区二区三区在线看| 国产盗摄一区二区三区| 91精品国产免费| 亚洲欧美乱综合| 粉嫩久久99精品久久久久久夜| 欧美一级在线免费| 亚洲一区二区三区视频在线播放| 懂色一区二区三区免费观看| 制服丝袜日韩国产| 国产成人av在线影院| 精品国产乱码久久久久久闺蜜| 亚洲一区二区三区在线| 一道本成人在线| 国产精品国产精品国产专区不蜜| 韩国av一区二区| 精品久久久久一区二区国产| 日韩二区三区四区| 欧美一区二区三区在线看| 亚洲国产成人porn| 欧美色综合网站| 亚洲午夜免费视频| 欧美性做爰猛烈叫床潮| 亚洲欧洲色图综合| 99国产精品国产精品久久| 国产欧美中文在线| 国产sm精品调教视频网站| 久久免费美女视频| 国产河南妇女毛片精品久久久| 久久久激情视频| 国产一区91精品张津瑜| 精品国产一区二区精华| 国产一区三区三区| 国产精品午夜免费| 91视频免费播放| 亚洲一区二区av在线| 欧美精品自拍偷拍| 看国产成人h片视频| 久久久久久久久伊人| 成人综合在线观看| 国产麻豆一精品一av一免费| 国产亚洲综合色| 成人av在线观| 一区二区三区四区高清精品免费观看 | 色综合久久久久| 亚洲欧洲精品成人久久奇米网| 99视频一区二区| 亚洲第一狼人社区| 日韩欧美高清在线| 风间由美一区二区av101| 亚洲另类色综合网站| 在线综合+亚洲+欧美中文字幕| 久久99精品国产.久久久久 | 国产网站一区二区三区| 成人综合婷婷国产精品久久免费| 亚洲视频资源在线| 欧美日韩高清在线播放| 国产永久精品大片wwwapp| 亚洲日本成人在线观看| 在线不卡的av| 国产91在线|亚洲| 亚洲综合男人的天堂| 精品理论电影在线| 色综合中文字幕| 久久99久久久久久久久久久| 国产精品乱码人人做人人爱| 欧美日韩中文字幕一区| 国产在线一区观看| 亚洲一二三专区| 久久久久久久电影| 欧美在线观看一二区| 国产精品主播直播| 亚洲福利一区二区三区| 国产午夜精品福利| 精品污污网站免费看| 成人久久18免费网站麻豆 | 欧美亚日韩国产aⅴ精品中极品| 九九视频精品免费| 亚洲激情网站免费观看| 国产视频亚洲色图| 欧美午夜精品久久久| 风流少妇一区二区| 九九热在线视频观看这里只有精品| 亚洲精品日韩一| 久久婷婷久久一区二区三区| 欧美高清视频www夜色资源网| 99精品视频一区| 国产一区二区福利| 久久国产精品露脸对白| 亚洲第一成人在线| 一区2区3区在线看| 1000部国产精品成人观看| 国产偷国产偷亚洲高清人白洁| 欧美午夜精品免费| 色视频欧美一区二区三区| 国产米奇在线777精品观看| 五月激情六月综合| 亚洲成人三级小说| 一区二区三区欧美视频| 亚洲欧洲国产专区| 国产精品久久二区二区| 国产精品激情偷乱一区二区∴| 久久午夜电影网| 久久久综合视频| 国产女人18水真多18精品一级做| 久久免费电影网| 久久日韩精品一区二区五区| 欧美一区二区三区公司| 91精品婷婷国产综合久久| 欧美精品一卡两卡| 欧美一区二区女人| 精品国产免费一区二区三区四区 | 国产日韩欧美一区二区三区综合| 精品对白一区国产伦| 久久免费电影网| 欧美激情在线免费观看| 国产精品传媒入口麻豆| 亚洲三级在线免费观看| 一区二区三区在线免费播放| 亚洲va在线va天堂| 无吗不卡中文字幕| 精久久久久久久久久久| 国产伦精品一区二区三区免费| 国产精品一线二线三线| 成人ar影院免费观看视频| 97久久久精品综合88久久| 在线视频一区二区三| 欧美高清视频www夜色资源网| 日韩欧美中文字幕一区| 国产午夜精品理论片a级大结局| 最新国产精品久久精品| 亚洲精品国产一区二区三区四区在线 | 精品国产乱码久久久久久老虎| 久久亚洲免费视频| 亚洲欧洲一区二区三区| 亚洲不卡一区二区三区| 激情丁香综合五月| 成人h动漫精品一区二区| 欧美亚洲高清一区二区三区不卡| 7777精品伊人久久久大香线蕉的| 国产麻豆精品久久一二三| 成人一级片网址| 久久久影视传媒| 午夜一区二区三区在线观看| 亚洲综合激情另类小说区| 午夜欧美2019年伦理| 国产一区二区电影| 成人午夜精品在线| 欧美精品乱码久久久久久| 国产成人自拍网| 色94色欧美sute亚洲线路一ni | 日本欧美韩国一区三区| 国内精品久久久久影院色| 91免费看视频| 久久伊99综合婷婷久久伊| 一区二区三区精品在线| 国产一区二区在线视频| 欧美日韩国产一二三| 国产精品天干天干在线综合| 蜜桃视频一区二区三区| 91美女片黄在线观看91美女| 精品国产99国产精品| 亚洲一区二区三区四区不卡| 国产精品影视网| 91精品在线免费观看| 亚洲啪啪综合av一区二区三区| 久久精品国产在热久久| 国产视频911| 全部av―极品视觉盛宴亚洲| 成人av小说网| 26uuu精品一区二区| 日韩精品一区第一页| 日本电影欧美片| 国产精品亲子乱子伦xxxx裸| 狠狠色综合日日| 日韩欧美在线1卡| 天堂精品中文字幕在线| 欧美中文字幕一区二区三区亚洲| 国产精品无人区| 国产精品66部| 久久综合久久综合亚洲| 奇米777欧美一区二区| 精品视频资源站| 亚洲超丰满肉感bbw| 欧美亚洲愉拍一区二区| 亚洲精品国产精品乱码不99 | 久久99精品久久久| 日韩一区二区三区四区五区六区| 亚洲第一成年网| 欧美日韩三级在线| 天天综合日日夜夜精品| 欧美亚洲国产一区二区三区va| 亚洲在线免费播放| 欧美日韩在线电影|