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

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

?? os_time.c

?? ARM7Proteus.rar
?? 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    


    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    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区久久| 久久69国产一区二区蜜臀| 日韩美女视频一区| 亚洲精品一区二区三区四区高清| 3atv一区二区三区| 欧美中文字幕一区二区三区 | 在线播放一区二区三区| 日本韩国欧美国产| 欧洲色大大久久| 欧美日韩精品高清| 欧美成人激情免费网| 欧美一区二区精品在线| 欧美成人国产一区二区| 久久精品视频在线看| 国产精品久久久一本精品| 国产精品白丝在线| 午夜视频一区二区| 韩国女主播一区二区三区| 高清在线不卡av| 91首页免费视频| 精品1区2区3区| www国产成人| 亚洲视频每日更新| 美女一区二区在线观看| 国产一区二区三区免费看| 成人成人成人在线视频| 欧美日韩精品电影| 国产日韩欧美精品电影三级在线| 中文字幕一区二区三区在线不卡 | 欧美成人性福生活免费看| 国产日产亚洲精品系列| 亚洲综合视频在线观看| 久久91精品久久久久久秒播| av网站免费线看精品| 欧美夫妻性生活| 国产精品美女久久福利网站| 性感美女久久精品| 成人午夜短视频| 91精品国产综合久久久蜜臀图片 | 天天色综合天天| 国产成人亚洲精品青草天美| 日本大香伊一区二区三区| 精品久久99ma| 亚洲国产色一区| 成人高清伦理免费影院在线观看| 欧美日韩国产高清一区二区| 欧美激情一区二区三区全黄 | 久久久久久影视| 五月激情综合婷婷| 97精品久久久午夜一区二区三区 | 91高清视频在线| 久久久久久久久免费| 午夜免费欧美电影| 99久久99久久精品免费观看| 欧美精品一区二区三区蜜桃视频 | 日韩亚洲欧美在线观看| 一区二区三区四区在线| 风间由美一区二区三区在线观看| 7777精品伊人久久久大香线蕉的 | 日韩欧美电影一二三| 一区二区三区中文在线| zzijzzij亚洲日本少妇熟睡| 久久精品综合网| 精品一区在线看| 日韩三级中文字幕| 日韩高清在线电影| 6080国产精品一区二区| 亚洲午夜av在线| 欧美中文字幕久久| 亚洲高清免费视频| 欧美中文字幕一区二区三区亚洲| 国产精品第一页第二页第三页| 国产精品综合二区| 日本一区二区三区dvd视频在线| 狠狠色综合日日| 日韩一区二区在线播放| 免费观看久久久4p| 欧美不卡123| 国产一区二区三区四区五区入口| 日韩欧美中文字幕一区| 蜜乳av一区二区| 欧美精品一区二区三区视频| 狠狠色综合日日| 国产精品午夜久久| 91色.com| 五月天亚洲婷婷| 精品免费日韩av| 成人动漫在线一区| 一区二区三区四区激情| 欧美美女视频在线观看| 美女网站在线免费欧美精品| 2021国产精品久久精品| 粉嫩aⅴ一区二区三区四区五区| 国产农村妇女精品| 日本国产一区二区| 奇米色一区二区| 日本一区二区电影| 在线免费观看日本欧美| 天堂影院一区二区| 国产偷国产偷亚洲高清人白洁 | 青草av.久久免费一区| 精品国产乱码久久| 一本色道久久综合精品竹菊| 五月天丁香久久| 国产亚洲制服色| 欧美羞羞免费网站| 国产一区二区影院| 一级女性全黄久久生活片免费| 欧美一级片在线| 国产·精品毛片| 日日夜夜精品免费视频| 日本一区二区视频在线观看| 在线观看一区日韩| 国产在线播放一区三区四| 亚洲欧美一区二区三区国产精品| 91精品国产综合久久精品麻豆| 国内不卡的二区三区中文字幕| 夜夜精品浪潮av一区二区三区| 精品剧情在线观看| 欧美伊人精品成人久久综合97| 久久99精品久久只有精品| 亚洲综合无码一区二区| 欧美国产综合色视频| 日韩一区二区在线播放| 色屁屁一区二区| 国产精品888| 欧美aaa在线| 亚洲成人tv网| 亚洲欧美日韩综合aⅴ视频| 欧美精品一区二区三区久久久| 欧美日韩在线三级| 99精品久久久久久| 成人午夜在线播放| 国产久卡久卡久卡久卡视频精品| 天天色天天操综合| 亚洲国产欧美一区二区三区丁香婷| 久久在线免费观看| 欧美成人乱码一区二区三区| 欧美三区在线观看| 在线影院国内精品| 97久久人人超碰| www.欧美日韩| av中文字幕亚洲| caoporm超碰国产精品| 国产成人aaa| 国产大陆精品国产| 激情五月婷婷综合| 国产在线国偷精品免费看| 久久精品国产网站| 久久精品国产99久久6| 日韩av中文字幕一区二区三区| 午夜精品国产更新| 一区二区三区精密机械公司| 亚洲免费毛片网站| 亚洲精品国产无套在线观| 亚洲精品视频自拍| 亚洲永久精品大片| 亚洲国产人成综合网站| 午夜一区二区三区视频| 偷拍自拍另类欧美| 婷婷久久综合九色综合绿巨人| 亚洲成人你懂的| 日韩精品一级二级| 久久精品国产亚洲a| 国产精品一区在线观看乱码| 国产成人自拍在线| 91性感美女视频| 欧美午夜精品久久久久久孕妇| 在线观看日韩电影| 日韩视频中午一区| 亚洲国产精品成人综合| 亚洲乱码国产乱码精品精98午夜| 一区二区三区不卡视频在线观看| 午夜伦欧美伦电影理论片| 美腿丝袜亚洲综合| 成人h动漫精品一区二区| 91免费看`日韩一区二区| 欧美浪妇xxxx高跟鞋交| 精品av久久707| 亚洲欧洲中文日韩久久av乱码| 午夜在线成人av| 久久99精品久久久久久国产越南| 国产99久久久国产精品免费看| 91麻豆swag| 欧美一区二区国产| 成人欧美一区二区三区白人 | 久久亚洲免费视频| 亚洲乱码日产精品bd| 首页国产欧美久久| 春色校园综合激情亚洲| 欧美美女一区二区在线观看| 久久久国产午夜精品| 午夜成人在线视频| 成人黄色综合网站| 91精品国产一区二区三区蜜臀| 国产精品久久看| 久久国产福利国产秒拍| 在线免费一区三区| 中文字幕高清不卡| 美女网站一区二区|