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

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

?? os_time.c

?? 基于GE00 實驗系統開發板的實驗指導用途
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* 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 OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT8U      y;


    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 (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);
    }
                                                 /* 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 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
*********************************************************************************************************
*/

#if OS_TIME_DLY_RESUME_EN > 0
INT8U  OSTimeDlyResume (INT8U prio)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    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) == OS_STAT_RDY) {  /* See if task is ready to run  */
                OSRdyGrp               |= ptcb->OSTCBBitY;             /* Make task ready to run       */
                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);
        } else {
            OS_EXIT_CRITICAL();
            return (OS_TIME_NOT_DLY);                      /* Indicate that task was not delayed       */
        }
    }
    OS_EXIT_CRITICAL();
    return (OS_TASK_NOT_EXIST);                            /* The task does not exist                  */
}
#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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT32U     ticks;


    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;
#endif    


    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费电影视频| 国产精品一二三| 亚洲三级免费观看| 国产精品免费视频网站| www国产精品av| 欧美成人高清电影在线| 欧美一区永久视频免费观看| 制服丝袜亚洲播放| 欧美国产97人人爽人人喊| 91精品欧美久久久久久动漫| 欧美日韩亚州综合| 91麻豆精品91久久久久同性| 日韩一区二区三区在线| 911国产精品| 日韩免费看的电影| 国产人成一区二区三区影院| 国产精品伦理在线| 一区二区三区四区精品在线视频| 有坂深雪av一区二区精品| 亚洲一区二区三区美女| 男女男精品网站| 国产精品一区二区久激情瑜伽| 国产成人免费视频网站| 91丨国产丨九色丨pron| 欧美日韩国产高清一区二区| 日韩一级片在线观看| 久久久精品人体av艺术| 自拍偷自拍亚洲精品播放| 亚洲国产va精品久久久不卡综合| 免费高清视频精品| 97久久精品人人澡人人爽| 欧美体内she精高潮| 久久在线观看免费| 中文字幕一区二区三区色视频| 亚洲综合一区在线| 黑人巨大精品欧美一区| 色婷婷狠狠综合| 精品国产91洋老外米糕| 亚洲四区在线观看| 久久99国产精品免费| 972aa.com艺术欧美| 精品久久国产老人久久综合| 国产精品区一区二区三区| 一区二区三区欧美激情| 韩国一区二区三区| 欧美嫩在线观看| 国产精品久久久久久久久动漫| 石原莉奈在线亚洲二区| 97久久人人超碰| 精品久久一区二区三区| 午夜精品一区二区三区免费视频 | 久久久久九九视频| 一区二区三区欧美日| 粗大黑人巨茎大战欧美成人| 91麻豆精品国产91久久久久| 亚洲男人的天堂网| 国产大片一区二区| 欧美一卡二卡在线| 亚洲电影中文字幕在线观看| 成人av网址在线观看| 欧美成人欧美edvon| 日韩国产精品大片| 欧美视频一区二区三区在线观看| 国产欧美日韩视频在线观看| 久久精品国产亚洲a| 欧美日韩aaaaa| 亚洲一区中文日韩| 欧洲激情一区二区| 亚洲综合免费观看高清完整版| 成人av在线一区二区三区| 2欧美一区二区三区在线观看视频| 午夜精品久久一牛影视| 欧美三级中文字幕| 亚洲福利视频导航| 欧美人牲a欧美精品| 亚洲国产美女搞黄色| 欧洲av在线精品| 亚洲一区在线看| 欧美色网站导航| 香蕉成人伊视频在线观看| 欧美亚洲综合网| 日韩在线播放一区二区| 欧美美女网站色| 日韩中文字幕区一区有砖一区| 777xxx欧美| 麻豆精品视频在线观看免费| 日韩欧美电影一区| 蜜臀av国产精品久久久久| 日韩三级在线观看| 国产精品一区二区黑丝| 欧美国产乱子伦 | 国产亚洲欧美日韩日本| 国产美女精品一区二区三区| 久久久久久免费| 大美女一区二区三区| 亚洲欧美成aⅴ人在线观看| 色妹子一区二区| 日韩精品一区第一页| 精品久久人人做人人爱| 不卡一区中文字幕| 亚洲最新视频在线观看| 日韩一区二区三区三四区视频在线观看 | 欧美mv日韩mv| 成人午夜激情在线| 夜夜嗨av一区二区三区 | 九色|91porny| 国产精品高潮久久久久无| 91国模大尺度私拍在线视频| 日韩专区中文字幕一区二区| 久久久不卡网国产精品二区| 成人高清在线视频| 亚洲一区二区精品3399| 精品99久久久久久| 日本高清免费不卡视频| 狠狠色丁香婷综合久久| 一区二区成人在线视频 | 成人免费va视频| 亚洲成人综合网站| 国产精品视频yy9299一区| 欧美日韩免费一区二区三区| 国产精品原创巨作av| 亚洲电影一级片| 国产精品嫩草99a| 日韩精品一区二区三区在线| caoporen国产精品视频| 美女精品一区二区| 亚洲老妇xxxxxx| 久久亚洲二区三区| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲黄色性网站| 亚洲精品一区二区精华| 欧美手机在线视频| 91在线视频在线| 国产精品中文字幕欧美| 亚洲最大成人综合| 国产精品美女久久久久久2018| 欧美一区日本一区韩国一区| 99热这里都是精品| 国产aⅴ综合色| 麻豆精品视频在线| 午夜精品久久久久影视| **网站欧美大片在线观看| 丁香一区二区三区| 国产麻豆视频一区| 国产专区欧美精品| 国产美女精品一区二区三区| 婷婷综合五月天| 亚洲地区一二三色| 性感美女极品91精品| 亚洲国产视频直播| 亚洲一区二区三区四区五区中文| 综合电影一区二区三区| 亚洲人成伊人成综合网小说| 国产精品拍天天在线| 久久久久久久久97黄色工厂| 精品国产免费久久| 欧美精品一区二区三区在线播放 | 另类综合日韩欧美亚洲| 亚洲国产裸拍裸体视频在线观看乱了| 国产精品久久久久久久久快鸭| 久久久久久久久一| 日本一区二区成人在线| 欧美国产激情一区二区三区蜜月| 欧美国产激情二区三区| 综合欧美亚洲日本| 一区二区三区精品在线观看| 亚洲一区二区视频| 亚洲第一二三四区| 蜜臀久久久久久久| 国产成人精品一区二区三区网站观看| 国产成人午夜精品影院观看视频| 国产成人综合网站| 94色蜜桃网一区二区三区| 在线视频综合导航| 欧美老肥妇做.爰bbww视频| 88在线观看91蜜桃国自产| 欧美精品色综合| 欧美成人video| 国产精品久久久久久久久动漫 | 亚洲色图.com| 视频精品一区二区| 国产精品自在欧美一区| 97精品久久久久中文字幕| 欧美性大战久久久久久久| 91精品国产全国免费观看| 日韩一区二区精品在线观看| 亚洲精品在线电影| 亚洲精选免费视频| 美女视频黄免费的久久| 成人教育av在线| 欧美日韩视频一区二区| 欧美精品一区二区三区在线| 中文字幕一区二| 日本sm残虐另类| 不卡的av网站| 欧美精品一区二区三区四区| 亚洲视频每日更新| 狠狠v欧美v日韩v亚洲ⅴ| 欧美中文字幕一二三区视频| 日韩欧美国产不卡|