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

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

?? os_time.c

?? transplant ucosII to lpc2131,周立功的光盤代碼
?? 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一区二区三区免费野_久草精品视频
亚洲欧美激情小说另类| 亚洲综合激情小说| 亚洲欧洲在线观看av| 亚洲第一成年网| 国产不卡免费视频| 中文字幕精品三区| 午夜国产精品一区| 99精品久久只有精品| 精品美女一区二区| 亚洲6080在线| 色婷婷激情一区二区三区| 日韩欧美123| 亚洲一区在线视频| 91亚洲男人天堂| 国产日韩高清在线| 久热成人在线视频| 制服视频三区第一页精品| 亚洲久草在线视频| 成人激情视频网站| 国产无遮挡一区二区三区毛片日本| 天堂午夜影视日韩欧美一区二区| 99久久亚洲一区二区三区青草 | 欧美aaa在线| 91国内精品野花午夜精品| 日本一区二区成人| 精品亚洲成a人在线观看| 欧美裸体bbwbbwbbw| 洋洋成人永久网站入口| 99精品欧美一区二区三区小说| 国产欧美一区视频| 国产真实乱偷精品视频免| 日韩一区二区三区在线视频| 奇米亚洲午夜久久精品| 欧美猛男gaygay网站| 亚洲成人动漫av| 欧美日韩视频在线一区二区| 一区二区三区在线视频免费| 色老头久久综合| 亚洲一区二区黄色| 欧美日韩一区二区三区在线| 亚洲一二三四在线| 欧美三级日韩在线| 午夜不卡在线视频| 欧美精品 国产精品| 午夜一区二区三区视频| 欧美日韩国产成人在线91| 天天影视网天天综合色在线播放| 7777精品久久久大香线蕉 | 欧美一区二区视频观看视频| 日韩有码一区二区三区| 91精品国产一区二区三区香蕉| 日本sm残虐另类| 久久亚洲精精品中文字幕早川悠里 | 99精品一区二区| 一个色在线综合| 欧美高清视频www夜色资源网| 青青草一区二区三区| 久久在线免费观看| 粉嫩av一区二区三区粉嫩 | 亚洲国产欧美日韩另类综合| 欧美日韩精品一区视频| 久久99久久精品欧美| 国产午夜精品理论片a级大结局 | 亚洲国产精品av| 色美美综合视频| 免费观看30秒视频久久| 久久伊人中文字幕| 99精品黄色片免费大全| 亚洲成人精品一区二区| 精品国产亚洲在线| 91小视频免费观看| 另类小说色综合网站| 国产精品美女久久久久aⅴ国产馆| 99精品桃花视频在线观看| 午夜日韩在线电影| 国产亚洲欧美一区在线观看| 欧美在线观看18| 激情欧美一区二区三区在线观看| 国产精品欧美经典| 欧美高清激情brazzers| 成人一区在线看| 日精品一区二区| 欧美激情在线一区二区三区| 国产亚洲综合av| 91福利精品视频| 国产成人亚洲综合色影视| 亚洲福利电影网| 国产精品乱码一区二区三区软件| 欧美三级资源在线| 成人动漫视频在线| 久久国产尿小便嘘嘘| 一区二区三区日韩欧美| 久久久久国产精品麻豆ai换脸 | 国产黄色精品网站| 视频一区二区中文字幕| 国产精品久久久久国产精品日日| 日韩欧美高清在线| 欧美亚洲综合在线| 白白色亚洲国产精品| 久久99久久99小草精品免视看| 亚洲在线视频网站| 亚洲天堂av老司机| 国产精品全国免费观看高清| 久久综合色鬼综合色| 91精品国产aⅴ一区二区| 一本一道综合狠狠老| 成人小视频在线观看| 国产在线播放一区二区三区| 免费在线看成人av| 日韩综合一区二区| 亚洲国产成人精品视频| 亚洲精品视频在线观看免费 | 精品久久久久久无| 91精品国产综合久久婷婷香蕉| 欧美亚洲一区三区| 91国偷自产一区二区三区成为亚洲经典 | 日韩理论电影院| 亚洲色图在线视频| 亚洲视频免费在线观看| 国产精品拍天天在线| 日本一区二区三区电影| 久久久久久9999| 一区二区三区91| 亚洲女与黑人做爰| 亚洲一区二区综合| 亚洲成av人片在线观看无码| 五月激情六月综合| 秋霞午夜av一区二区三区| 免费成人深夜小野草| 精油按摩中文字幕久久| 国产美女娇喘av呻吟久久| 国产精品影视天天线| 成人高清免费观看| 91精彩视频在线| 9191成人精品久久| 精品国产乱码久久久久久1区2区| 2023国产一二三区日本精品2022| 国产免费成人在线视频| 亚洲欧美在线观看| 亚洲一区二区三区免费视频| 五月综合激情网| 狠狠色丁香婷婷综合| 成人午夜在线视频| 一本一道久久a久久精品综合蜜臀 一本一道综合狠狠老 | 亚洲一区在线播放| 天堂蜜桃91精品| 国产一区二区三区免费在线观看| 成人一级片网址| 在线观看视频一区二区| 日本美女视频一区二区| 综合久久国产九一剧情麻豆| 中文字幕欧美国产| 国产色产综合色产在线视频| 精品毛片乱码1区2区3区| 欧美色网一区二区| 欧美吞精做爰啪啪高潮| 91久久一区二区| 欧美中文字幕不卡| 欧美视频一区二区| 欧美日韩精品电影| 欧美日本不卡视频| 欧美日韩国产高清一区| 777a∨成人精品桃花网| 欧美日韩二区三区| 欧美肥妇毛茸茸| 91精品国产欧美一区二区| 欧美日韩国产美| 91精品福利在线一区二区三区| 在线播放国产精品二区一二区四区 | 成人小视频免费在线观看| 成人污污视频在线观看| 9人人澡人人爽人人精品| 99久久免费视频.com| 色狠狠一区二区| 欧美一区二区在线免费播放 | 久久国产乱子精品免费女| 免费成人美女在线观看| 国产麻豆一精品一av一免费| 成人动漫精品一区二区| 91久久香蕉国产日韩欧美9色| 欧美三区在线视频| 日韩精品一区二区三区四区视频| 精品国产一二三| 国产精品不卡一区二区三区| 亚洲国产一区二区三区 | 黑人巨大精品欧美一区| 国产不卡视频在线播放| 在线亚洲欧美专区二区| 日韩精品综合一本久道在线视频| 久久久久久久久一| 国产精品国产a| 日韩在线一区二区三区| 国产精一品亚洲二区在线视频| 99久久免费精品| 日韩视频国产视频| 一区在线观看免费| 日韩高清一级片| 成人黄色av网站在线| 欧美日本一道本在线视频| 26uuu国产日韩综合|