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

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

?? os_time.c

?? UCOSII源碼,三星4510下面的uCOSII源碼.
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                           All Rights Reserved
*
*                                                  V2.00
*
* 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) reentrant
{
    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();
        OSSched();                                                        /* 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.
*********************************************************************************************************
*/

INT8U OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U milli) reentrant
{
    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 = ticks / 65536L;                  /* Compute the integral number of 65536 tick delays   */
        ticks = ticks % 65536L;                  /* Obtain  the fractional number of ticks             */
        OSTimeDly(ticks);
        while (loops > 0) {
            OSTimeDly(32768);
            OSTimeDly(32768);
            loops--;
        }
        return (OS_NO_ERR);
    } else {
        return (OS_TIME_ZERO_DLY);
    }
}
/*$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
*********************************************************************************************************
*/

INT8U OSTimeDlyResume (INT8U prio) reentrant
{
    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)) {    /* See if task is ready to run              */
                OSRdyGrp               |= ptcb->OSTCBBitY; /* Make task ready to run                   */
                OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
                OS_EXIT_CRITICAL();
                OSSched();                                 /* 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       */
        }
    } else {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                        /* The task does not exist                  */
    }
}
/*$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
*********************************************************************************************************
*/

INT32U OSTimeGet (void) reentrant
{
    INT32U ticks;


    OS_ENTER_CRITICAL();
    ticks = OSTime;
    OS_EXIT_CRITICAL();
    return (ticks);
}

/*
*********************************************************************************************************
*                                            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
*********************************************************************************************************
*/

