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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? os_time.c

?? 是一個(gè)有6個(gè)task的ucos演示程序
?? C
字號(hào):
/*
*********************************************************************************************************
*                                                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    


    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();
        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 || 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 = (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(32768);
            OSTimeDly(32768);
            loops--;
        }
        return (OS_NO_ERR);
    }
    return (OS_TIME_ZERO_DLY);
}
#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    

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看精品一区| 久久99精品久久久久久| 成人高清免费观看| 欧美极品xxx| 97精品久久久午夜一区二区三区| 国产精品麻豆欧美日韩ww| 99久久精品免费看| 亚洲精品乱码久久久久久| 欧洲av在线精品| 午夜国产精品影院在线观看| 91精品国产综合久久久久久久| 轻轻草成人在线| 久久久久久毛片| 成人在线视频一区二区| 一区二区三区在线高清| 欧美精品xxxxbbbb| 国产伦精品一区二区三区在线观看| 国产调教视频一区| 色综合一个色综合亚洲| 亚洲第一福利一区| 久久久五月婷婷| 色先锋久久av资源部| 天堂一区二区在线| 国产午夜亚洲精品午夜鲁丝片 | 99久久精品久久久久久清纯| 中文字幕一区二| 欧美色精品天天在线观看视频| 日韩不卡免费视频| 国产精品天干天干在线综合| 色香蕉久久蜜桃| 久草在线在线精品观看| 中文字幕不卡三区| 欧美精品视频www在线观看| 国产在线精品一区二区不卡了 | 亚洲视频 欧洲视频| 欧美日韩aaaaaa| 大尺度一区二区| 日韩精品色哟哟| 中文字幕在线不卡视频| 欧美一区二区在线免费观看| 国产成人av电影在线观看| 亚洲va韩国va欧美va精品| 久久久www免费人成精品| 欧美性色aⅴ视频一区日韩精品| 韩日欧美一区二区三区| 亚洲线精品一区二区三区 | 国产精品日日摸夜夜摸av| 91精品久久久久久蜜臀| 99精品国产热久久91蜜凸| 精品一区二区免费在线观看| 亚洲午夜久久久久久久久电影院 | 国产色产综合色产在线视频| 欧美视频日韩视频| 99国产精品99久久久久久| 国内精品自线一区二区三区视频| 亚洲在线成人精品| 国产精品另类一区| 久久久www成人免费毛片麻豆| 制服丝袜亚洲色图| 欧美吞精做爰啪啪高潮| 91在线视频免费观看| 成人精品视频一区二区三区| 国产一区二区三区蝌蚪| 蜜臀国产一区二区三区在线播放| 亚洲一级二级三级在线免费观看| 国产精品嫩草影院com| 久久久99精品免费观看| 亚洲精品一区二区三区在线观看 | 欧美成人国产一区二区| 9191国产精品| 欧美日韩高清影院| 欧美日产在线观看| 欧美日韩视频在线第一区| 欧美在线一二三四区| 91黄色免费版| 欧美专区在线观看一区| 色婷婷激情综合| 色94色欧美sute亚洲线路一久| 91影院在线观看| 99精品视频在线播放观看| 99精品在线免费| 色欧美日韩亚洲| 色狠狠色狠狠综合| 欧美探花视频资源| 欧美放荡的少妇| 欧美一卡二卡三卡| 精品欧美乱码久久久久久| 99视频在线精品| 91激情五月电影| 欧美猛男男办公室激情| 67194成人在线观看| 欧美一区二区福利在线| 精品日韩一区二区| 久久久久高清精品| 中文字幕一区二区三区四区不卡 | 精品国产乱码久久久久久久久| 日韩欧美一区二区在线视频| 精品日韩av一区二区| 久久久久久免费| 亚洲色欲色欲www在线观看| 一区二区理论电影在线观看| 午夜精品久久久久久不卡8050| 日本欧美加勒比视频| 国产在线不卡视频| 91丨九色丨国产丨porny| 欧美在线观看一区| 日韩欧美另类在线| 国产精品免费视频网站| 亚洲综合一区二区精品导航| 日韩成人一级大片| 成人妖精视频yjsp地址| 欧美在线观看一区| www久久精品| 亚洲区小说区图片区qvod| 亚洲成人动漫av| 国产精品996| 91福利在线导航| 精品国产一区二区三区忘忧草| 欧美激情一区二区三区不卡| 亚洲aⅴ怡春院| 粉嫩av一区二区三区在线播放| 日本精品一区二区三区高清 | 精品久久国产字幕高潮| 国产精品久久久久久福利一牛影视| 亚洲永久精品国产| 国产成人在线网站| 国产欧美一区二区在线| 亚洲日本在线观看| 美女精品一区二区| 欧美在线一区二区| 国产精品欧美一级免费| 日本一区中文字幕| 99国产麻豆精品| 欧美精品一区二区三| 亚洲成人免费看| 成人黄色在线网站| 精品三级av在线| 午夜视频在线观看一区二区三区| 高清成人免费视频| 欧美成人一区二区三区片免费| 亚洲天堂2016| 国产精品一区二区久久精品爱涩 | 成人免费看的视频| 欧美电影精品一区二区| 亚洲国产另类精品专区| 99精品在线免费| 国产日韩欧美一区二区三区综合| 天使萌一区二区三区免费观看| 91视频一区二区三区| 国产欧美一区二区精品性色| 美脚の诱脚舐め脚责91 | 天天免费综合色| 91国模大尺度私拍在线视频| 国产精品乱人伦一区二区| 国产精品影视在线| 精品久久久久久久一区二区蜜臀| 亚洲成人av福利| 在线观看91精品国产入口| **欧美大码日韩| 成av人片一区二区| 国产精品嫩草影院av蜜臀| 国产成人在线视频网址| 国产日产欧美一区| 粉嫩高潮美女一区二区三区| 久久久精品tv| 国产成人免费在线视频| 久久久久久久久久久99999| 国产一区在线观看麻豆| 精品1区2区在线观看| 精品一区二区三区av| 日韩精品一区二区三区四区| 男男视频亚洲欧美| 精品国产91久久久久久久妲己| 毛片av中文字幕一区二区| 日韩欧美中文字幕制服| 国产在线日韩欧美| 国产午夜精品久久久久久免费视 | 欧美日韩高清不卡| 午夜久久久久久电影| 日韩一区二区在线看片| 精品在线播放免费| 国产日韩亚洲欧美综合| 成人av综合在线| 亚洲精品一二三四区| 欧美日韩色一区| 久久国产精品99久久久久久老狼| 久久亚洲影视婷婷| 久久久久久久久久久黄色| 国产激情视频一区二区三区欧美| 国产三级欧美三级| 91小视频免费观看| 亚洲6080在线| 26uuu精品一区二区三区四区在线| 国产成人综合在线| 亚洲美腿欧美偷拍| 欧美一卡在线观看| www.在线成人| 舔着乳尖日韩一区| 久久网这里都是精品| 99精品一区二区三区|