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

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

?? os_time.c

?? 在MC68HC908JB8上移植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
*********************************************************************************************************
*/

#include "includes.h"


/*
*********************************************************************************************************
*                                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一区二区三区免费野_久草精品视频
国产精品伦一区| 精品视频123区在线观看| 国产性天天综合网| 日韩免费观看高清完整版在线观看| 欧美日韩精品一区二区三区| 久久欧美一区二区| 麻豆精品新av中文字幕| 日韩一区二区三| 男人操女人的视频在线观看欧美 | 欧美视频中文一区二区三区在线观看| 亚洲精品一区二区三区四区高清 | 亚洲午夜久久久久中文字幕久| av在线不卡网| 综合激情成人伊人| 91在线porny国产在线看| 亚洲日本一区二区三区| 99re热视频这里只精品| 一区二区三区中文字幕精品精品 | 日韩经典中文字幕一区| 欧美日韩高清在线| 日本aⅴ精品一区二区三区 | 日韩一区二区视频在线观看| 蜜臀av一区二区在线观看| 欧美在线不卡一区| 亚洲18影院在线观看| 日韩无一区二区| 久久66热re国产| 亚洲欧洲一区二区在线播放| 91在线播放网址| 亚洲国产日韩a在线播放性色| 欧美日本在线播放| 国产一区二区女| 亚洲欧洲日韩综合一区二区| 在线观看国产精品网站| 日本成人在线看| 中文字幕第一区二区| 色久优优欧美色久优优| 日韩不卡一区二区| 国产精一品亚洲二区在线视频| 欧美在线免费观看亚洲| 日本美女视频一区二区| 成人成人成人在线视频| 欧美网站大全在线观看| 中文子幕无线码一区tr| 日本不卡免费在线视频| 国产成人免费在线观看不卡| 精品国产1区2区3区| 五月激情综合色| 成人禁用看黄a在线| 精品一区二区三区视频在线观看 | 久久精品夜夜夜夜久久| 97久久超碰国产精品| 日韩精品亚洲专区| 久久精品亚洲乱码伦伦中文| 欧美性猛交xxxxxx富婆| 国产成人aaa| 亚洲女人****多毛耸耸8| 91精品国产一区二区三区蜜臀| 成人91在线观看| 久久精品国产在热久久| 亚洲免费在线视频一区 二区| 51精品视频一区二区三区| 成人国产一区二区三区精品| 蜜桃视频第一区免费观看| 亚洲狼人国产精品| 中文字幕精品在线不卡| 欧美本精品男人aⅴ天堂| 在线观看视频91| 成人国产精品免费观看| 久久av资源网| 日本特黄久久久高潮| 一区二区三区日韩欧美| 国产精品传媒入口麻豆| 91精品国产入口| 欧美视频一区二区三区在线观看| 国产老女人精品毛片久久| 青青草国产精品亚洲专区无| 亚洲与欧洲av电影| 久久精品一区二区三区av| 日韩午夜在线观看| 欧美精品一二三区| 99久久久国产精品| 成人avav在线| 成人sese在线| 成人不卡免费av| 粉嫩高潮美女一区二区三区| 激情五月激情综合网| 美女爽到高潮91| 奇米影视一区二区三区小说| 日韩一级欧美一级| 91久久精品一区二区| 日韩电影在线免费看| 国产精品电影一区二区三区| 欧美日韩一区二区在线观看 | 国产欧美日韩亚州综合| 成人免费视频app| 日韩高清一级片| 亚洲国产欧美在线人成| 国产片一区二区| 日本不卡在线视频| 蜜臀av在线播放一区二区三区| 亚洲第一福利视频在线| 午夜av电影一区| 国产一区91精品张津瑜| 91麻豆自制传媒国产之光| 欧美日韩一区二区电影| 26uuu精品一区二区三区四区在线| 久久久久久久久久美女| 亚洲精品欧美在线| 久久精品国产色蜜蜜麻豆| 岛国精品在线播放| 欧美视频中文一区二区三区在线观看| 欧美一二三在线| 国产精品情趣视频| 日韩电影一区二区三区四区| 国产激情一区二区三区四区| 欧美网站一区二区| 久久久精品国产99久久精品芒果| 一区二区在线观看av| 国产中文一区二区三区| 91久久奴性调教| 国产欧美精品一区| 日本女人一区二区三区| 99久久综合99久久综合网站| 日韩欧美一区二区免费| 亚洲精品第一国产综合野| 国产一区二区视频在线| 欧美日韩精品一区二区三区| 欧美激情一区在线观看| 奇米综合一区二区三区精品视频| 91原创在线视频| 久久久蜜桃精品| 亚洲一区二区三区视频在线播放| 国产一区在线看| 777色狠狠一区二区三区| 成人欧美一区二区三区白人| 韩国一区二区在线观看| 欧美日韩午夜在线| 亚洲三级在线播放| 国产成人夜色高潮福利影视| 日韩一区二区三区在线| 亚洲福中文字幕伊人影院| 成人18视频日本| 中文一区在线播放| 国产在线精品免费av| 日韩欧美成人午夜| 日韩电影免费一区| 欧美日韩一区成人| 国产精品电影一区二区| 国产 欧美在线| 久久99国内精品| 亚洲一区二区三区在线播放| 99re66热这里只有精品3直播 | 床上的激情91.| 中文字幕字幕中文在线中不卡视频| 蜜臀av性久久久久蜜臀aⅴ | 不卡的av电影| 国产成人av影院| 欧美精品一区二区久久婷婷| 日本在线观看不卡视频| 欧美色综合网站| 亚洲精品免费在线观看| 99久久精品免费看国产| 国产欧美精品在线观看| 国产剧情一区二区| 久久影视一区二区| 国产麻豆成人精品| 久久久久国产成人精品亚洲午夜| 蜜乳av一区二区| 欧美精品一区二区三区视频| 久久精品二区亚洲w码| 欧美大片日本大片免费观看| 另类综合日韩欧美亚洲| 欧美成人三级在线| 狠狠色丁香九九婷婷综合五月| 精品黑人一区二区三区久久| 免费在线看成人av| 久久久久久久久久久久久女国产乱 | 日韩免费观看2025年上映的电影| 日本成人中文字幕在线视频| 日韩欧美国产综合| 国产91在线看| 亚洲欧美国产三级| 欧美性受极品xxxx喷水| 天天综合网 天天综合色| 日韩精品一区二区三区在线观看 | 在线视频欧美精品| 亚洲午夜久久久久| 欧美一区二区三区人| 看电视剧不卡顿的网站| 精品国产露脸精彩对白| 大胆欧美人体老妇| 夜夜亚洲天天久久| 91精品视频网| 成人激情开心网| 一区二区三区在线影院| 日韩一区二区不卡| 成人午夜视频在线观看| 午夜精品久久久久久久蜜桃app| 欧美va天堂va视频va在线|