void OSTimeSet (INT32U ticks) reentrant
{
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区成人| 国产jizzjizz一区二区| 日本韩国欧美国产| 亚洲精品伦理在线| 色综合久久精品| 亚洲第一搞黄网站| 在线电影院国产精品| 奇米精品一区二区三区四区 | 91福利区一区二区三区| 一区二区三区四区不卡在线| 欧美偷拍一区二区| 日韩精品电影在线观看| 精品国产伦理网| 成人免费视频国产在线观看| 亚洲品质自拍视频网站| 欧美日韩一区二区三区免费看| 亚洲va中文字幕| 欧美一激情一区二区三区| 韩日av一区二区| 亚洲视频资源在线| 7799精品视频| 国产成人精品午夜视频免费| 亚洲女性喷水在线观看一区| 欧美日韩中字一区| 老司机一区二区| 国产精品天美传媒| 欧美日韩免费一区二区三区| 韩国三级中文字幕hd久久精品| 国产精品少妇自拍| 欧美色手机在线观看| 激情丁香综合五月| 亚洲专区一二三| 精品国精品国产| 一本在线高清不卡dvd| 美日韩一区二区| 亚洲免费av观看| 精品少妇一区二区三区免费观看| 成人爽a毛片一区二区免费| 亚洲高清视频中文字幕| 中文字幕av资源一区| 欧美日韩国产免费一区二区 | 欧美特级限制片免费在线观看| 日韩成人一级片| 亚洲欧美精品午睡沙发| 精品久久人人做人人爽| 一本久道久久综合中文字幕 | 亚洲黄色小说网站| 久久午夜电影网| 欧美疯狂性受xxxxx喷水图片| 福利一区在线观看| 蜜桃视频第一区免费观看| 一区二区不卡在线播放| 亚洲国产经典视频| 精品国产一区二区三区不卡| 欧美主播一区二区三区| av一区二区三区在线| 韩国在线一区二区| 日韩av电影天堂| 亚洲综合男人的天堂| 国产日韩欧美精品一区| 日韩欧美一区中文| 欧美巨大另类极品videosbest| 91蝌蚪国产九色| 成人午夜免费视频| 国内精品在线播放| 免费欧美在线视频| 视频一区在线视频| 亚洲成人高清在线| 一级女性全黄久久生活片免费| 国产精品网站在线| 日本一区二区视频在线| 国产网红主播福利一区二区| 日韩欧美一级片| 欧美一区二区视频免费观看| 欧美精品在线观看播放| 欧美日韩国产一级片| 欧美日韩一区国产| 欧美日韩视频在线观看一区二区三区| 色综合久久中文字幕综合网| 99精品国产视频| 91香蕉视频黄| 色综合激情久久| 日本韩国一区二区三区视频| 色视频成人在线观看免| 在线免费观看一区| 欧美性高清videossexo| 欧美日韩中文一区| 欧美日韩成人在线| 5566中文字幕一区二区电影| 91麻豆精品国产| 日韩一级高清毛片| 欧美tickle裸体挠脚心vk| 欧美成人乱码一区二区三区| 精品国产一区二区三区不卡| 国产亚洲自拍一区| 1区2区3区精品视频| 亚洲精品久久久蜜桃| 亚洲国产成人高清精品| 三级亚洲高清视频| 韩国精品一区二区| 成人免费看黄yyy456| 91视频在线看| 欧美日韩电影一区| 日韩免费电影网站| 国产午夜精品久久久久久免费视| 国产精品久久午夜夜伦鲁鲁| 亚洲乱码国产乱码精品精可以看 | 亚洲成在人线免费| 青青草国产成人99久久| 国产精品一品二品| 色综合咪咪久久| 欧美一区二区三区喷汁尤物| 精品日韩99亚洲| 国产精品国产馆在线真实露脸| 夜夜嗨av一区二区三区网页| 日本美女一区二区三区| 成人综合激情网| 欧美日韩一级片网站| 精品国产乱码久久久久久闺蜜 | 9久草视频在线视频精品| 欧美专区在线观看一区| 2021久久国产精品不只是精品| 国产精品超碰97尤物18| 天天色综合天天| 国产aⅴ精品一区二区三区色成熟| av欧美精品.com| 欧美一区二区啪啪| 亚洲婷婷在线视频| 免费日韩伦理电影| 色菇凉天天综合网| 日韩精品一区二区三区老鸭窝 | 一区二区三区自拍| 久久精品国产在热久久| 91免费观看视频在线| 精品少妇一区二区三区在线播放 | 久久99国产精品免费网站| 91免费看片在线观看| 精品福利av导航| 亚洲人成7777| 国产精品1区二区.| 欧美一区二区三区视频| 亚洲综合一区二区| 波多野结衣中文字幕一区| 日韩欧美中文一区| 亚洲成a人片综合在线| 99热99精品| 国产午夜精品久久久久久免费视 | 亚洲精品免费视频| 国产一区二区在线观看免费| 欧美综合视频在线观看| 中文字幕色av一区二区三区| 卡一卡二国产精品| 日韩欧美一区在线| 婷婷成人激情在线网| 91在线免费视频观看| 国产亚洲综合性久久久影院| 麻豆国产欧美日韩综合精品二区| 欧美日韩一区二区三区高清| 一区二区三区四区在线| 91丨porny丨蝌蚪视频| 国产欧美日韩亚州综合| 国产综合成人久久大片91| 欧美第一区第二区| 免费观看一级欧美片| 欧美日韩国产一区二区三区地区| 亚洲嫩草精品久久| 91丝袜国产在线播放| 1024精品合集| 99在线精品视频| 国产欧美一区二区精品仙草咪| 久久丁香综合五月国产三级网站| 91精品国产综合久久久久| 日本不卡123| 精品国偷自产国产一区| 久久 天天综合| 欧美电影免费提供在线观看| 韩国理伦片一区二区三区在线播放| 日韩免费在线观看| 国产一区二区视频在线播放| 久久久不卡网国产精品二区| 国产成人aaa| 国产精品免费免费| 99国产精品久久久久久久久久久 | 欧美三级乱人伦电影| 夜夜嗨av一区二区三区| 欧美伊人久久久久久午夜久久久久| 一区二区三区毛片| 欧美日韩国产影片| 久久99热国产| 久久久国产午夜精品| 成人av网站在线观看| 一区二区三区四区视频精品免费| 欧美日韩一区二区三区四区| 美女视频黄免费的久久| 欧美精品一区二区三区久久久| 丰满白嫩尤物一区二区| 亚洲色图19p| 欧美日韩性生活| 久久99久久精品| 国产精品美女久久久久久|