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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? os_time.c~

?? mega128上的uCOSII
?? C~
字號(hào):
/*
*********************************************************************************************************
*                                                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    

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
污片在线观看一区二区| 蜜臀av一区二区在线免费观看| 91黄色激情网站| 午夜久久电影网| 日韩精品一区二区三区中文精品 | 26uuu久久综合| 成人app网站| 丝袜美腿亚洲色图| 国产亚洲精品bt天堂精选| 色偷偷一区二区三区| 午夜精品国产更新| 国产欧美精品在线观看| 欧美自拍偷拍一区| 麻豆国产91在线播放| 欧美国产丝袜视频| 欧美日韩国产精品成人| 成人午夜免费视频| 三级欧美韩日大片在线看| 久久精品视频免费| 在线综合+亚洲+欧美中文字幕| 国产v日产∨综合v精品视频| 午夜激情久久久| 欧美国产日本视频| 日韩精品一区二区三区老鸭窝| 97久久精品人人爽人人爽蜜臀| 伊人色综合久久天天| 久久免费午夜影院| 欧美一级艳片视频免费观看| 91视频一区二区| 国产在线不卡一区| 亚洲国产wwwccc36天堂| 久久久久国产精品麻豆ai换脸 | 国产成人午夜片在线观看高清观看| 一区二区欧美国产| 亚洲摸摸操操av| 国产精品久久99| 中文字幕一区二区三| 中文字幕欧美日韩一区| 久久精品人人做人人综合| 久久久久久久久久久99999| 精品福利一二区| 精品久久久久久久人人人人传媒| 日韩一级大片在线| 日韩精品一区二区三区在线 | 国产一区啦啦啦在线观看| 久久国产三级精品| 精品一区精品二区高清| 国产老女人精品毛片久久| 国产九色sp调教91| 国产成人夜色高潮福利影视| 成人黄动漫网站免费app| 97aⅴ精品视频一二三区| 91啪亚洲精品| 欧美亚洲自拍偷拍| 欧美精品粉嫩高潮一区二区| 欧美一区二区免费视频| 精品国产乱码久久久久久影片| 久久尤物电影视频在线观看| 国产午夜亚洲精品理论片色戒| 国产精品免费网站在线观看| 最新久久zyz资源站| 亚洲伊人色欲综合网| 视频一区二区不卡| 国产精品一线二线三线精华| 成人激情电影免费在线观看| 在线精品亚洲一区二区不卡| 日韩一区二区三免费高清| 精品国产91亚洲一区二区三区婷婷| 欧美国产日产图区| 亚洲一二三专区| 美腿丝袜亚洲三区| 国产99久久久国产精品 | 日韩欧美一二三区| 国产欧美日韩视频在线观看| 1区2区3区国产精品| 亚洲成人自拍偷拍| 国产精品99久久久久久有的能看| 91最新地址在线播放| 欧美一区二区三区思思人| 久久久久国产精品麻豆| 一卡二卡欧美日韩| 激情综合色播五月| 色噜噜狠狠一区二区三区果冻| 欧美大片在线观看| 亚洲日本电影在线| 精品一区二区三区蜜桃| 色噜噜狠狠成人网p站| 亚洲精品在线电影| 一区二区成人在线| 国产成人综合亚洲网站| 欧美三级中文字| 国产精品三级久久久久三级| 婷婷中文字幕一区三区| 9l国产精品久久久久麻豆| 日韩一二三四区| 夜夜嗨av一区二区三区网页| 国产精品一区二区久久不卡| 欧美色综合天天久久综合精品| 久久久一区二区| 石原莉奈在线亚洲二区| 91香蕉视频污| 久久久精品天堂| 免费成人在线网站| 欧美午夜寂寞影院| 亚洲同性同志一二三专区| 国产精品资源在线观看| 日韩一区二区精品在线观看| 亚洲精选免费视频| 粉嫩av一区二区三区粉嫩| 日韩欧美国产不卡| 婷婷国产在线综合| 91福利国产成人精品照片| 国产日韩欧美麻豆| 久久精品99久久久| 欧美精品久久久久久久多人混战 | 99久久国产综合精品麻豆 | 亚洲一级二级在线| 91色综合久久久久婷婷| 欧美激情一区二区三区蜜桃视频| 免费高清在线视频一区·| 欧美另类高清zo欧美| 亚洲综合在线第一页| 色哦色哦哦色天天综合| 亚洲日本青草视频在线怡红院| 粉嫩av一区二区三区在线播放| 久久久噜噜噜久噜久久综合| 久久精品噜噜噜成人88aⅴ| 欧美一级高清片| 欧美aaaaaa午夜精品| 91超碰这里只有精品国产| 亚洲午夜av在线| 欧美做爰猛烈大尺度电影无法无天| 中文字幕日本不卡| 99久久久无码国产精品| 中文字幕一区在线观看| 92精品国产成人观看免费| 亚洲视频在线观看一区| 91免费在线视频观看| 亚洲欧美经典视频| 在线观看免费视频综合| 亚洲一区在线视频| 欧洲精品在线观看| 视频一区免费在线观看| 欧美一卡2卡三卡4卡5免费| 久久99精品久久久久久动态图 | 青青草原综合久久大伊人精品 | 日韩视频免费观看高清在线视频| 日韩一区精品字幕| 欧美一级精品大片| 国精产品一区一区三区mba视频| 精品国产在天天线2019| 国产91清纯白嫩初高中在线观看| 久久精品欧美一区二区三区麻豆 | 91麻豆国产自产在线观看| 一个色在线综合| 欧美日韩卡一卡二| 精品在线免费观看| 日本一区二区三区在线不卡 | 久久品道一品道久久精品| 风间由美一区二区av101| 亚洲精品视频一区| 91精品国产综合久久香蕉的特点 | 日韩女优av电影| 国产高清精品久久久久| 国产精品国产a| 欧美视频一区在线| 蜜臀久久99精品久久久画质超高清| 26uuu另类欧美| 色婷婷亚洲一区二区三区| 午夜精品久久久久久久| 久久久久久久久久电影| 色嗨嗨av一区二区三区| 免费看日韩精品| 日本一区二区三区电影| 欧美在线你懂得| 精品一区二区日韩| 亚洲人成精品久久久久久| 日韩欧美一区二区三区在线| 成人黄页毛片网站| 日本中文在线一区| 国产精品国产自产拍高清av王其| 欧美久久久久中文字幕| 成人开心网精品视频| 午夜精彩视频在线观看不卡| 日本一区二区三区在线观看| 欧美精选一区二区| 99久久久久久| 久久99久久99| 亚洲综合激情另类小说区| 久久久精品免费网站| 欧美高清dvd| 99re热这里只有精品免费视频| 天堂久久久久va久久久久| 自拍偷拍亚洲欧美日韩| 欧美zozozo| 欧美性色欧美a在线播放| 国产91丝袜在线播放九色| 免费观看91视频大全| 亚洲国产毛片aaaaa无费看| 国产精品日产欧美久久久久|