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

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

?? os_time.c

?? ucos-ii在msp430f149上的移植
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                              (c) Copyright 1992-2008, Micrium, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.87
*
* LICENSING TERMS:
* ---------------
*   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.  
* If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license 
* its use in your product. We provide ALL the source code for your convenience and to help you experience 
* uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a 
* licensing fee.
*********************************************************************************************************
*/

#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 = 0;
#endif



    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        return;
    }
    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_ERR_NONE
*              OS_ERR_TIME_INVALID_MINUTES
*              OS_ERR_TIME_INVALID_SECONDS
*              OS_ERR_TIME_INVALID_MS
*              OS_ERR_TIME_ZERO_DLY
*              OS_ERR_TIME_DLY_ISR
*
* 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 ms)
{
    INT32U ticks;
    INT16U loops;


    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        return (OS_ERR_TIME_DLY_ISR);
    }
#if OS_ARG_CHK_EN > 0OSTimeDly
    if (hours == 0) {
        if (minutes == 0) {
            if (seconds == 0) {
                if (ms == 0) {
                    return (OS_ERR_TIME_ZERO_DLY);
                }
            }
        }
    }
    if (minutes > 59) {
        return (OS_ERR_TIME_INVALID_MINUTES);    /* Validate arguments to be within range              */
    }
    if (seconds > 59) {
        return (OS_ERR_TIME_INVALID_SECONDS);
    }
    if (ms > 999) {
        return (OS_ERR_TIME_INVALID_MS);
    }
