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

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

?? os_time.c

?? ARM7的一些試驗程序
?? 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一区二区三区免费野_久草精品视频
成人av在线资源网站| 日韩欧美一区电影| 欧美一级精品在线| 中文字幕一区免费在线观看| 日韩av一二三| 99视频在线精品| 精品久久人人做人人爰| 亚洲成人福利片| 日本高清不卡aⅴ免费网站| 国产清纯在线一区二区www| 日韩va欧美va亚洲va久久| 日本乱人伦aⅴ精品| 国产精品三级久久久久三级| 91精彩视频在线| 国产欧美精品一区二区色综合 | 亚洲精品写真福利| 风流少妇一区二区| 久久久久97国产精华液好用吗| 日欧美一区二区| 欧美久久一区二区| 亚洲国产成人tv| 欧美伊人久久久久久久久影院| 国产精品成人免费在线| 国产激情视频一区二区三区欧美| 精品国产一区二区三区久久影院| 免费在线观看视频一区| 欧美亚洲一区二区在线| 一区二区三区在线观看视频| av亚洲精华国产精华精| 亚洲国产岛国毛片在线| 不卡一区二区在线| ...xxx性欧美| 91福利资源站| 亚洲国产日韩在线一区模特| 色菇凉天天综合网| 亚洲综合在线免费观看| 欧美日韩精品免费观看视频| 亚洲3atv精品一区二区三区| 欧美亚洲另类激情小说| 丝袜亚洲另类丝袜在线| 日韩免费性生活视频播放| 欧美日韩一级片在线观看| 亚洲线精品一区二区三区| 日本高清不卡视频| 亚洲动漫第一页| 欧美日韩国产免费一区二区| 日韩中文字幕麻豆| 久久网站热最新地址| 成人精品视频.| 综合网在线视频| 欧美日韩精品免费| 国产精品1区二区.| 亚洲免费视频成人| 欧美一区二区三区影视| 日本成人在线不卡视频| 国产午夜亚洲精品午夜鲁丝片| aaa欧美日韩| 青青草97国产精品免费观看无弹窗版 | 久久精品国产成人一区二区三区| 日韩欧美国产一二三区| 成人精品在线视频观看| 天天色天天操综合| 久久久久久久久伊人| 91福利在线导航| 免费成人美女在线观看.| 中文字幕av一区二区三区免费看 | 樱桃国产成人精品视频| 欧美一区二区成人6969| 成人精品亚洲人成在线| 日韩精品欧美精品| 国产精品成人午夜| 欧美成人免费网站| 日本韩国精品在线| 国产成人久久精品77777最新版本| 亚洲精品成人天堂一二三| 欧美精品一区二区不卡 | 成人av在线影院| 日本欧美一区二区| 亚洲日本免费电影| 久久精品视频一区二区| 欧美精品在线观看播放| 99久久精品免费观看| 国产一区二区三区在线观看免费| 亚洲女性喷水在线观看一区| 亚洲精品在线电影| 欧美精品色综合| 91久色porny | 亚洲一卡二卡三卡四卡五卡| 久久综合网色—综合色88| 欧美男男青年gay1069videost| 99精品视频在线播放观看| 国产一区三区三区| 免费在线观看视频一区| 亚洲一区二区欧美| 一区二区三区四区视频精品免费| 精品粉嫩超白一线天av| 日韩欧美一二区| 欧美美女视频在线观看| 在线观看网站黄不卡| 99免费精品在线观看| 国产馆精品极品| 国产一区在线观看视频| 国产一区二区在线视频| 精品在线播放午夜| 国产91精品一区二区麻豆网站 | 美腿丝袜亚洲三区| 亚洲线精品一区二区三区八戒| 亚洲激情图片qvod| 一区二区三区精品在线| 亚洲视频在线一区| 亚洲精品免费在线观看| 亚洲激情五月婷婷| 亚洲午夜羞羞片| 五月天一区二区三区| 亚洲二区在线视频| 日本va欧美va精品发布| 美国三级日本三级久久99 | 久久伊人中文字幕| 久久综合色婷婷| 国产日韩欧美a| 中文av一区二区| 中文字幕一区二区三区在线观看| 亚洲天天做日日做天天谢日日欢 | 欧美精品日韩一本| 欧美二区在线观看| 欧美成人一区二区三区| 久久综合久久综合九色| 国产精品乱码久久久久久| 亚洲女同女同女同女同女同69| 亚洲美女屁股眼交3| 午夜激情久久久| 精品一区二区三区免费观看| 国产乱码精品一品二品| av成人免费在线观看| 欧美美女视频在线观看| 久久综合丝袜日本网| 亚洲日穴在线视频| 日韩av在线发布| 成人免费高清视频在线观看| 色综合久久六月婷婷中文字幕| 欧美日韩在线精品一区二区三区激情 | 国产精品二三区| 亚洲v精品v日韩v欧美v专区| 国内外成人在线| 91小视频在线| 日韩欧美国产精品一区| 中文字幕一区二区三区在线播放 | 欧美精品一区二区久久婷婷| 中文字幕日韩av资源站| 图片区小说区国产精品视频| 激情综合色播激情啊| 成人动漫视频在线| 91精品黄色片免费大全| 国产精品久久久久久久久果冻传媒 | 777久久久精品| 中文字幕一区在线| 狠狠色狠狠色综合| 欧美日韩一区二区在线观看视频| 久久人人超碰精品| 午夜欧美视频在线观看| jlzzjlzz亚洲日本少妇| 日韩精品一区二区在线观看| 亚洲欧美另类图片小说| 国产一区二区三区四| 欧美色图第一页| 国产女主播视频一区二区| 日韩精品视频网| 欧美在线观看视频在线| 国产精品免费久久久久| 国产一区欧美日韩| 欧美一级二级三级蜜桃| 一区二区在线免费| 成人av综合一区| 亚洲精品一区二区精华| 日韩中文字幕亚洲一区二区va在线| 91美女精品福利| 国产精品情趣视频| 国产在线国偷精品免费看| 日韩午夜在线观看视频| 亚洲国产综合色| 一本大道av伊人久久综合| 中文字幕中文乱码欧美一区二区 | 日本一区二区动态图| 精品一区二区久久| 日韩一区二区三区四区| 天天综合网天天综合色| 欧美日韩在线综合| 亚洲va国产va欧美va观看| 91亚洲精品乱码久久久久久蜜桃| 欧美国产成人在线| 高潮精品一区videoshd| 国产日本欧美一区二区| 福利一区福利二区| 国产精品美女一区二区在线观看| 国产成人一区在线| 亚洲国产精品精华液ab| 粉嫩欧美一区二区三区高清影视 | 久久综合色婷婷| 国产精品自拍网站| 国产日产亚洲精品系列|