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

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

?? os_time.c

?? uc/osii內核源碼
?? 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一区二区| 久久综合网色—综合色88| 日韩精品在线一区| 亚洲免费观看高清| 国产精品系列在线观看| 欧美日韩精品一区二区在线播放| 久久只精品国产| 亚洲高清免费观看| 99久久夜色精品国产网站| 欧美精品一区二区三区在线播放| 一区二区三区精密机械公司| 91麻豆国产福利在线观看| 7777精品伊人久久久大香线蕉的 | 欧美tk—视频vk| 亚洲男人的天堂在线观看| 国产东北露脸精品视频| 欧美v日韩v国产v| 免费日本视频一区| 欧美伦理电影网| 一区二区三区四区在线| 成人美女在线视频| 国产欧美一区二区三区鸳鸯浴 | 欧美成人a视频| 日日摸夜夜添夜夜添亚洲女人| 91在线精品一区二区| 欧美国产激情二区三区| 国产精品一二三| 国产欧美一区二区精品仙草咪| 激情另类小说区图片区视频区| 日韩一级片网站| 久久成人免费电影| 久久青草欧美一区二区三区| 极品少妇一区二区三区精品视频 | 欧美国产综合一区二区| 国产一区二区三区四 | 91麻豆精品国产| 日本女人一区二区三区| 欧美日韩一区二区三区在线| 亚洲18女电影在线观看| 欧美日韩一区二区三区四区五区| 亚洲成av人片一区二区| 欧美一区二区三区白人| 久久激情五月激情| 欧美激情综合网| 99视频精品免费视频| 亚洲精品成人在线| 欧美日韩在线综合| 免费在线观看成人| 欧美国产综合一区二区| 色婷婷久久久亚洲一区二区三区| 亚洲成av人片在www色猫咪| 欧美一卡2卡3卡4卡| 激情图片小说一区| 1000部国产精品成人观看| 在线免费观看一区| 男男成人高潮片免费网站| 国产日韩亚洲欧美综合| 91国偷自产一区二区三区成为亚洲经典| 亚洲精品视频在线看| 这里只有精品电影| 处破女av一区二区| 亚洲成a人v欧美综合天堂| 欧美大片一区二区| 91免费国产在线| 美女mm1313爽爽久久久蜜臀| 国产精品色噜噜| 欧美日本一道本| 成人黄色软件下载| 日本欧美一区二区| 中文字幕一区二区三区色视频| 欧美日韩美女一区二区| 国产精品一区二区黑丝| 亚洲福中文字幕伊人影院| 国产日韩在线不卡| 欧美男生操女生| 99久久久无码国产精品| 久久66热偷产精品| 亚洲一区二区三区小说| 国产日韩欧美制服另类| 欧美三级日韩在线| 成人av影院在线| 久久疯狂做爰流白浆xx| 亚洲一线二线三线久久久| 久久精品视频一区二区| 欧美色精品在线视频| 成人黄色国产精品网站大全在线免费观看 | 成人午夜私人影院| 青青草国产精品97视觉盛宴| 亚洲精品国产品国语在线app| 欧美成va人片在线观看| 欧美色视频一区| 色综合久久久久| 成人99免费视频| 国产成人免费视| 精品一二三四区| 日本大胆欧美人术艺术动态| 亚洲一区二区3| 亚洲精品国产无套在线观| 国产精品久久久久久久久图文区 | 成人短视频下载| 麻豆久久一区二区| 爽好久久久欧美精品| 一区二区三区四区在线| 亚洲欧美日韩国产中文在线| 国产精品午夜久久| 国产精品你懂的在线欣赏| 国产婷婷色一区二区三区在线| 欧美一区二区三区白人| 5858s免费视频成人| 欧美日本一区二区| 欧美日韩www| 欧美一区二区三区在线视频| 欧美日韩第一区日日骚| 91精品免费在线| 在线成人高清不卡| 69堂国产成人免费视频| 欧美久久婷婷综合色| 欧美乱妇20p| 日韩一区二区三区观看| 欧美一区日本一区韩国一区| 欧美一级艳片视频免费观看| 91精品国产麻豆国产自产在线 | 日本伊人精品一区二区三区观看方式| 亚洲一区二区三区四区的| 午夜精品免费在线观看| 日日夜夜精品视频免费| 麻豆国产精品官网| 国产一区二区三区最好精华液| 国产乱码精品一区二区三区五月婷 | 91麻豆福利精品推荐| 欧美性一区二区| 91麻豆精品国产91久久久久| 精品精品国产高清a毛片牛牛| 精品盗摄一区二区三区| 中文幕一区二区三区久久蜜桃| 亚洲图片你懂的| 五月天一区二区| 精品一区二区三区久久久| 国产电影精品久久禁18| 91免费观看视频| 在线电影一区二区三区| 国产三级精品视频| 亚洲综合免费观看高清完整版在线| 亚洲一区免费观看| 国产资源在线一区| 色综合视频在线观看| 91精品国产一区二区人妖| 久久日韩粉嫩一区二区三区| 亚洲婷婷综合久久一本伊一区| 亚洲r级在线视频| 国产在线国偷精品产拍免费yy| 不卡区在线中文字幕| 欧美肥妇毛茸茸| 欧美激情资源网| 亚洲成人黄色影院| 国产91精品精华液一区二区三区 | 亚洲一区二区视频在线观看| 久久国产人妖系列| 91久久香蕉国产日韩欧美9色| 日韩小视频在线观看专区| 亚洲视频狠狠干| 国产一区三区三区| 欧美日韩亚洲综合| 国产精品美日韩| 久久国产免费看| 欧美曰成人黄网| 久久久久久亚洲综合影院红桃| 亚洲综合色区另类av| 成人黄色免费短视频| 日韩手机在线导航| 一级做a爱片久久| 国产传媒一区在线| 制服丝袜亚洲播放| 一区二区成人在线视频| 懂色av中文字幕一区二区三区| 日韩一区二区精品葵司在线| 亚洲精品免费视频| www.66久久| 国产欧美一区二区在线| 精品一区二区在线观看| 欧美日韩在线一区二区| 亚洲免费在线观看视频| fc2成人免费人成在线观看播放| 日韩手机在线导航| 日本免费在线视频不卡一不卡二 | 成人永久aaa| 久久久国产一区二区三区四区小说 | 丁香天五香天堂综合| 欧美刺激午夜性久久久久久久| 日韩中文字幕区一区有砖一区| 色综合中文字幕国产 | 日韩精品一区二| 日韩电影网1区2区| 欧美浪妇xxxx高跟鞋交| 亚洲综合网站在线观看| 色狠狠av一区二区三区| 亚洲视频中文字幕| 色综合天天综合网国产成人综合天| 国产精品拍天天在线| av激情亚洲男人天堂|