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

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

?? os_time.c

?? 基于ADS1.2環境編寫的UC/OS-II的移植源代碼
?? 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一区二区三区免费野_久草精品视频
久久精品视频在线看| 7777精品伊人久久久大香线蕉经典版下载 | 欧美精品在线观看一区二区| 成人性视频免费网站| 国产一区二区精品久久| 高清国产午夜精品久久久久久| 日本一不卡视频| 亚洲影院在线观看| 中文字幕综合网| 国产精品麻豆欧美日韩ww| 久久九九国产精品| 国产欧美日韩精品a在线观看| 久久久www成人免费无遮挡大片| 日韩视频免费直播| 日韩精品一区二区三区在线观看| 欧美精品一卡两卡| 91精品国产色综合久久不卡蜜臀| 欧洲一区二区av| 欧美羞羞免费网站| 欧美日韩午夜精品| 91精品欧美一区二区三区综合在| 成人黄色在线视频| 91香蕉视频在线| 一本久久精品一区二区| 色综合久久综合网| 欧美日精品一区视频| 欧美日韩国产综合一区二区三区| 欧美日韩亚洲综合| 日韩欧美高清在线| 久久久久九九视频| 国产精品乱码人人做人人爱| 国产精品久久毛片a| 亚洲综合色自拍一区| 午夜精品福利一区二区三区av| 日韩中文字幕亚洲一区二区va在线| 日日夜夜精品视频免费| 国产一区二区中文字幕| 91在线小视频| 欧美一级在线免费| 日本一区二区三区国色天香| 综合电影一区二区三区 | 国产精品毛片高清在线完整版| 亚洲国产精品成人综合| 久久精品亚洲精品国产欧美| 综合激情成人伊人| 亚洲成人av福利| 国产麻豆欧美日韩一区| 色综合久久66| 精品久久久久久久久久久久久久久久久| 日韩三级电影网址| 日韩一区在线播放| 日本sm残虐另类| 99这里只有久久精品视频| 欧美性一二三区| 337p亚洲精品色噜噜| 国产精品乱码一区二三区小蝌蚪| 亚洲一区二区三区四区的| 韩国欧美国产1区| 在线精品视频一区二区三四| 欧美精品一区二区三区四区| 中文字幕一区二区三区四区| 亚洲人成人一区二区在线观看| 婷婷久久综合九色综合绿巨人| 成人av免费在线播放| 精品视频在线免费| 欧美激情中文不卡| 国模大尺度一区二区三区| 欧美视频一区二区| 国产亚洲1区2区3区| 热久久久久久久| 色噜噜夜夜夜综合网| 久久久精品人体av艺术| 日本sm残虐另类| 欧美日韩一区二区欧美激情| 国产精品传媒入口麻豆| 国产在线国偷精品免费看| 69p69国产精品| 亚洲国产视频a| 色欧美88888久久久久久影院| 国产人妖乱国产精品人妖| 激情综合网av| 欧美一区二区三区视频免费播放| 亚洲精品欧美激情| 97精品国产露脸对白| 中文字幕免费在线观看视频一区| 国产综合久久久久影院| 欧美一区二区三区免费视频| 亚洲伊人伊色伊影伊综合网| 一本久道中文字幕精品亚洲嫩| 日韩一区欧美一区| 91麻豆6部合集magnet| 亚洲欧洲日韩在线| 91在线视频在线| 亚洲欧美日韩国产综合| 91年精品国产| 一区二区在线电影| 91在线高清观看| 亚洲色图欧美激情| 色婷婷亚洲精品| 一区二区三区成人在线视频| 欧美三级在线视频| 首页欧美精品中文字幕| 欧美一区二区视频在线观看2020 | 国产精品亚洲午夜一区二区三区| 日韩欧美国产一二三区| 另类小说色综合网站| 欧美精品一区二区三区四区| 国产在线国偷精品产拍免费yy| 久久久一区二区三区| 国产成人亚洲综合a∨婷婷图片| 久久精品一区四区| jiyouzz国产精品久久| 亚洲免费在线观看| 欧美日韩精品一二三区| 日产欧产美韩系列久久99| 精品国产一区二区三区久久久蜜月| 免费xxxx性欧美18vr| 国产日韩欧美激情| 色综合久久中文字幕| 日韩av一区二区三区| 国产无人区一区二区三区| 色婷婷精品大视频在线蜜桃视频| 亚洲福利国产精品| 久久综合成人精品亚洲另类欧美 | 精品国内二区三区| 国产成人亚洲综合色影视| 最近中文字幕一区二区三区| 欧美日韩国产片| 国产伦精品一区二区三区视频青涩 | 欧美激情一区二区三区四区| 欧美中文字幕亚洲一区二区va在线 | 欧美另类videos死尸| 国产精品系列在线播放| 一区二区在线观看视频| 精品美女在线播放| 色综合色狠狠综合色| 激情综合色播五月| 亚洲一级电影视频| 国产日韩欧美a| 56国语精品自产拍在线观看| 99久久精品久久久久久清纯| 免费在线观看一区| 一区二区免费在线| 国产欧美一二三区| 日韩欧美中文一区二区| 不卡一区中文字幕| 精品一区二区三区久久| 亚洲精品成人天堂一二三| 久久精子c满五个校花| 欧美一区二区女人| 日本韩国欧美一区二区三区| 国产999精品久久久久久| 久久国产夜色精品鲁鲁99| 亚洲国产日韩精品| 国产精品电影一区二区| 亚洲精品在线免费播放| 91精品国产综合久久小美女| 色一情一乱一乱一91av| 粉嫩蜜臀av国产精品网站| 捆绑调教美女网站视频一区| 亚洲一区二区精品久久av| 国产精品色一区二区三区| 国产无遮挡一区二区三区毛片日本| 亚洲一本大道在线| 国产精品视频第一区| 国产亚洲欧美中文| 久久这里只有精品首页| 日韩一区二区三区在线观看| 欧美精品自拍偷拍| 欧美日韩国产精品自在自线| 色www精品视频在线观看| av电影天堂一区二区在线| 成人性视频免费网站| 国产成人精品影院| 国产·精品毛片| 国产成人av影院| 国产凹凸在线观看一区二区| 国产精品一卡二卡在线观看| 国产一区二区久久| 国产91露脸合集magnet| 国产麻豆精品在线观看| 国产精品一区不卡| 国产99久久精品| 成人黄色国产精品网站大全在线免费观看 | 精品亚洲成av人在线观看| 久久99久久久欧美国产| 国内外精品视频| 国产精品一区2区| 成人免费看黄yyy456| heyzo一本久久综合| 91视频国产资源| 欧美视频一区二区三区| 制服丝袜成人动漫| 久久久一区二区三区| 国产精品国产三级国产普通话99| 一区二区三区在线观看国产 | 亚洲国产成人自拍| 亚洲欧美一区二区不卡| 午夜私人影院久久久久| 老司机精品视频一区二区三区|