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

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

?? os_time.c

?? 沒有開發板也可以學ARM。ucos-ii與ZLG-GUI的GBA移植
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2007, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.85
*
* LICENSING TERMS:
* ---------------
*   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.  
* If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license 
* its use in your product. We provide ALL the source code for your convenience and to help you experience 
* uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a 
* licensing fee.
*********************************************************************************************************
*/

#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 = 0;
#endif



    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        return;
    }
    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_ERR_NONE
*              OS_ERR_TIME_INVALID_MINUTES
*              OS_ERR_TIME_INVALID_SECONDS
*              OS_ERR_TIME_INVALID_MS
*              OS_ERR_TIME_ZERO_DLY
*              OS_ERR_TIME_DLY_ISR
*
* 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 ms)
{
    INT32U ticks;
    INT16U loops;


    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        return (OS_ERR_TIME_DLY_ISR);
    }
#if OS_ARG_CHK_EN > 0
    if (hours == 0) {
        if (minutes == 0) {
            if (seconds == 0) {
                if (ms == 0) {
                    return (OS_ERR_TIME_ZERO_DLY);
                }
            }
        }
    }
    if (minutes > 59) {
        return (OS_ERR_TIME_INVALID_MINUTES);    /* Validate arguments to be within range              */
    }
    if (seconds > 59) {
        return (OS_ERR_TIME_INVALID_SECONDS);
    }
    if (ms > 999) {
        return (OS_ERR_TIME_INVALID_MS);
    }
