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

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

?? os_time.c

?? PIC18F452下的uCOS2移植成功代碼+MPLAB IDE V8.0的項目文件。結構非常精簡
?? 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一区二区三区免费野_久草精品视频
天天操天天干天天综合网| 成人欧美一区二区三区在线播放| 亚洲无线码一区二区三区| 95精品视频在线| 亚洲自拍偷拍网站| 欧美另类z0zxhd电影| 美女尤物国产一区| 欧美精品一区二区高清在线观看| 国内精品在线播放| 91色porny| 亚洲欧美一区二区三区国产精品| 色菇凉天天综合网| 亚洲福利一二三区| 日韩一区二区在线观看| 国产一区二区三区久久久| 国产精品免费久久久久| 在线这里只有精品| 奇米一区二区三区| 久久久国产一区二区三区四区小说 | 综合久久久久久| 欧美三级日韩三级国产三级| 久久精品国产99| 国产欧美一区二区三区鸳鸯浴| 色菇凉天天综合网| 九色|91porny| 一区二区三区免费网站| 日韩一区二区免费在线观看| 波多野结衣精品在线| 亚洲一区av在线| 国产欧美一区二区精品仙草咪| 色综合天天综合| 六月丁香综合在线视频| 中文字幕色av一区二区三区| 在线91免费看| 99re8在线精品视频免费播放| 日韩电影在线看| 国产精品久久久久久久久免费丝袜 | 六月丁香婷婷色狠狠久久| 国产精品色在线| 91精品国产综合久久精品app| 成人精品小蝌蚪| 秋霞电影网一区二区| 综合分类小说区另类春色亚洲小说欧美 | 亚洲国产精品嫩草影院| 久久久不卡影院| 91精品国产91久久久久久最新毛片| 成人久久18免费网站麻豆| 免费成人性网站| 一区二区久久久久| 国产欧美日韩另类视频免费观看| 在线不卡免费av| 91无套直看片红桃| 国产精品996| 久久国产麻豆精品| 日韩激情av在线| 一区二区三区免费| 国产精品久久久久影院老司| 亚洲精品一区二区三区蜜桃下载| 8x8x8国产精品| 在线精品视频免费观看| 99久久精品久久久久久清纯| 裸体健美xxxx欧美裸体表演| 亚洲高清免费在线| 一区二区三区四区不卡在线 | 色呦呦网站一区| 国产成人a级片| 国产久卡久卡久卡久卡视频精品| 日本少妇一区二区| 日本美女一区二区三区视频| 亚洲成人免费视| 午夜精品久久久久久久久| 亚洲一区免费观看| 亚洲激情成人在线| 亚洲香肠在线观看| 亚洲在线一区二区三区| 亚瑟在线精品视频| 婷婷六月综合亚洲| 三级在线观看一区二区| 亚洲成人精品一区二区| 午夜精品视频在线观看| 日韩精品一二三四| 蜜桃视频免费观看一区| 久久免费美女视频| 国产偷v国产偷v亚洲高清| 国产午夜亚洲精品不卡| 久久看人人爽人人| 国产精品久久久久久福利一牛影视| 国产片一区二区| 国产精品久久久久一区| 亚洲欧美精品午睡沙发| 亚洲国产精品尤物yw在线观看| 午夜精品久久久久久久 | 日韩精品影音先锋| 精品福利二区三区| 国产嫩草影院久久久久| 中文字幕一区二区三区精华液| 亚洲免费在线看| 日韩在线一区二区三区| 久久狠狠亚洲综合| 99这里只有精品| 欧美在线不卡一区| 日韩欧美成人激情| 亚洲国产激情av| 一区二区三区日韩在线观看| 青青草伊人久久| 国产精品亚洲а∨天堂免在线| 99久久国产综合色|国产精品| 欧美视频在线不卡| 久久综合色婷婷| 亚洲美女淫视频| 麻豆成人91精品二区三区| 成人成人成人在线视频| 欧美裸体bbwbbwbbw| 久久久久久日产精品| 亚洲啪啪综合av一区二区三区| 天天操天天干天天综合网| 懂色av中文字幕一区二区三区| 欧美性高清videossexo| 久久婷婷久久一区二区三区| 亚洲精品成人精品456| 激情综合色综合久久| 日本电影欧美片| 精品粉嫩超白一线天av| 亚洲欧美一区二区三区国产精品| 美女视频免费一区| 色噜噜狠狠成人中文综合| 久久免费精品国产久精品久久久久| 亚洲视频综合在线| 国产一区二区三区日韩| 欧美美女bb生活片| 国产精品国产自产拍高清av王其| 日韩在线观看一区二区| av在线不卡免费看| 欧美大片在线观看| 五月激情综合色| 91在线视频观看| 久久九九99视频| 麻豆专区一区二区三区四区五区| 色婷婷国产精品| 日本一区二区三区四区| 玖玖九九国产精品| 欧美人与禽zozo性伦| 亚洲精品视频免费看| 国产成人在线看| 亚洲精品在线观| 日韩 欧美一区二区三区| 91福利在线看| 中文字幕一区av| 成人免费高清视频| 国产午夜精品一区二区| 日本成人超碰在线观看| 欧美性高清videossexo| 亚洲免费电影在线| 99视频精品免费视频| 亚洲国产高清不卡| 国产91丝袜在线播放| 2024国产精品| 美国欧美日韩国产在线播放| 欧美午夜一区二区三区 | 欧美日韩中文精品| 亚洲欧美视频一区| 99久久免费精品| 中文字幕佐山爱一区二区免费| 国产黑丝在线一区二区三区| 亚洲精品一区二区三区香蕉| 激情久久五月天| 精品国产乱码久久久久久免费| 麻豆成人在线观看| 欧美不卡在线视频| 国产做a爰片久久毛片| 久久久久久久电影| 国产91露脸合集magnet| 日本一区二区视频在线| 成人动漫中文字幕| 亚洲天堂福利av| 色欧美乱欧美15图片| 亚洲一区二区在线播放相泽| 欧美日韩视频在线一区二区| 午夜视频一区二区| 日韩一区二区三区高清免费看看| 青青草原综合久久大伊人精品| 精品少妇一区二区三区日产乱码| 国产精品中文欧美| 国产精品私人自拍| 91网站在线观看视频| 亚洲一区二区黄色| 日韩免费高清av| 国产成a人亚洲精| 亚洲综合一二三区| 欧美一区二区三区人| 国内久久婷婷综合| 国产精品黄色在线观看| 欧美日韩亚洲丝袜制服| 久久99精品国产| 国产精品天天摸av网| 欧美午夜精品一区二区三区| 日韩 欧美一区二区三区| 欧美国产在线观看| 欧美三级视频在线播放| 男男视频亚洲欧美|