#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)ms + 500L / OS_TICKS_PER_SEC) / 1000L;
    loops = (INT16U)(ticks >> 16);               /* Compute the integral number of 65536 tick delays   */
    ticks = ticks & 0xFFFFL;                     /* Obtain  the fractional number of ticks             */
    OSTimeDly((INT16U)ticks);
    while (loops > 0) {
        OSTimeDly((INT16U)32768u);
        OSTimeDly((INT16U)32768u);
        loops--;
    }
    return (OS_ERR_NONE);
}
#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_ERR_NONE               Task has been resumed
*              OS_ERR_PRIO_INVALID       if the priority you specify is higher that the maximum allowed
*                                        (i.e. >= OS_LOWEST_PRIO)
*              OS_ERR_TIME_NOT_DLY       Task is not waiting for time to expire
*              OS_ERR_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 = 0;
#endif



    if (prio >= OS_LOWEST_PRIO) {
        return (OS_ERR_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = OSTCBPrioTbl[prio];                                 /* Make sure that task exist            */
    if (ptcb == (OS_TCB *)0) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                        /* The task does not exist              */
    }
    if (ptcb == OS_TCB_RESERVED) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                        /* The task does not exist              */
    }
    if (ptcb->OSTCBDly == 0) {                                 /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_ERR_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->OSTCBStatPend  =  OS_STAT_PEND_TO;               /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBStatPend  =  OS_STAT_PEND_OK;
    }
    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_ERR_NONE);
}
#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 = 0;
#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 = 0;
#endif



    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色大成网站www久久九九| 婷婷久久综合九色综合伊人色| 欧美在线不卡一区| 国精产品一区一区三区mba视频 | 午夜电影一区二区| 国产精品私人影院| 精品免费国产一区二区三区四区| 色妞www精品视频| 国产乱码精品一区二区三区忘忧草| 亚洲国产一区二区a毛片| 国产女同性恋一区二区| 日韩欧美国产综合在线一区二区三区| 91在线丨porny丨国产| 国产精品一区二区久久不卡| 青青草97国产精品免费观看无弹窗版| 一区二区三区蜜桃| 国产精品国产a| 久久精品欧美日韩| 精品国精品国产| 欧美年轻男男videosbes| 色婷婷综合久久久中文字幕| 国产99久久久久| 国产主播一区二区三区| 日韩和欧美一区二区三区| 一区二区三区在线影院| 亚洲色图清纯唯美| 国产精品国产三级国产aⅴ入口 | 欧美人体做爰大胆视频| 91视频国产观看| 99久久免费国产| 成人午夜电影网站| 国产精品一卡二卡在线观看| 久久精品理论片| 久久国产尿小便嘘嘘| 视频一区在线播放| 日韩中文字幕区一区有砖一区| 一区二区三区在线高清| 亚洲三级久久久| 亚洲品质自拍视频| 亚洲免费观看高清完整版在线 | 国产欧美日韩在线| 国产日韩欧美综合一区| 久久久777精品电影网影网| 日韩欧美一级特黄在线播放| 欧美夫妻性生活| 欧美一区二区在线视频| 欧美一区二区视频在线观看2020| 欧美久久久久久久久中文字幕| 欧美人体做爰大胆视频| 91麻豆精品国产91久久久更新时间 | 中文字幕日本不卡| 中文字幕在线不卡视频| 《视频一区视频二区| 亚洲伦在线观看| 亚洲第一会所有码转帖| 五月综合激情婷婷六月色窝| 日本午夜精品一区二区三区电影| 日本美女一区二区三区| 狠狠色丁香久久婷婷综合丁香| 国产一区二区三区最好精华液| 国产一本一道久久香蕉| 大陆成人av片| 91久久奴性调教| 91精品国产福利| www国产成人| 国产精品不卡一区二区三区| 一区二区三区四区在线| 五月婷婷欧美视频| 国产呦萝稀缺另类资源| 成人h精品动漫一区二区三区| 色综合天天综合狠狠| 欧美日韩精品一区二区在线播放| 在线不卡的av| 国产午夜精品久久久久久免费视 | 国产精品三级av| 亚洲一级二级在线| 极品美女销魂一区二区三区 | 日韩午夜av一区| 国产欧美日韩另类视频免费观看| 亚洲情趣在线观看| 久久爱另类一区二区小说| av亚洲精华国产精华| 在线电影欧美成精品| 国产精品网站在线观看| 亚洲高清在线视频| 国产高清精品网站| 欧美美女激情18p| 中文字幕av资源一区| 日韩精品亚洲一区| aa级大片欧美| 欧美电影免费观看高清完整版在线| 国产精品电影一区二区| 精品无人码麻豆乱码1区2区 | 久久久亚洲综合| 亚洲夂夂婷婷色拍ww47 | 欧美猛男超大videosgay| 国产日产欧美一区二区三区| 亚洲成人tv网| 波多野结衣在线一区| 日韩一级片网站| 亚洲国产成人av好男人在线观看| 国内精品伊人久久久久av一坑| 在线免费观看不卡av| 久久综合狠狠综合| 无码av中文一区二区三区桃花岛| 成人中文字幕在线| 26uuu精品一区二区在线观看| 亚洲高清免费视频| 日本高清不卡在线观看| 国产午夜精品福利| 国产呦萝稀缺另类资源| 91精品国模一区二区三区| 亚洲另类在线制服丝袜| 成人黄色av网站在线| 亚洲精品在线网站| 免费观看日韩av| 91麻豆精品国产无毒不卡在线观看| 亚洲综合激情另类小说区| 成人激情免费电影网址| 久久久av毛片精品| 激情六月婷婷久久| 精品国产第一区二区三区观看体验| 五月天一区二区三区| 欧美亚洲丝袜传媒另类| 亚洲欧美国产77777| 92精品国产成人观看免费| 国产美女娇喘av呻吟久久| 欧美一级淫片007| 午夜精品久久久久久久99樱桃| 欧美性大战久久久久久久 | 欧美激情一区二区三区在线| 韩国三级在线一区| 久久综合色婷婷| 国产一区二区三区久久久| 精品女同一区二区| 精品一区二区在线播放| 欧美一卡2卡三卡4卡5免费| 婷婷成人激情在线网| 欧美精品欧美精品系列| 亚洲高清免费在线| 欧美一区二区大片| 精品一区二区三区影院在线午夜| 精品国产凹凸成av人网站| 极品少妇xxxx偷拍精品少妇| 久久婷婷国产综合精品青草| 激情综合五月天| 日本一区二区三区视频视频| 波多野结衣欧美| 亚洲欧美精品午睡沙发| 欧美视频在线观看一区| 午夜视黄欧洲亚洲| 欧美成人午夜电影| 国产尤物一区二区| 国产精品成人网| 欧美日韩在线直播| 麻豆成人免费电影| 国产欧美日产一区| 91色.com| 日韩影院免费视频| 亚洲精品在线三区| 成人涩涩免费视频| 亚洲一区欧美一区| 欧美一区二区三区影视| 国产很黄免费观看久久| 亚洲天堂2014| 欧美挠脚心视频网站| 国产精品中文字幕日韩精品 | 欧美日韩中文字幕一区二区| 奇米精品一区二区三区四区| 久久精品视频免费| 色综合久久天天| 男女男精品视频网| 国产人成一区二区三区影院| 91女神在线视频| 日韩av网站免费在线| 国产三级欧美三级| 欧美午夜精品久久久| 国内精品自线一区二区三区视频| 中文字幕一区二区不卡| 91精品国产品国语在线不卡| 国产成a人无v码亚洲福利| 一区二区三区欧美视频| 精品免费国产一区二区三区四区| 91美女在线视频| 美女性感视频久久| 亚洲三级免费观看| 精品国产污污免费网站入口| 欧美综合在线视频| 国产99久久久国产精品免费看| 午夜激情综合网| 最新国产成人在线观看| 精品免费一区二区三区| 欧美色图12p| 成人精品视频一区二区三区| 奇米精品一区二区三区四区| 亚洲精品亚洲人成人网| 久久久夜色精品亚洲| 欧美一区二区三级| 91一区一区三区| 国产69精品久久久久毛片|