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

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

?? os_time.c

?? 9200cpu的ucosii的移植代碼
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2003, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.76
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "ucos_ii.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)
{
    INT8U      y;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    if (ticks > 0) {                             /* 0 means no delay!                                  */
        OS_ENTER_CRITICAL();
        y            =  OSTCBCur->OSTCBY;        /* Delay current task                                 */
        OSRdyTbl[y] &= ~OSTCBCur->OSTCBBitX;
        if (OSRdyTbl[y] == 0) {  
            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 OS_ARG_CHK_EN > 0
    if (hours == 0) {
        if (minutes == 0) {
            if (seconds == 0) {
                if (milli == 0) {
                    return (OS_TIME_ZERO_DLY);
                }
            }
        }
    }
    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);
    }
#endif
                                                 /* 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((INT16U)32768u);
        OSTimeDly((INT16U)32768u);
        loops--;
    }
    return (OS_NO_ERR);
}
#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 can call this function to resume a
*              task that is waiting for an event with timeout.  This would make the task look
*              like a timeout occurred.  
*
*              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 or has been assigned to a Mutex.
*********************************************************************************************************
*/

#if OS_TIME_DLY_RESUME_EN > 0
INT8U  OSTimeDlyResume (INT8U prio)
{
    OS_TCB    *ptcb;
#if OS_CRITICAL_METHOD == 3                                    /* Storage for CPU status register      */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                                /* Prevent compiler warning             */
#endif    
    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) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                            /* The task does not exist              */
    }
    if (ptcb == (OS_TCB *)1) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                            /* The task does not exist              */
    }
    if (ptcb->OSTCBDly == 0) {                                 /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_TIME_NOT_DLY);                              /* Indicate that task was not delayed   */
    }

    ptcb->OSTCBDly = 0;                                        /* Clear the time delay                 */
    if ((ptcb->OSTCBStat & OS_STAT_PEND_ANY) != OS_STAT_RDY) {
        ptcb->OSTCBStat   &= ~OS_STAT_PEND_ANY;                /* Yes, Clear status flag               */
        ptcb->OSTCBPendTO  = TRUE;                             /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBPendTO  = FALSE;
    }
    if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) == OS_STAT_RDY) {  /* Is task suspended?                   */
        OSRdyGrp               |= ptcb->OSTCBBitY;             /* No,  Make ready                      */
        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);
}
#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)
{
    INT32U     ticks;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人app在线观看| 久久色在线观看| 日韩一级片网站| 久久毛片高清国产| 午夜精品免费在线| 成人一道本在线| 在线播放欧美女士性生活| 国产精品蜜臀av| 麻豆成人久久精品二区三区小说| 9i在线看片成人免费| 欧美一级艳片视频免费观看| 亚洲免费观看视频| 国产激情一区二区三区| 欧美日韩视频在线一区二区| 国产精品乱人伦| 久久99精品国产91久久来源| 欧美剧情电影在线观看完整版免费励志电影 | 久久99国产精品久久99 | 91网上在线视频| 久久精品一区二区三区四区| 青青草国产成人av片免费| 91福利在线导航| 亚洲欧美日本在线| av亚洲精华国产精华精| 国产免费观看久久| 岛国av在线一区| 久久综合国产精品| 国产一区二区看久久| 日韩无一区二区| 蜜乳av一区二区三区| 制服丝袜亚洲色图| 日本少妇一区二区| 日韩视频一区二区三区| 美女视频网站黄色亚洲| 日韩一区二区三区免费观看| 免费不卡在线观看| 亚洲精品在线观| 国产一区二区在线视频| 久久看人人爽人人| 成人黄动漫网站免费app| 欧美国产日韩一二三区| 不卡视频免费播放| 一区二区三区日韩精品视频| 在线看一区二区| 亚洲国产精品人人做人人爽| 欧美视频一区二| 午夜亚洲国产au精品一区二区| 欧美日韩一区二区三区高清 | 91在线观看成人| 最近中文字幕一区二区三区| 色哟哟亚洲精品| 亚洲成人免费看| 欧美一二三区在线| 国产成人av一区二区三区在线观看| 久久久国际精品| 9色porny自拍视频一区二区| 亚洲综合丁香婷婷六月香| 67194成人在线观看| 国产一区二区网址| 日韩毛片视频在线看| 欧美日韩国产在线观看| 久久精品国产999大香线蕉| 国产免费久久精品| 欧美日韩精品免费| 国产成人av在线影院| 亚洲精品欧美综合四区| 精品欧美一区二区久久 | 色综合久久综合网97色综合| 五月天亚洲婷婷| 欧美激情一区二区三区蜜桃视频| 色综合久久久网| 久久不见久久见免费视频7| 中文字幕不卡三区| 欧美理论在线播放| 国产99久久久国产精品| 亚洲国产裸拍裸体视频在线观看乱了 | 91女人视频在线观看| 日韩1区2区日韩1区2区| 中文字幕一区在线观看| 91精品婷婷国产综合久久性色| 国产精品1区二区.| 亚洲成人精品一区| 国产精品国产三级国产普通话三级 | 日本一区二区三区免费乱视频| 欧美午夜精品久久久| 国产精品一区久久久久| 天天免费综合色| 国产精品欧美一区喷水| 日韩精品专区在线| 91丨porny丨蝌蚪视频| 国产自产高清不卡| 三级影片在线观看欧美日韩一区二区| 日本一区免费视频| 亚洲精品一区二区在线观看| 欧美午夜影院一区| 播五月开心婷婷综合| 国产精品99久久不卡二区| 天天操天天综合网| 亚洲成av人**亚洲成av**| 国产精品传媒入口麻豆| 国产无人区一区二区三区| 日韩欧美视频在线| 欧美人狂配大交3d怪物一区| 色婷婷精品大在线视频| 99视频精品免费视频| 丰满白嫩尤物一区二区| 久久国产福利国产秒拍| 日韩中文字幕1| 天堂av在线一区| 午夜一区二区三区在线观看| 亚洲综合一二区| 亚洲精品国产第一综合99久久| 国产精品久久777777| 国产精品精品国产色婷婷| 中文字幕免费不卡| 国产精品久久久久天堂| 国产精品免费免费| 亚洲色图19p| 亚洲综合男人的天堂| 亚洲一级片在线观看| 亚洲v精品v日韩v欧美v专区| 亚洲va韩国va欧美va| 午夜成人免费视频| 日韩高清不卡在线| 久久精品国产**网站演员| 免费在线看成人av| 九九热在线视频观看这里只有精品| 日韩在线播放一区二区| 日本色综合中文字幕| 麻豆精品一区二区| 国产一区在线看| 99久久99精品久久久久久| 91色|porny| 欧美日韩免费观看一区三区| 在线不卡欧美精品一区二区三区| 日韩精品中文字幕一区| 国产三级精品视频| 亚洲色图在线播放| 天天av天天翘天天综合网| 美女视频一区二区三区| 国产夫妻精品视频| 在线视频你懂得一区二区三区| 欧美绝品在线观看成人午夜影视| 日韩欧美高清在线| 中文字幕av不卡| 亚洲午夜久久久久久久久电影院| 日韩一区精品字幕| 国产一区二区按摩在线观看| 成av人片一区二区| 欧美精品丝袜中出| 国产精品午夜春色av| 亚洲自拍偷拍av| 国产一区二区三区综合| 91视频xxxx| 欧美一卡2卡3卡4卡| 1区2区3区精品视频| 日韩黄色免费电影| 成人av电影在线网| 日韩一区二区在线免费观看| 亚洲天天做日日做天天谢日日欢| 日日夜夜精品视频天天综合网| 国产精品一二一区| 欧美日韩精品一区二区三区四区| 久久久久久久精| 亚洲成a人v欧美综合天堂| 成人综合在线观看| 日韩欧美在线1卡| 一区二区三区91| 国产成人精品午夜视频免费| 欧美日韩激情一区二区| 综合激情网...| 国产一区二区三区免费看| 欧美图区在线视频| 国产精品久久毛片| 激情六月婷婷综合| 欧美三级乱人伦电影| 欧美激情中文字幕一区二区| 美脚の诱脚舐め脚责91| 欧美午夜精品电影| 亚洲免费伊人电影| 丁香六月综合激情| 精品成人一区二区三区| 亚洲成人免费影院| 欧洲精品一区二区三区在线观看| 国产精品久久久久久久久免费桃花| 精品一区二区久久久| 9191成人精品久久| 亚洲制服丝袜在线| 色94色欧美sute亚洲13| 中文字幕免费在线观看视频一区| 久久狠狠亚洲综合| 日韩午夜在线影院| 日本v片在线高清不卡在线观看| 在线中文字幕一区二区| 亚洲日本护士毛茸茸| av一区二区不卡| 亚洲欧美偷拍卡通变态| 色婷婷综合中文久久一本| 综合自拍亚洲综合图不卡区| 99麻豆久久久国产精品免费|