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

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

?? os_time.c

?? 基于S3C2410處理器的,ucos-ii實驗源代碼.
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2003, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.76
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include <ucos_ii.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)
{
    INT8U      y;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    if (ticks > 0) {                             /* 0 means no delay!                                  */
        OS_ENTER_CRITICAL();
        y            =  OSTCBCur->OSTCBY;        /* Delay current task                                 */
        OSRdyTbl[y] &= ~OSTCBCur->OSTCBBitX;
        if (OSRdyTbl[y] == 0) {  
            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 OS_ARG_CHK_EN > 0
    if (hours == 0) {
        if (minutes == 0) {
            if (seconds == 0) {
                if (milli == 0) {
                    return (OS_TIME_ZERO_DLY);
                }
            }
        }
    }
    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);
    }
#endif
                                                 /* 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((INT16U)32768u);
        OSTimeDly((INT16U)32768u);
        loops--;
    }
    return (OS_NO_ERR);
}
#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 can call this function to resume a
*              task that is waiting for an event with timeout.  This would make the task look
*              like a timeout occurred.  
*
*              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 or has been assigned to a Mutex.
*********************************************************************************************************
*/

#if OS_TIME_DLY_RESUME_EN > 0
INT8U  OSTimeDlyResume (INT8U prio)
{
    OS_TCB    *ptcb;
#if OS_CRITICAL_METHOD == 3                                    /* Storage for CPU status register      */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                                /* Prevent compiler warning             */
#endif    
    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) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                            /* The task does not exist              */
    }
    if (ptcb == (OS_TCB *)1) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                            /* The task does not exist              */
    }
    if (ptcb->OSTCBDly == 0) {                                 /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_TIME_NOT_DLY);                              /* Indicate that task was not delayed   */
    }

    ptcb->OSTCBDly = 0;                                        /* Clear the time delay                 */
    if ((ptcb->OSTCBStat & OS_STAT_PEND_ANY) != OS_STAT_RDY) {
        ptcb->OSTCBStat   &= ~OS_STAT_PEND_ANY;                /* Yes, Clear status flag               */
        ptcb->OSTCBPendTO  = TRUE;                             /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBPendTO  = FALSE;
    }
    if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) == OS_STAT_RDY) {  /* Is task suspended?                   */
        OSRdyGrp               |= ptcb->OSTCBBitY;             /* No,  Make ready                      */
        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);
}
#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)
{
    INT32U     ticks;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合激情成人伊人| 国产精品久久久久永久免费观看 | 丁香六月久久综合狠狠色| 91丨九色丨蝌蚪丨老版| 2024国产精品| 亚洲综合图片区| 成人综合在线观看| www国产亚洲精品久久麻豆| 亚洲一区二区三区中文字幕在线| 国产成人av电影在线播放| 91超碰这里只有精品国产| 亚洲男女一区二区三区| 国产成人99久久亚洲综合精品| 欧美电影在哪看比较好| 亚洲综合色成人| 波多野结衣一区二区三区| 精品国产精品网麻豆系列| 视频一区视频二区中文| 欧美性生活大片视频| 欧美国产精品专区| 久久99久久精品欧美| 欧美精品欧美精品系列| 亚洲精品国产一区二区三区四区在线| 国产99久久久国产精品免费看| 精品国产制服丝袜高跟| 免费高清在线视频一区·| 欧美顶级少妇做爰| 美腿丝袜在线亚洲一区| 欧美一区二区三区的| 日韩精品欧美成人高清一区二区| 欧美午夜不卡在线观看免费| 一区二区三区91| 欧美性色黄大片| 午夜久久福利影院| 欧美精品丝袜中出| 免费一级片91| 久久免费电影网| 国产成人在线观看免费网站| 久久精品视频网| 成人国产精品免费| 亚洲三级在线播放| 欧美性受极品xxxx喷水| 五月天一区二区| 欧美电影免费观看高清完整版在 | 免费观看在线色综合| 欧美zozozo| 国产精品一区二区91| 日本一区二区三区四区在线视频| 成人免费的视频| 亚洲图片你懂的| 欧美军同video69gay| 精品在线一区二区三区| 亚洲精品一区二区三区蜜桃下载 | www.日韩大片| 亚洲永久免费视频| 日韩小视频在线观看专区| 国产在线麻豆精品观看| 国产精品女同一区二区三区| 91浏览器入口在线观看| 日本中文在线一区| 国产午夜精品福利| 在线观看国产91| 精品一区二区精品| 亚洲精品免费播放| 欧美成人精品福利| 日韩免费看的电影| 成人午夜激情视频| 视频精品一区二区| 日本一区二区综合亚洲| 欧美老人xxxx18| 波多野结衣在线aⅴ中文字幕不卡| 亚洲综合免费观看高清完整版在线| 日韩欧美一区二区不卡| 成人激情小说网站| 日本aⅴ免费视频一区二区三区| 26uuu久久综合| 欧美日韩一区二区三区四区五区| 国产乱子伦视频一区二区三区 | 久久先锋影音av鲁色资源网| www.日韩在线| 九色|91porny| 亚洲成人动漫一区| 日韩一区欧美一区| www久久精品| 欧美一区二区三区白人| caoporen国产精品视频| 精品亚洲国内自在自线福利| 亚洲人成在线播放网站岛国| 久久亚洲精精品中文字幕早川悠里| 91精彩视频在线观看| 国产99久久久久| 久久99精品久久久久| 午夜久久福利影院| 一区二区三区在线观看视频| 久久精品人人做人人爽97 | 色伊人久久综合中文字幕| 精品一区二区国语对白| 青青草精品视频| 亚洲激情欧美激情| 中文字幕在线观看一区| 国产日韩高清在线| 久久青草国产手机看片福利盒子 | 亚洲欧美色一区| 日韩免费电影网站| 视频一区二区三区入口| 精品久久久久久久久久久久久久久久久| 一本久久综合亚洲鲁鲁五月天 | 欧美日韩在线一区二区| www.日韩精品| 成人av动漫在线| 国产xxx精品视频大全| 国产精品亚洲专一区二区三区| 久久99精品久久久久婷婷| 日韩高清不卡在线| 亚洲成a人片在线观看中文| 亚洲一线二线三线视频| 亚洲综合一二三区| 亚洲高清一区二区三区| 亚洲成人你懂的| 午夜在线电影亚洲一区| 天天影视网天天综合色在线播放| 亚洲电影在线播放| 丝袜美腿亚洲一区二区图片| 婷婷激情综合网| 美女在线观看视频一区二区| 蜜臀av性久久久久蜜臀aⅴ| 麻豆高清免费国产一区| 国产一区二区三区观看| 国产精品白丝av| 成人av在线资源网站| 色噜噜久久综合| 91精品在线麻豆| 久久精品一区二区三区不卡牛牛| 中文字幕精品一区二区精品绿巨人| 中文字幕综合网| 五月婷婷激情综合| 国产一区二区毛片| 色综合咪咪久久| 91精品在线麻豆| 欧美国产日产图区| 一区二区免费看| 久久99精品久久久久久国产越南| 夫妻av一区二区| 欧美自拍偷拍一区| 精品国产麻豆免费人成网站| 国产欧美综合在线观看第十页| 中文字幕亚洲不卡| 日本欧美一区二区在线观看| 国产精品中文字幕一区二区三区| 9色porny自拍视频一区二区| 欧美日韩一区二区三区免费看| 久久免费精品国产久精品久久久久| 中文字幕日本不卡| 免费在线观看精品| 94-欧美-setu| 精品国产一区二区三区忘忧草| 亚洲日韩欧美一区二区在线| 青青草国产精品亚洲专区无| 99视频精品全部免费在线| 91麻豆精品国产| 亚洲精品亚洲人成人网在线播放| 狠狠色丁香久久婷婷综| 在线亚洲一区二区| 久久久精品日韩欧美| 亚洲国产精品精华液网站| 国内一区二区在线| 欧美人成免费网站| 中文字幕在线不卡视频| 久久黄色级2电影| 欧美在线观看一区二区| 国产精品国产自产拍在线| 另类调教123区| 欧美乱熟臀69xxxxxx| 亚洲欧美日韩国产一区二区三区| 国产黄色精品视频| 欧美一级二级三级蜜桃| 性做久久久久久免费观看欧美| av在线不卡电影| 久久久美女艺术照精彩视频福利播放| 亚洲第四色夜色| 色噜噜夜夜夜综合网| 亚洲日本在线看| av亚洲精华国产精华| 日本一区二区成人| 国内精品国产成人国产三级粉色| 欧美理论片在线| 视频一区国产视频| 欧美精品乱码久久久久久按摩| 一区二区三区四区视频精品免费 | 精品粉嫩超白一线天av| 午夜精品久久久久| 在线视频你懂得一区| 中文字幕视频一区| 99精品视频在线观看| 国产精品情趣视频| 成人av网站免费观看| 国产精品久久久久一区| 成人精品gif动图一区| 国产精品国产三级国产aⅴ入口 | 色www精品视频在线观看|