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

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

?? os_time.c

?? ucos在2407A上的移植
?? 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)
{
    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)
{
    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)
{
    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)
{
    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)
{
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲综合清纯丝袜自拍| 另类小说综合欧美亚洲| 91精品国产综合久久精品麻豆| 精品亚洲免费视频| 亚洲免费伊人电影| 国产亚洲综合av| 在线成人高清不卡| 一本色道a无线码一区v| 国产伦精品一区二区三区免费迷 | 99re66热这里只有精品3直播 | 亚洲欧美另类小说视频| 日韩欧美国产1| 欧美三区在线视频| 91在线免费看| 成人国产精品免费网站| 日韩av一区二| 亚洲高清免费一级二级三级| 亚洲同性gay激情无套| 久久久久国产一区二区三区四区 | 亚洲国产日日夜夜| 自拍av一区二区三区| 国产无遮挡一区二区三区毛片日本| 欧美日韩精品一二三区| 日本韩国视频一区二区| 成人av在线播放网址| 国产98色在线|日韩| 国产一区美女在线| 国产曰批免费观看久久久| 免费成人深夜小野草| 午夜精品123| 偷窥少妇高潮呻吟av久久免费| 亚洲黄网站在线观看| 亚洲色图在线播放| 中文字幕亚洲欧美在线不卡| 国产欧美综合色| 国产亚洲欧美在线| 国产亚洲精品中文字幕| 久久久精品欧美丰满| 久久久久久久久免费| 国产色91在线| 国产精品福利一区| 亚洲婷婷综合色高清在线| 中文字幕一区二区三区av| 国产精品成人一区二区三区夜夜夜| 国产日韩欧美精品一区| 国产精品色在线观看| 国产精品久久久久久久久免费丝袜 | 欧美经典一区二区三区| 国产精品丝袜在线| 亚洲日本免费电影| 一区二区三区波多野结衣在线观看 | 在线观看91精品国产麻豆| 欧美一区二区三区在线| 精品免费99久久| 日本一区二区久久| 亚洲女人的天堂| 天天色图综合网| 激情六月婷婷久久| 成人免费视频一区二区| 91免费精品国自产拍在线不卡| 91成人免费在线| 欧美一区二区免费观在线| 26uuuu精品一区二区| 1区2区3区国产精品| 亚洲韩国一区二区三区| 美女一区二区久久| 成人黄色国产精品网站大全在线免费观看| 成人av综合在线| 欧美三级一区二区| 久久综合九色综合欧美亚洲| 国产精品视频观看| 午夜视频在线观看一区二区| 精品一区中文字幕| 91在线视频免费观看| 欧美精品18+| 日本一区二区免费在线观看视频 | 国内成人精品2018免费看| 国产高清在线观看免费不卡| 色综合久久六月婷婷中文字幕| 欧美日韩第一区日日骚| 欧美经典三级视频一区二区三区| 亚洲一区二区三区中文字幕| 久久精品国产99久久6| 色婷婷综合久久久| 精品国产乱码久久久久久老虎| 亚洲欧美综合在线精品| 免费看欧美女人艹b| 成人毛片在线观看| 欧美一级片在线| 一区二区欧美视频| 国产福利一区在线| 在线成人av影院| 亚洲男人的天堂一区二区| 老司机午夜精品| 精品视频资源站| 国产精品对白交换视频 | 一本大道久久a久久综合婷婷| 欧美一二三区在线观看| 亚洲欧美日韩国产手机在线 | 久久精品视频网| 亚欧色一区w666天堂| 成人av免费在线播放| 日韩三级视频在线观看| 亚洲mv大片欧洲mv大片精品| 成人动漫一区二区| 日韩你懂的在线播放| 亚洲va韩国va欧美va精品| 91丨porny丨首页| 国产欧美一区二区精品性色| 日本va欧美va瓶| 在线观看亚洲一区| 亚洲日本成人在线观看| 成人性生交大片免费看中文| 欧美电视剧免费全集观看| 亚洲国产综合色| 在线观看一区日韩| 亚洲六月丁香色婷婷综合久久 | 亚洲精品老司机| 高清在线成人网| 久久久久免费观看| 另类人妖一区二区av| 91精品国产aⅴ一区二区| 一区二区三区四区av| caoporen国产精品视频| 国产精品久久久久久一区二区三区 | 日韩电影在线观看一区| 欧美午夜影院一区| 一区二区三区欧美久久| 色婷婷综合中文久久一本| 日韩一区欧美一区| 成人国产精品免费观看| 国产精品久久三| eeuss国产一区二区三区| 亚洲欧美综合色| 色综合久久中文综合久久牛| 国产精品成人一区二区艾草| 99久久伊人精品| 亚洲三级电影全部在线观看高清| 91在线观看污| 亚洲图片欧美综合| 欧美日韩一区二区三区四区五区| 亚洲一区av在线| 5月丁香婷婷综合| 另类欧美日韩国产在线| 日韩欧美综合在线| 久久成人久久爱| 久久精品免视看| 91亚洲国产成人精品一区二区三| 一区二区在线观看视频| 欧美日本韩国一区二区三区视频 | 韩国精品一区二区| 欧美韩日一区二区三区四区| 99久免费精品视频在线观看| 综合久久久久久| 欧美日韩精品电影| 精品午夜一区二区三区在线观看 | 久久久www免费人成精品| 成人午夜电影小说| 亚洲精品v日韩精品| 欧美三级电影在线看| 青青草国产成人99久久| 日本一区二区三区免费乱视频 | 日韩 欧美一区二区三区| 欧美精品一区二区三区蜜臀| 成人黄色免费短视频| 亚洲一区免费观看| 欧美va亚洲va| 99在线热播精品免费| 五月天精品一区二区三区| 久久综合给合久久狠狠狠97色69| 波多野结衣中文一区| 亚洲1区2区3区视频| 久久久久久97三级| 在线亚洲高清视频| 精品一区二区在线免费观看| 国产精品水嫩水嫩| 欧美三区免费完整视频在线观看| 狠狠色综合播放一区二区| |精品福利一区二区三区| 欧美一区二区三级| caoporm超碰国产精品| 老司机午夜精品| 一区二区成人在线视频| 久久午夜国产精品| 欧美综合久久久| 国产风韵犹存在线视精品| 亚洲电影在线免费观看| 欧美激情在线一区二区三区| 欧美体内she精高潮| 丰满亚洲少妇av| 免费成人在线观看| 亚洲一区二区三区爽爽爽爽爽| 久久久久久久久99精品| 91精品在线免费| 91免费国产视频网站| 国产乱理伦片在线观看夜一区| 一区二区三区欧美日韩| 国产精品国产三级国产普通话99| 欧美videos中文字幕| 欧美高清性hdvideosex|