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

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

?? os_time.c

?? st arm7中的71x中部分功能源代碼
?? 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久精品视频免费观看| 欧美在线观看禁18| 欧美国产激情二区三区| 捆绑调教美女网站视频一区| 日本精品裸体写真集在线观看| 日韩欧美视频在线| 亚洲va国产va欧美va观看| 大陆成人av片| 久久久综合九色合综国产精品| 亚洲国产日韩a在线播放| 99热99精品| 欧美国产欧美综合| 精品写真视频在线观看| 欧美一区二区三区视频在线观看 | 国产欧美一区二区三区网站| 日韩av成人高清| 欧美人动与zoxxxx乱| 亚洲一区二区四区蜜桃| 91麻豆免费观看| 亚洲人成小说网站色在线| 粉嫩aⅴ一区二区三区四区| 久久精品网站免费观看| 韩日欧美一区二区三区| 久久蜜桃一区二区| 蜜臀av亚洲一区中文字幕| 欧美一级久久久| 国内久久精品视频| 久久伊人蜜桃av一区二区| 激情伊人五月天久久综合| 日韩女优电影在线观看| 国内国产精品久久| 欧美国产日产图区| 97久久人人超碰| 一区二区三区精品| 欧美久久久一区| 久久成人免费网| 中文字幕不卡的av| 日本韩国精品在线| 午夜激情久久久| 欧美精品一区二区三区很污很色的| 久草精品在线观看| 国产精品毛片久久久久久久| 91一区二区在线| 日韩电影免费一区| 久久精品人人做人人综合| 播五月开心婷婷综合| 夜夜嗨av一区二区三区四季av| 欧美丰满嫩嫩电影| 国产精品123区| 亚洲一卡二卡三卡四卡无卡久久| 欧美日本在线播放| 国产高清亚洲一区| 一区二区三区成人| 欧美电视剧免费全集观看| 成人av在线资源网站| 亚洲一区二区视频在线观看| 亚洲精品在线三区| 91福利资源站| 国产成人免费9x9x人网站视频| 亚洲激情六月丁香| 精品久久久久久久久久久院品网| www.日韩大片| 另类小说综合欧美亚洲| 日韩理论片网站| 精品999在线播放| 欧美丝袜第三区| 粉嫩久久99精品久久久久久夜 | 国产资源在线一区| 一区二区三区毛片| 欧美国产日本视频| 欧美不卡一区二区三区四区| 91色.com| 国产精品综合在线视频| 污片在线观看一区二区| 亚洲视频图片小说| 国产网站一区二区| 欧美日韩精品欧美日韩精品 | 激情国产一区二区 | 国产日韩欧美精品综合| 欧美日韩一区中文字幕| 成人美女视频在线看| 激情成人综合网| 日本大胆欧美人术艺术动态| 综合网在线视频| 日本一区二区三区电影| 日韩你懂的在线播放| 欧美电影一区二区| 在线观看日韩精品| 成人18精品视频| 国产成人精品1024| 另类小说欧美激情| 免费的国产精品| 日日夜夜精品视频天天综合网| 亚洲免费观看高清完整版在线| 国产精品欧美极品| 中文字幕av一区二区三区高| 欧美v日韩v国产v| 欧美成人精品3d动漫h| 欧美一区三区四区| 91精品国产91久久久久久最新毛片| 欧美性xxxxx极品少妇| 在线一区二区观看| 欧美在线观看视频一区二区三区| 日本乱码高清不卡字幕| 91丝袜呻吟高潮美腿白嫩在线观看| 国产成人精品一区二区三区四区 | 美女mm1313爽爽久久久蜜臀| 亚洲小说欧美激情另类| 亚洲午夜视频在线观看| 一区二区三区精品视频| 亚洲丶国产丶欧美一区二区三区| 亚洲精品伦理在线| 亚洲一级二级三级| 亚洲成在线观看| 免费看精品久久片| 激情欧美日韩一区二区| 粉嫩av一区二区三区| 成人av免费观看| 日本道色综合久久| 欧美日韩国产精品自在自线| 3751色影院一区二区三区| 欧美日韩成人综合天天影院| 欧美日韩国产小视频在线观看| 91麻豆精品国产自产在线 | 欧美成人aa大片| 国产日韩欧美精品一区| 亚洲免费视频成人| 青青青伊人色综合久久| 激情五月婷婷综合网| 成人性色生活片| 欧美在线观看视频一区二区三区| 91精品福利在线一区二区三区| 亚洲精品一区二区三区福利 | 欧美经典三级视频一区二区三区| 中文字幕国产精品一区二区| 亚洲精品国产视频| 老色鬼精品视频在线观看播放| 国产高清精品久久久久| 欧美午夜在线一二页| 欧美电影免费观看完整版| 日韩理论片网站| 经典一区二区三区| 色伊人久久综合中文字幕| 日韩精品一区二区三区四区视频| 国产精品美女www爽爽爽| 日韩精品一二三四| 91麻豆免费看片| 久久久久久久久97黄色工厂| 亚洲女性喷水在线观看一区| 久久精品国产99国产精品| 91麻豆免费观看| 久久久久久久综合日本| 日韩国产在线观看| 成人美女视频在线观看18| 日韩西西人体444www| 综合电影一区二区三区| 精品一区二区影视| 欧美精品在线一区二区| 中文字幕在线一区| 久久精品国产999大香线蕉| 在线看日韩精品电影| 国产亚洲视频系列| 日本视频一区二区| 欧美丝袜丝交足nylons图片| 国产精品国产三级国产aⅴ原创 | 亚洲大片精品永久免费| 成人av小说网| 国产亚洲欧美中文| 捆绑紧缚一区二区三区视频| 欧美日韩国产中文| 一区二区三区不卡视频| 99精品国产视频| 国产日产亚洲精品系列| 久久97超碰国产精品超碰| 欧美日韩一区在线观看| 亚洲九九爱视频| av一二三不卡影片| 中文子幕无线码一区tr| 国产综合成人久久大片91| 日韩免费一区二区| 久久国产人妖系列| 日韩欧美一级二级三级久久久| 亚洲成人精品影院| 欧美三级在线视频| 亚洲国产精品嫩草影院| 欧美伊人精品成人久久综合97 | 亚洲精品一卡二卡| 99re这里只有精品视频首页| 国产精品久久久久婷婷| 成+人+亚洲+综合天堂| 国产精品国产a级| 色综合夜色一区| 日韩综合一区二区|