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

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

?? os_time.c

?? UCOS在凌陽16位單片機SPCE061A上的移植的源碼
?? 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();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一区二区三区中文不卡 | 日韩成人一区二区| 老司机精品视频在线| 欧美一区三区二区| 亚洲电影第三页| 欧美亚洲动漫另类| 一区二区三区在线播放| 99久久国产综合精品女不卡| 欧美韩国日本一区| 成人亚洲精品久久久久软件| 精品国产一区二区三区忘忧草| 日韩电影一二三区| 日韩美一区二区三区| 国产风韵犹存在线视精品| 亚洲欧美影音先锋| 337p亚洲精品色噜噜| 国产在线视频不卡二| 亚洲欧美激情小说另类| 6080日韩午夜伦伦午夜伦| 国产精品资源在线观看| 亚洲精品成人精品456| 亚洲一区视频在线| 欧美一区二区视频在线观看2022| 国产最新精品免费| 亚洲免费色视频| 91精品国产手机| 岛国一区二区在线观看| 调教+趴+乳夹+国产+精品| 久久久久99精品国产片| 欧美日韩精品久久久| 国产精品一区二区在线播放| 亚洲在线观看免费| 亚洲精品在线观看视频| 欧美色男人天堂| 国产乱色国产精品免费视频| 一区二区三区四区不卡在线| 久久久久久久久久久久久久久99| 97久久超碰国产精品| 精品一二三四区| 一区二区三区高清| 日本一二三不卡| 日韩欧美在线123| 欧美色手机在线观看| 国产白丝精品91爽爽久久| 欧美aaaaa成人免费观看视频| 曰韩精品一区二区| 国产精品全国免费观看高清| 欧美成人精品高清在线播放| 欧美三片在线视频观看| jizz一区二区| 国产成a人亚洲精品| 激情六月婷婷久久| 五月激情综合婷婷| 一区二区三区在线观看网站| 成人免费一区二区三区视频| 久久久午夜电影| 精品精品国产高清a毛片牛牛| 欧美日韩在线三级| 欧美亚洲综合色| 欧日韩精品视频| 色狠狠综合天天综合综合| caoporen国产精品视频| 成人综合婷婷国产精品久久蜜臀| 国产一区二区在线观看视频| 老司机精品视频导航| 麻豆91精品91久久久的内涵| 日韩高清不卡一区| 日韩黄色小视频| 三级一区在线视频先锋 | 中文字幕五月欧美| 久久网这里都是精品| 欧美mv日韩mv| 日韩精品影音先锋| 亚洲精品一线二线三线 | 国产欧美日韩三级| 国产视频一区在线观看| 国产日韩亚洲欧美综合| 久久综合99re88久久爱| 久久这里只有精品视频网| 久久综合国产精品| 国产色产综合产在线视频| 国产亚洲人成网站| 日本一区二区免费在线观看视频| 欧美韩国日本一区| 亚洲日本护士毛茸茸| 一区二区三区在线视频播放| 99r国产精品| jiyouzz国产精品久久| 欧美综合一区二区| 91麻豆精品国产自产在线观看一区| 91精品国产欧美一区二区18| 日韩午夜电影av| 日本一区二区三区在线不卡| 亚洲欧美一区二区不卡| 亚洲午夜久久久久久久久电影网| 婷婷亚洲久悠悠色悠在线播放| 日韩1区2区3区| 国产高清视频一区| 91网站最新地址| 欧美高清性hdvideosex| 欧美大黄免费观看| 国产精品高潮呻吟久久| 亚洲国产综合在线| 国产一区二区三区四区五区入口| av在线这里只有精品| 欧美电影在线免费观看| 国产午夜一区二区三区| 亚洲综合区在线| 久久精品国产77777蜜臀| 成人永久看片免费视频天堂| 91久久线看在观草草青青| 日韩一区二区精品| 中文字幕一区二区不卡| 午夜精品福利一区二区三区蜜桃| 国产一区二区三区观看| 欧美艳星brazzers| 久久久久久久久久久久久女国产乱| 综合中文字幕亚洲| 久久99国产精品免费网站| 不卡av在线网| 欧美一区二区三区小说| 国产欧美日韩中文久久| 日韩中文字幕麻豆| 成人在线综合网站| 91精品国产色综合久久ai换脸| 中文字幕一区二区三区视频 | 久久久久亚洲蜜桃| 亚洲毛片av在线| 国产一区二区在线观看视频| 欧美在线一区二区| 国产精品久久久久久久裸模| 美女爽到高潮91| 欧美吻胸吃奶大尺度电影| 国产欧美一区二区精品婷婷| 日本伊人色综合网| 91久久精品网| 国产精品网站在线播放| 国产综合色在线视频区| 欧美日韩性生活| 亚洲欧美一区二区久久| 成人永久aaa| 久久午夜羞羞影院免费观看| 午夜av一区二区三区| 91亚洲永久精品| 国产精品久久久久久久久免费相片| 蜜臀av一区二区三区| 欧美日韩视频在线第一区| 亚洲乱码中文字幕| 99久久精品国产一区二区三区 | 1000精品久久久久久久久| 国产一区 二区| 日韩色在线观看| 欧美伊人精品成人久久综合97 | 欧美一区二区精品| 亚洲自拍与偷拍| 一本久久a久久免费精品不卡| 国产精品人人做人人爽人人添| 国产高清久久久| 久久久影院官网| 国产大陆a不卡| 精品福利视频一区二区三区| 免费成人深夜小野草| 欧美一区二区三区四区久久| 首页亚洲欧美制服丝腿| 欧美日韩免费电影| 五月综合激情网| 欧洲一区在线观看| 亚洲综合无码一区二区| 91香蕉国产在线观看软件| 亚洲欧美日韩久久| 日本久久一区二区三区| 亚洲一二三专区| 欧美日韩国产一级二级| 日本三级亚洲精品| 日韩欧美一区二区不卡| 精品一区二区三区不卡 | 最新热久久免费视频| 色综合一个色综合亚洲| 亚洲综合清纯丝袜自拍| 制服丝袜中文字幕亚洲| 精品制服美女丁香| 久久久蜜臀国产一区二区| 成人性生交大片免费看视频在线| 国产欧美一区二区精品忘忧草| jlzzjlzz欧美大全| 亚洲风情在线资源站| 欧美一二三四区在线| 国产aⅴ综合色| 一区二区三区四区激情| 欧美一级在线视频| 国产+成+人+亚洲欧洲自线| 国产一区二区免费在线| 亚洲三级视频在线观看| 欧美日韩一区二区欧美激情| 麻豆成人久久精品二区三区小说| 国产精品天美传媒| 欧美日韩激情在线| 国产精品 欧美精品| 亚洲国产一区在线观看| 欧美va在线播放|