亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美久久一区二区| 中文字幕在线不卡国产视频| 日韩精品一区第一页| 色婷婷综合久久久久中文| 亚洲精品一区二区三区福利| 99re这里只有精品首页| 久久精品夜色噜噜亚洲a∨| 国产精品1区二区.| 亚洲欧美另类久久久精品| 91香蕉视频污| 秋霞午夜av一区二区三区| 精品电影一区二区| 成人丝袜视频网| 亚洲第一综合色| 久久婷婷国产综合国色天香| 国产91精品露脸国语对白| 亚洲同性同志一二三专区| 丝瓜av网站精品一区二区| 成人av网址在线| 国产精品免费视频网站| 精品国产乱码91久久久久久网站| 午夜影视日本亚洲欧洲精品| 2019国产精品| 色哟哟精品一区| 国产精品一区二区视频| 一区二区久久久久久| 精品久久久久久久久久久久久久久久久| 国产二区国产一区在线观看| 亚洲专区一二三| 国产精品色呦呦| 精品久久久久一区| 91精品午夜视频| 成年人午夜久久久| 国产馆精品极品| 精品一区二区三区免费视频| 亚洲人123区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 欧美性xxxxx极品少妇| 国内欧美视频一区二区 | 成人高清av在线| 国产另类ts人妖一区二区| 亚洲成人一区二区| 亚洲综合无码一区二区| 亚洲黄色片在线观看| 亚洲精品中文字幕乱码三区 | 久久久久久久综合狠狠综合| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国产成人精品亚洲777人妖| 成人午夜电影网站| 91久久精品一区二区三| 色综合天天性综合| 欧美精品 国产精品| 欧美一区二区久久| 中文字幕视频一区二区三区久| 国产亚洲精久久久久久| 国产精品久久国产精麻豆99网站| 中文字幕av一区二区三区| 亚洲女与黑人做爰| 国产福利不卡视频| 国产成人精品三级麻豆| 一本久久综合亚洲鲁鲁五月天| 在线精品观看国产| 日韩手机在线导航| 亚洲精品水蜜桃| 激情伊人五月天久久综合| 91精品1区2区| 国产精品福利一区| 欧美aaa在线| 成人福利电影精品一区二区在线观看| 91伊人久久大香线蕉| 日韩西西人体444www| 亚洲黄色av一区| 国产精品18久久久久久久网站| av不卡免费电影| 久久久久久亚洲综合影院红桃| 午夜av一区二区| 欧美揉bbbbb揉bbbbb| 久久综合色播五月| 国产一区不卡视频| 欧美成人精品福利| 狠狠网亚洲精品| 精品国产一二三| 国产美女一区二区三区| 91精品国产入口| 亚洲一区二区三区在线播放| www.日韩在线| 日韩欧美不卡在线观看视频| 精品成人免费观看| 亚洲一区二区黄色| 91麻豆精品国产91久久久资源速度 | 久久丁香综合五月国产三级网站| 欧美日韩三级一区二区| 日韩黄色一级片| 精品噜噜噜噜久久久久久久久试看| 久久精品国产成人一区二区三区 | 国产一区二区久久| 26uuu欧美日本| 99视频一区二区三区| 亚洲一卡二卡三卡四卡无卡久久 | 亚洲欧美偷拍三级| 97se亚洲国产综合自在线| 久久九九99视频| 91看片淫黄大片一级在线观看| 亚洲五码中文字幕| 精品国产百合女同互慰| 在线免费观看日韩欧美| 麻豆一区二区三区| 亚洲午夜羞羞片| 亚洲国产成人一区二区三区| 在线免费视频一区二区| 国产乱人伦偷精品视频不卡| 亚洲v精品v日韩v欧美v专区| 久久色在线观看| 欧美福利视频导航| 色系网站成人免费| 暴力调教一区二区三区| 久久成人av少妇免费| 亚洲狠狠丁香婷婷综合久久久| 久久久亚洲综合| 欧美日韩国产成人在线91| 成人动漫视频在线| 成人免费毛片高清视频| 精品一区二区三区日韩| 欧美aⅴ一区二区三区视频| 亚洲成人自拍一区| 日韩极品在线观看| 九九国产精品视频| 国产美女精品一区二区三区| 韩日av一区二区| 国产成人8x视频一区二区| 国产高清不卡二三区| 成人国产精品免费| 国产不卡视频在线播放| 9人人澡人人爽人人精品| 日本乱人伦一区| 欧洲一区在线电影| 日韩精品中文字幕在线一区| 欧美福利视频一区| 精品对白一区国产伦| 亚洲欧美韩国综合色| 香蕉加勒比综合久久| 黄色小说综合网站| 91在线视频免费91| 日韩欧美国产综合一区| 中文字幕在线不卡一区| 午夜精品久久久久久久99樱桃 | 丝袜亚洲精品中文字幕一区| 理论电影国产精品| 91丝袜高跟美女视频| 日韩视频国产视频| 一区二区三区国产豹纹内裤在线| 亚洲综合av网| 色综合久久99| 国产精品美女久久久久久2018| 麻豆成人91精品二区三区| 色综合久久综合网欧美综合网| 欧美一二三在线| 图片区小说区区亚洲影院| 成人激情免费网站| 久久精品一区二区三区四区| 日日摸夜夜添夜夜添亚洲女人| gogogo免费视频观看亚洲一| 日韩一级黄色大片| 日本视频中文字幕一区二区三区| 在线视频一区二区三| 91看片淫黄大片一级在线观看| 日韩欧美的一区二区| 亚洲高清久久久| 欧美日韩精品免费| 亚洲综合免费观看高清完整版| 高清日韩电视剧大全免费| 91精品黄色片免费大全| 日韩中文字幕91| 精品少妇一区二区三区在线播放| 蜜桃视频第一区免费观看| 亚洲精品在线观看网站| 国模套图日韩精品一区二区| 国产亚洲精品福利| 97se亚洲国产综合自在线观| 国产精品久久久久久久岛一牛影视 | 蜜臀av在线播放一区二区三区| 日韩视频一区二区在线观看| 国产一区免费电影| 亚洲欧美成人一区二区三区| 日韩亚洲欧美成人一区| 国精产品一区一区三区mba视频| 国产精品日日摸夜夜摸av| 在线观看一区二区视频| 日本中文在线一区| 国产欧美日韩视频一区二区| 欧美日韩在线播放| 高清国产一区二区| 国产美女一区二区| 美脚の诱脚舐め脚责91| 国产精品久久久久毛片软件| 精品粉嫩aⅴ一区二区三区四区| 一本一道久久a久久精品| 国产乱对白刺激视频不卡 | 欧美精品v国产精品v日韩精品| 成人黄色av电影|