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

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

?? os_time.c

?? UCOS 在ARM9_S3c2410上的移植
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2001, 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) == 0x00) {  /* 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一区二区三区免费野_久草精品视频
一区二区三区小说| 国产欧美精品国产国产专区| 成人av在线资源网| 国产激情91久久精品导航| 国产伦精品一区二区三区免费迷| 麻豆91精品视频| 精品一区二区三区在线播放 | 无码av免费一区二区三区试看| 亚洲精品国久久99热| 亚洲一区二区精品视频| 首页欧美精品中文字幕| 久久99精品国产.久久久久久| 国产一区在线看| 国产ts人妖一区二区| 91一区一区三区| 精品视频在线免费| 777欧美精品| 国产丝袜欧美中文另类| 亚洲色图欧美激情| 免费一级欧美片在线观看| 激情文学综合丁香| 99精品黄色片免费大全| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 亚洲人成亚洲人成在线观看图片| 一区二区三区欧美久久| 免费成人在线观看视频| 99久久99精品久久久久久| 欧美日韩黄视频| 久久久不卡网国产精品二区| 亚洲欧美日韩一区二区三区在线观看| 亚洲va国产va欧美va观看| 国产一区二区三区不卡在线观看| 91蜜桃网址入口| 在线成人免费观看| 国产精品欧美极品| 五月婷婷另类国产| 国产成人亚洲综合a∨婷婷| 欧美探花视频资源| 国产精品麻豆欧美日韩ww| 日日夜夜一区二区| 99在线精品视频| 精品国产在天天线2019| 亚洲国产va精品久久久不卡综合| 高清国产一区二区| 欧美一级搡bbbb搡bbbb| 亚洲精品大片www| 国产精品综合二区| 欧美一区二区视频在线观看2022 | 欧美视频三区在线播放| 日本一区二区久久| 黄色日韩网站视频| 91精品国产色综合久久不卡电影 | 播五月开心婷婷综合| 日韩网站在线看片你懂的| 一区二区三区不卡视频在线观看| 国产福利精品导航| 日韩精品一区二区三区中文精品| 亚洲乱码中文字幕综合| 成人精品电影在线观看| 久久精品视频在线免费观看| 免费成人你懂的| 欧美一区二区三区视频在线观看| 一区二区三区四区蜜桃| 99re热这里只有精品视频| 国产欧美精品一区二区三区四区| 国产一区二区三区在线观看免费| 欧美一卡2卡3卡4卡| 日韩精品一级中文字幕精品视频免费观看| 91视视频在线观看入口直接观看www| 久久精品欧美一区二区三区不卡| 国产在线精品一区二区夜色 | 91精品国产综合久久久久久| 亚洲电影你懂得| 在线观看一区日韩| 一区二区三区欧美久久| 在线观看网站黄不卡| 亚洲精品成人a在线观看| 日本国产一区二区| 亚洲国产日韩a在线播放| 欧美吻胸吃奶大尺度电影| 亚洲成人7777| 日韩欧美国产一区在线观看| 经典三级在线一区| 国产欧美一二三区| a级精品国产片在线观看| 亚洲毛片av在线| 欧美理论片在线| 久久精品国产一区二区三| 久久久欧美精品sm网站| 成人三级伦理片| 亚洲精品欧美激情| 欧美一区二区三区在| 久久精品国产999大香线蕉| 久久久久久久网| 91日韩精品一区| 天堂资源在线中文精品| 欧美videos大乳护士334| 国产一区二区三区久久久| 综合久久国产九一剧情麻豆| 欧美美女激情18p| 久草精品在线观看| 亚洲激情五月婷婷| 日韩精品在线网站| 91欧美一区二区| 麻豆传媒一区二区三区| 一区二区中文视频| 91麻豆精品国产无毒不卡在线观看| 精品综合免费视频观看| 亚洲私人黄色宅男| 日韩精品在线一区二区| 日本乱码高清不卡字幕| 国产中文一区二区三区| 亚洲已满18点击进入久久| 久久久亚洲欧洲日产国码αv| 91天堂素人约啪| 国产美女主播视频一区| 亚洲图片自拍偷拍| 久久久久久99精品| 欧美日韩中文精品| 成人动漫中文字幕| 麻豆精品在线视频| 亚洲国产成人av网| 亚洲视频在线一区| 日本一区二区电影| 精品欧美久久久| 欧美伦理视频网站| 91激情五月电影| 本田岬高潮一区二区三区| 久久精品噜噜噜成人88aⅴ| 亚洲综合av网| 亚洲欧洲av色图| 国产日韩成人精品| 欧美精品一区二区三区很污很色的| 欧美视频中文一区二区三区在线观看| 成人一区二区三区视频在线观看| 蜜臀av一级做a爰片久久| 亚洲国产成人tv| 亚洲影视在线观看| 亚洲免费三区一区二区| 中文字幕一区二区三区精华液| 久久综合九色综合欧美亚洲| 欧美一级精品在线| 91精品国产综合久久久蜜臀粉嫩| 欧美三级乱人伦电影| 欧美专区日韩专区| 欧美天天综合网| 精品视频在线免费观看| 欧美日韩精品久久久| 欧美色综合影院| 欧美精品色综合| 6080午夜不卡| 精品乱码亚洲一区二区不卡| 日韩精品一区二区三区视频在线观看 | 欧美videos中文字幕| 日韩精品最新网址| 亚洲精品一区二区三区蜜桃下载| 精品国产91乱码一区二区三区| 日韩你懂的在线观看| 日韩精品中文字幕在线不卡尤物| 精品国产成人系列| 中文字幕乱码久久午夜不卡 | 91麻豆精品一区二区三区| 91老师国产黑色丝袜在线| 91国偷自产一区二区三区成为亚洲经典 | 99精品一区二区| 在线免费精品视频| 欧美一区二区视频在线观看| 日韩区在线观看| 久久久久国产精品麻豆ai换脸| 国产精品国产三级国产| 亚洲综合色丁香婷婷六月图片| 日本不卡高清视频| 高清成人免费视频| 91色porny蝌蚪| 日韩午夜激情视频| 亚洲国产精品国自产拍av| 亚洲综合色区另类av| 精品一区二区在线视频| 91一区二区在线| 在线电影欧美成精品| 亚洲国产精品成人综合色在线婷婷| 亚洲乱码一区二区三区在线观看| 日本欧美一区二区| 成人综合在线视频| 欧美男人的天堂一二区| 久久精品无码一区二区三区| 亚洲综合免费观看高清在线观看| 看片的网站亚洲| 一本到一区二区三区| 精品国产三级电影在线观看| 一区二区在线观看视频在线观看| 喷水一区二区三区| 91精品福利在线| 国产亚洲欧洲997久久综合| 亚洲亚洲人成综合网络| 国产精品66部| 日韩一区二区中文字幕| 一区二区三区欧美| 成人午夜电影网站| 欧美一级高清片在线观看|