#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)ms + 500L / OS_TICKS_PER_SEC) / 1000L;
    loops = (INT16U)(ticks >> 16);               /* Compute the integral number of 65536 tick delays   */
    ticks = ticks & 0xFFFFL;                     /* Obtain  the fractional number of ticks             */
    OSTimeDly((INT16U)ticks);
    while (loops > 0) {
        OSTimeDly((INT16U)32768u);
        OSTimeDly((INT16U)32768u);
        loops--;
    }
    return (OS_ERR_NONE);
}
#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_ERR_NONE               Task has been resumed
*              OS_ERR_PRIO_INVALID       if the priority you specify is higher that the maximum allowed
*                                        (i.e. >= OS_LOWEST_PRIO)
*              OS_ERR_TIME_NOT_DLY       Task is not waiting for time to expire
*              OS_ERR_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 = 0;
#endif



    if (prio >= OS_LOWEST_PRIO) {
        return (OS_ERR_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = OSTCBPrioTbl[prio];                                 /* Make sure that task exist            */
    if (ptcb == (OS_TCB *)0) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                        /* The task does not exist              */
    }
    if (ptcb == OS_TCB_RESERVED) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                        /* The task does not exist              */
    }
    if (ptcb->OSTCBDly == 0) {                                 /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_ERR_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->OSTCBStatPend  =  OS_STAT_PEND_TO;               /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBStatPend  =  OS_STAT_PEND_OK;
    }
    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_ERR_NONE);
}
#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 = 0;
#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 = 0;
#endif



    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情艳妇裸体舞| 国产精品精品国产色婷婷| 国产福利精品一区二区| 亚洲综合色婷婷| 国产精品三级av| 久久久久久久综合色一本| 91精品国产综合久久久久久久| 99综合电影在线视频| 国产传媒久久文化传媒| 久久精品国产精品亚洲精品| 亚洲成a人片在线不卡一二三区| 亚洲欧洲av在线| 国产精品欧美精品| 中文字幕av在线一区二区三区| 欧美大度的电影原声| 欧美变态凌虐bdsm| 日韩视频在线一区二区| 91精品久久久久久久99蜜桃| 欧美日本视频在线| 欧美一级黄色片| 国产日韩三级在线| 中文字幕精品三区| 亚洲免费成人av| 偷窥国产亚洲免费视频| 久久66热re国产| 懂色av噜噜一区二区三区av| 99国内精品久久| 欧美群妇大交群的观看方式| 亚洲精品一区二区在线观看| 久久久久久亚洲综合影院红桃| 国产精品久久毛片| 亚洲第一av色| 国产精品888| 91高清视频免费看| 日韩欧美一区二区免费| 国产精品拍天天在线| 丝袜诱惑亚洲看片| 国产米奇在线777精品观看| 99r精品视频| 欧美一区二区三区婷婷月色| 国产精品国产三级国产普通话99 | 欧美一级在线观看| 国产精品国产精品国产专区不蜜| 亚洲综合在线五月| 国产成人午夜高潮毛片| 欧美另类一区二区三区| 亚洲视频 欧洲视频| 国产成人午夜高潮毛片| 日韩一区二区精品在线观看| 亚洲欧美日韩在线不卡| 高清国产午夜精品久久久久久| 欧美老年两性高潮| 亚洲一本大道在线| av毛片久久久久**hd| 欧美韩日一区二区三区四区| 精品一区二区三区久久久| 欧美色窝79yyyycom| 中文字幕一区二区三区在线观看 | 久久久久国产精品麻豆| 免费日韩伦理电影| 欧美日韩成人激情| 午夜不卡在线视频| 欧美视频完全免费看| 亚洲免费看黄网站| 91成人国产精品| 亚洲一区在线视频| 欧美日韩精品欧美日韩精品一| 亚洲欧洲综合另类| 欧美亚洲一区二区在线观看| 一区二区三区四区不卡视频 | 亚洲猫色日本管| 欧美在线一二三| 性欧美疯狂xxxxbbbb| 在线视频一区二区三区| 亚洲午夜激情av| 9191久久久久久久久久久| 免费的国产精品| 国产亚洲1区2区3区| 91同城在线观看| 久久精品国产99| 中文一区二区完整视频在线观看| 99久久精品国产一区二区三区| 一区二区三区在线免费| 日韩午夜在线观看视频| eeuss鲁一区二区三区| 一区二区在线观看视频| 日韩欧美一级精品久久| av电影在线观看不卡| 日韩高清一级片| 成人免费在线视频观看| 91精品国产免费久久综合| 91麻豆国产香蕉久久精品| 日本不卡视频在线| 欧美国产精品一区二区| 精品视频一区 二区 三区| 欧美另类videos死尸| 91黄色免费看| 99国产精品久久久| 国产一区二区三区蝌蚪| 日本免费在线视频不卡一不卡二| 亚洲蜜臀av乱码久久精品蜜桃| 日韩欧美不卡在线观看视频| 国产色产综合产在线视频| 色999日韩国产欧美一区二区| 国产成人啪免费观看软件| 日韩电影免费一区| 日韩成人午夜电影| 日韩影院免费视频| 亚洲第一激情av| 亚洲午夜精品一区二区三区他趣| 亚洲天堂久久久久久久| 成人免费视频在线观看| 中文字幕中文字幕一区| 中文字幕av不卡| 中文字幕色av一区二区三区| 国产欧美一区二区三区在线老狼 | 亚洲人成网站色在线观看| 国产农村妇女精品| 国产精品久久久久7777按摩| 亚洲欧洲无码一区二区三区| 国产精品毛片a∨一区二区三区| 国产午夜一区二区三区| 国产精品久久久久久久久免费桃花| 国产日韩欧美不卡在线| 国产精品短视频| **性色生活片久久毛片| 亚洲一区二区三区小说| 五月天丁香久久| 九九国产精品视频| 国产91精品在线观看| 91国产免费看| 日韩精品一区二区三区视频播放| 久久婷婷国产综合国色天香| 国产欧美日韩另类视频免费观看| 中文字幕亚洲精品在线观看| 亚洲国产精品麻豆| 精品一区二区日韩| 99国内精品久久| 日韩免费看网站| 中文字幕日韩一区二区| 麻豆免费看一区二区三区| 国产sm精品调教视频网站| 在线视频欧美精品| 久久这里只有精品6| 亚洲永久精品大片| 精品1区2区3区| 中文字幕乱码日本亚洲一区二区 | 日韩精彩视频在线观看| 99热精品一区二区| 欧美成人精精品一区二区频| 中文字幕在线观看一区二区| 日韩电影在线一区二区三区| 97久久超碰国产精品电影| 日韩欧美高清一区| 亚洲成人福利片| 色综合久久久网| 日韩理论片一区二区| 国产精品自拍av| 精品乱人伦一区二区三区| 日日夜夜精品视频免费| 欧美中文字幕一区二区三区| 中文字幕在线视频一区| 成人午夜在线播放| 国产精品情趣视频| 成人美女在线视频| 中文字幕一区二区三区在线观看| 成人午夜伦理影院| 亚洲国产高清在线| 波多野结衣中文字幕一区二区三区| 国产亚洲一区字幕| 成人高清免费在线播放| 中文字幕一区在线观看| 91国产视频在线观看| 午夜久久电影网| 日韩精品一区在线观看| 国产精一区二区三区| 国产视频911| 一本色道久久综合狠狠躁的推荐| 亚洲猫色日本管| 91麻豆精品国产91久久久资源速度| 午夜视频一区二区三区| 欧美成人伊人久久综合网| 成人毛片老司机大片| 亚洲欧美日韩国产成人精品影院| 91麻豆swag| 亚洲va欧美va人人爽午夜 | 3d动漫精品啪啪| 国产精品99久久久久久久vr| 亚洲私人黄色宅男| 欧美精品在线视频| 成人美女视频在线看| 成人深夜在线观看| 亚洲高清在线精品| 久久久久久久一区| 欧美日韩精品综合在线| 国产成人精品综合在线观看 | 亚洲一区精品在线| 日韩欧美中文字幕精品| www.在线成人| 开心九九激情九九欧美日韩精美视频电影 |