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

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

?? os_time.c

?? 基于STR711的PRCCU程序
?? 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一区二区三区免费野_久草精品视频
欧美丝袜丝交足nylons| 欧美视频在线一区| 蜜臀a∨国产成人精品| 国产喂奶挤奶一区二区三区| 56国语精品自产拍在线观看| 91 com成人网| 精品国产成人在线影院| 精品国产乱码久久久久久牛牛| 欧美日本精品一区二区三区| 日韩一区二区三区四区五区六区| 日韩欧美中文字幕制服| 亚洲精品一区二区在线观看| 国产精品色一区二区三区| 自拍偷拍国产亚洲| 亚洲v日本v欧美v久久精品| 奇米综合一区二区三区精品视频| 久草热8精品视频在线观看| 国产综合久久久久影院| 国产高清视频一区| 91精彩视频在线观看| 制服丝袜成人动漫| 国产片一区二区| 亚洲精品高清视频在线观看| 三级成人在线视频| 成人午夜短视频| 精品视频在线看| 久久久久青草大香线综合精品| 中文字幕中文字幕一区二区| 五月天婷婷综合| 国产成人在线影院| 欧美日韩国产首页| 国产蜜臀97一区二区三区| 亚洲品质自拍视频| 国产精品一区久久久久| 欧美伊人久久大香线蕉综合69| 日韩视频中午一区| 亚洲欧美电影院| 国产一区二区主播在线| 欧美午夜精品电影| 国产精品乱人伦一区二区| 日韩黄色免费网站| 91在线视频网址| 精品av久久707| 亚洲最大成人综合| 懂色中文一区二区在线播放| 欧美肥胖老妇做爰| 自拍偷拍国产精品| 国产精品一区专区| 日韩区在线观看| 亚洲图片欧美视频| 91性感美女视频| 国产日韩欧美一区二区三区乱码| 亚洲一区二区黄色| 97久久精品人人做人人爽50路| 精品电影一区二区三区| 日韩精品91亚洲二区在线观看| 91免费在线看| 国产精品女主播av| 老司机精品视频一区二区三区| 欧美系列在线观看| 亚洲男人的天堂在线aⅴ视频| 国产91精品免费| 国产欧美日韩在线看| 久久99精品网久久| 精品国产123| 激情五月婷婷综合| 2024国产精品| 国产一区二三区好的| 26uuu欧美| 国产一区美女在线| 26uuu另类欧美亚洲曰本| 紧缚奴在线一区二区三区| 日韩午夜在线观看视频| 日本女优在线视频一区二区| 欧美一区二区三区在线观看| 天天综合日日夜夜精品| 欧美精品丝袜中出| 亚洲高清不卡在线观看| 欧美一区二区在线观看| 久久精品99国产精品日本| 精品国产乱码久久久久久影片| 久久黄色级2电影| 欧美国产精品专区| 色综合久久99| 亚洲国产精品一区二区久久恐怖片| 91麻豆国产自产在线观看| 高清久久久久久| 欧美日韩亚洲国产综合| 最近日韩中文字幕| 91色视频在线| 亚洲一区二区三区四区五区黄| 欧美午夜精品一区二区蜜桃 | 麻豆精品国产91久久久久久| 日韩美女天天操| 国产福利一区二区三区视频在线| 中文字幕欧美激情| 欧美日韩在线三级| 另类中文字幕网| 中文字幕日韩av资源站| 日本韩国欧美三级| 毛片基地黄久久久久久天堂| 国产欧美精品国产国产专区| 91蝌蚪porny| 丝袜亚洲另类欧美| 国产欧美综合在线观看第十页 | 亚洲精品视频在线观看免费 | 国产精品一区三区| 亚洲精品国产成人久久av盗摄| 欧美人体做爰大胆视频| 国产一区二区伦理片| 亚洲一区二区三区小说| 日韩欧美国产小视频| 成人高清视频在线| 免费成人美女在线观看| 一区在线观看免费| 精品国产欧美一区二区| 欧洲精品一区二区三区在线观看| 美国毛片一区二区三区| 亚洲制服丝袜在线| 国产精品全国免费观看高清 | 亚洲第一搞黄网站| 日本一区二区三区在线观看| 欧美精品tushy高清| 91视频观看视频| 国产91精品久久久久久久网曝门 | 亚洲资源在线观看| 国产精品久久久久久久浪潮网站| 日韩网站在线看片你懂的| 91国内精品野花午夜精品| 成人亚洲精品久久久久软件| 久久成人免费日本黄色| 亚洲图片欧美色图| 亚洲精品乱码久久久久久日本蜜臀| 欧美大肚乱孕交hd孕妇| 欧美猛男超大videosgay| 成人av网站免费观看| 国产一区二区影院| 韩国成人精品a∨在线观看| 视频在线观看一区| 亚洲电影你懂得| 亚洲乱码国产乱码精品精可以看| 久久亚洲二区三区| 欧美成人aa大片| 欧美一级专区免费大片| 欧美一区二区三区在线视频| 欧美人妇做爰xxxⅹ性高电影| 欧美色男人天堂| 欧美精品色综合| 欧美日韩精品福利| 欧美蜜桃一区二区三区| 欧美剧情电影在线观看完整版免费励志电影 | 欧美电影在线免费观看| 欧美伊人久久大香线蕉综合69 | 日韩三区在线观看| 欧美喷潮久久久xxxxx| 欧美日韩精品系列| 5月丁香婷婷综合| 日韩欧美色综合网站| 日韩精品专区在线| 久久综合九色综合97_久久久| 久久久国产午夜精品| 国产欧美精品一区aⅴ影院| 国产精品毛片久久久久久久| 1024成人网色www| 亚洲午夜久久久久久久久电影院 | 久久66热re国产| 国产精品影视网| 不卡的电视剧免费网站有什么| 91丝袜美女网| 欧美日韩高清一区二区| 欧美一区二区三区视频| 久久综合九色综合欧美98| 欧美激情一区在线| 一区二区三区免费| 日韩国产欧美视频| 国产成a人亚洲| 91久久精品国产91性色tv| 777奇米四色成人影色区| 久久综合色婷婷| 亚洲欧美偷拍卡通变态| 人人精品人人爱| 成人午夜av在线| 欧美日韩国产高清一区| 亚洲精品一区二区三区99| 成人欧美一区二区三区小说| 免费欧美在线视频| 99久久伊人网影院| 日韩一区二区三区av| 成人免费在线观看入口| 日韩**一区毛片| 一本大道av一区二区在线播放| 日韩一区二区三| 夜夜揉揉日日人人青青一国产精品 | 色偷偷久久人人79超碰人人澡| 777奇米成人网| 亚洲色图.com| 国产精品亚洲第一| 51午夜精品国产| 亚洲精品老司机| 国产成人免费视频|