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

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

?? os_time.c

?? 本程序代碼是TCP/IP在最新流明諾瑞ARM單片機+ucosii平臺上實現的TCP/IP源代碼,希望對同仁有用.
?? 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一区二区三区免费野_久草精品视频
99久久婷婷国产综合精品| 人妖欧美一区二区| 久久女同性恋中文字幕| 欧美一区二区啪啪| 欧美日韩高清一区| 日韩欧美成人午夜| 欧美tickling网站挠脚心| 日韩免费福利电影在线观看| 欧美一区二区在线不卡| 日韩精品在线网站| 精品成人免费观看| 国产日本欧洲亚洲| 亚洲私人黄色宅男| 一区二区三区免费观看| 午夜久久电影网| 久久99国产精品成人| 国产白丝网站精品污在线入口| www.成人在线| 在线视频一区二区免费| 欧美精品免费视频| 亚洲精品一区二区三区影院| 国产精品国产自产拍高清av王其 | 日韩免费观看高清完整版在线观看| 欧美一区三区四区| 中文字幕精品在线不卡| 亚洲一二三四在线| 国产一区二区在线观看免费 | 亚洲午夜久久久| 婷婷国产v国产偷v亚洲高清| 国产一区999| 在线观看亚洲精品视频| 日韩精品专区在线影院观看 | 视频一区二区不卡| 国产suv一区二区三区88区| 色88888久久久久久影院野外| 日韩精品影音先锋| 亚洲激情图片qvod| 国产成人免费视| 91精品在线观看入口| 国产精品免费久久久久| 婷婷激情综合网| 99精品国产视频| 欧美精品一区二区三区四区 | 国产一区二区三区免费播放| 99re成人精品视频| 久久美女高清视频| 日韩av中文在线观看| 日本精品视频一区二区| 国产亚洲精品bt天堂精选| 性做久久久久久免费观看欧美| 成人国产在线观看| 精品不卡在线视频| 蜜桃视频一区二区| 欧美性猛片aaaaaaa做受| 久久精品一区四区| 久久国产婷婷国产香蕉| 欧美片网站yy| 亚洲国产精品精华液网站| 成人爽a毛片一区二区免费| 日韩一区二区三区在线观看| 一区二区久久久久久| 成人国产精品免费观看动漫| 精品捆绑美女sm三区| 五月激情六月综合| 欧美日本在线播放| 午夜精品影院在线观看| 在线观看亚洲精品| 夜夜嗨av一区二区三区四季av| 99re这里只有精品首页| 国产精品白丝在线| 成人av先锋影音| 国产精品久久毛片av大全日韩| 国产成人综合亚洲网站| 精品国产免费一区二区三区四区| 青青国产91久久久久久| 91精品国产高清一区二区三区 | 国产精品乡下勾搭老头1| 精品国产一区久久| 国产乱码一区二区三区| 久久精品视频免费| 懂色一区二区三区免费观看 | 在线观看三级视频欧美| 亚洲精品自拍动漫在线| 欧美亚洲免费在线一区| 偷拍亚洲欧洲综合| 精品久久久久香蕉网| 国产精品一区二区免费不卡 | 色偷偷一区二区三区| 成人免费一区二区三区视频| 在线免费观看成人短视频| 五月婷婷色综合| 久久这里都是精品| 91在线精品秘密一区二区| 亚洲综合免费观看高清完整版在线| 欧美探花视频资源| 久久超级碰视频| 中文字幕一区二区三| 欧美色图第一页| 国产在线视频一区二区| 国产精品免费久久久久| 欧美日韩在线电影| 黄色日韩网站视频| 亚洲摸摸操操av| 欧美日本免费一区二区三区| 国产乱码精品一区二区三区五月婷| 欧美激情中文字幕| 欧美色倩网站大全免费| 国产精品香蕉一区二区三区| 亚洲精品免费播放| 欧美mv日韩mv| 91福利视频在线| 国产成人免费在线观看不卡| 夜夜爽夜夜爽精品视频| 中文欧美字幕免费| 欧美疯狂做受xxxx富婆| 成人性生交大片免费看视频在线| 一区二区三区四区不卡在线 | 欧美日韩国产天堂| 高清成人免费视频| 免费在线视频一区| 亚洲美女一区二区三区| 2020国产精品自拍| 欧美日韩国产美女| 91玉足脚交白嫩脚丫在线播放| 日韩av电影天堂| 国产精品第五页| 2024国产精品视频| 91精品国产一区二区人妖| 91免费国产在线观看| 国内精品国产成人国产三级粉色| 亚洲国产色一区| 亚洲色图一区二区三区| 国产精品―色哟哟| 欧美精品一区二区三区在线| 91.com在线观看| 色狠狠桃花综合| 成人午夜在线播放| 从欧美一区二区三区| 国产一区二区三区黄视频 | 亚洲一区中文在线| 中文字幕国产一区| 国产欧美综合在线观看第十页| 欧美精品三级日韩久久| 欧美日韩国产欧美日美国产精品| caoporn国产一区二区| 国产精品一区二区在线观看不卡 | 国产亚洲欧美在线| 精品国产髙清在线看国产毛片| 91麻豆精品国产91久久久久久 | 日韩一级免费一区| 51久久夜色精品国产麻豆| 欧美视频在线不卡| 欧美日韩色综合| 欧美三级视频在线| 欧美日韩国产首页在线观看| 欧美日韩精品一区二区在线播放| 在线观看不卡一区| 欧美日韩国产色站一区二区三区| 欧美日韩中文国产| 欧美精品在线观看一区二区| 337p亚洲精品色噜噜| 制服丝袜国产精品| 久久久蜜臀国产一区二区| 久久午夜电影网| 国产精品传媒入口麻豆| 亚洲免费观看高清在线观看| 亚洲综合在线五月| 日韩精品五月天| 美洲天堂一区二卡三卡四卡视频| 久久99国产精品免费网站| 国产在线一区观看| 91香蕉视频在线| 欧美日韩精品二区第二页| 日韩欧美一级二级| 中文字幕国产一区| 午夜欧美2019年伦理| 国产综合色产在线精品| 99久久国产综合色|国产精品| 欧美亚洲国产一区二区三区| 欧美一级淫片007| 日本一区二区三区四区在线视频 | 精品日韩在线观看| 中文一区在线播放| 亚洲sss视频在线视频| 狠狠色综合播放一区二区| 99国产精品久久久久久久久久| 欧美日韩国产区一| 亚洲国产精品av| 日本人妖一区二区| 成人午夜视频免费看| 69堂亚洲精品首页| ...xxx性欧美| 激情欧美一区二区| 欧美日韩中文另类| 国产精品成人免费| 国产精品自在欧美一区| 337p亚洲精品色噜噜| 亚洲人成网站影音先锋播放| 国产一区二区在线免费观看| 欧美色图片你懂的|