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

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

?? os_task.c

?? 全部源代碼參考別人是怎么寫代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*$PAGE*/
/*
*********************************************************************************************************
*                                             STACK CHECKING
*
* Description: This function is called to check the amount of free memory left on the specified task's
*              stack.
*
* Arguments  : prio          is the task priority
*
*              p_stk_data    is a pointer to a data structure of type OS_STK_DATA.
*
* Returns    : OS_NO_ERR           upon success
*              OS_PRIO_INVALID     if the priority you specify is higher that the maximum allowed
*                                  (i.e. > OS_LOWEST_PRIO) or, you have not specified OS_PRIO_SELF.
*              OS_TASK_NOT_EXIST   if the desired task has not been created or is assigned to a Mutex PIP
*              OS_TASK_OPT_ERR     if you did NOT specified OS_TASK_OPT_STK_CHK when the task was created
*********************************************************************************************************
*/
#if OS_TASK_CREATE_EXT_EN > 0
INT8U  OSTaskStkChk (INT8U prio, OS_STK_DATA *p_stk_data)
{
    OS_TCB    *ptcb;
    OS_STK    *pchk;
    INT32U     free;
    INT32U     size;
#if OS_CRITICAL_METHOD == 3                            /* Allocate storage for CPU status register     */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                        /* Prevent compiler warning                     */
#endif    
#if OS_ARG_CHK_EN > 0
    if (prio > OS_LOWEST_PRIO) {					   /* Make sure task priority is valid             */
        if (prio != OS_PRIO_SELF) {        
            return (OS_PRIO_INVALID);
        }
    }
#endif
    p_stk_data->OSFree = 0;                            /* Assume failure, set to 0 size                */
    p_stk_data->OSUsed = 0;
    OS_ENTER_CRITICAL();
    if (prio == OS_PRIO_SELF) {                        /* See if check for SELF                        */
        prio = OSTCBCur->OSTCBPrio;
    }
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                         /* Make sure task exist                         */
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);
    }
    if (ptcb == (OS_TCB *)1) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);
    }  
    if ((ptcb->OSTCBOpt & OS_TASK_OPT_STK_CHK) == 0) { /* Make sure stack checking option is set       */
        OS_EXIT_CRITICAL();
        return (OS_TASK_OPT_ERR);
    }
    free = 0;
    size = ptcb->OSTCBStkSize;
    pchk = ptcb->OSTCBStkBottom;
    OS_EXIT_CRITICAL();
#if OS_STK_GROWTH == 1
    while (*pchk++ == (OS_STK)0) {                    /* Compute the number of zero entries on the stk */
        free++;
    }
#else
    while (*pchk-- == (OS_STK)0) {
        free++;
    }
#endif
    p_stk_data->OSFree = free * sizeof(OS_STK);           /* Compute number of free bytes on the stack */
    p_stk_data->OSUsed = (size - free) * sizeof(OS_STK);  /* Compute number of bytes used on the stack */
    return (OS_NO_ERR);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                            SUSPEND A TASK
*
* Description: This function is called to suspend a task.  The task can be the calling task if the
*              priority passed to OSTaskSuspend() is the priority of the calling task or OS_PRIO_SELF.
*
* Arguments  : prio     is the priority of the task to suspend.  If you specify OS_PRIO_SELF, the
*                       calling task will suspend itself and rescheduling will occur.
*
* Returns    : OS_NO_ERR                if the requested task is suspended
*              OS_TASK_SUSPEND_IDLE     if you attempted to suspend the idle task which is not allowed.
*              OS_PRIO_INVALID          if the priority you specify is higher that the maximum allowed
*                                       (i.e. >= OS_LOWEST_PRIO) or, you have not specified OS_PRIO_SELF.
*              OS_TASK_SUSPEND_PRIO     if the task to suspend does not exist
*              OS_TASK_NOT_EXITS        if the task is assigned to a Mutex PIP
*
* Note       : You should use this function with great care.  If you suspend a task that is waiting for
*              an event (i.e. a message, a semaphore, a queue ...) you will prevent this task from
*              running when the event arrives.
*********************************************************************************************************
*/

#if OS_TASK_SUSPEND_EN > 0
INT8U  OSTaskSuspend (INT8U prio)
{
    BOOLEAN    self;
    OS_TCB    *ptcb;
	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 OS_ARG_CHK_EN > 0
    if (prio == OS_IDLE_PRIO) {                                 /* Not allowed to suspend idle task    */
        return (OS_TASK_SUSPEND_IDLE);
    }
    if (prio >= OS_LOWEST_PRIO) {								/* Task priority valid ?               */
        if (prio != OS_PRIO_SELF) {
            return (OS_PRIO_INVALID);
        }
    }
#endif
    OS_ENTER_CRITICAL();
    if (prio == OS_PRIO_SELF) {                                 /* See if suspend SELF                 */
        prio = OSTCBCur->OSTCBPrio;
        self = TRUE;
    } else if (prio == OSTCBCur->OSTCBPrio) {                   /* See if suspending self              */
        self = TRUE;
    } else {
        self = FALSE;                                           /* No suspending another task          */
    }
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                                  /* Task to suspend must exist          */
        OS_EXIT_CRITICAL();
        return (OS_TASK_SUSPEND_PRIO);
    }
    if (ptcb == (OS_TCB *)1) {                                  /* See if assigned to Mutex            */
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);
    }
	y            = ptcb->OSTCBY;
	OSRdyTbl[y] &= ~ptcb->OSTCBBitX;							/* Make task not ready                 */
    if (OSRdyTbl[y] == 0x00) { 
        OSRdyGrp &= ~ptcb->OSTCBBitY;
    }
    ptcb->OSTCBStat |= OS_STAT_SUSPEND;                         /* Status of task is 'SUSPENDED'       */
    OS_EXIT_CRITICAL();
    if (self == TRUE) {                                         /* Context switch only if SELF         */
        OS_Sched();
    }
    return (OS_NO_ERR);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                            QUERY A TASK
*
* Description: This function is called to obtain a copy of the desired task's TCB.
*
* Arguments  : prio         is the priority of the task to obtain information from.
*
*              p_task_data  is a pointer to where the desired task's OS_TCB will be stored.
*
* Returns    : OS_NO_ERR          if the requested task is suspended
*              OS_PRIO_INVALID    if the priority you specify is higher that the maximum allowed
*                                 (i.e. > OS_LOWEST_PRIO) or, you have not specified OS_PRIO_SELF.
*              OS_PRIO_ERR        if the desired task has not been created
*              OS_TASK_NOT_EXIST  if the task is assigned to a Mutex PIP
*********************************************************************************************************
*/

#if OS_TASK_QUERY_EN > 0
INT8U  OSTaskQuery (INT8U prio, OS_TCB *p_task_data)
{
    OS_TCB    *ptcb;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
#if OS_ARG_CHK_EN > 0
    if (prio > OS_LOWEST_PRIO) {				 /* Task priority valid ?    	                       */
        if (prio != OS_PRIO_SELF) {   
            return (OS_PRIO_INVALID);
        }
    }
#endif
    OS_ENTER_CRITICAL();
    if (prio == OS_PRIO_SELF) {                  /* See if suspend SELF                                */
        prio = OSTCBCur->OSTCBPrio;
    }
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                   /* Task to query must exist                           */
        OS_EXIT_CRITICAL();
        return (OS_PRIO_ERR);
    }
    if (ptcb == (OS_TCB *)1) {                   /* Task to query must not be assigned to a Mutex      */
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);
    }
                                                 /* Copy TCB into user storage area                    */
    OS_MemCopy((INT8U *)p_task_data, (INT8U *)ptcb, sizeof(OS_TCB));  
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                        CLEAR TASK STACK
*
* Description: This function is used to clear the stack of a task (i.e. write all zeros)
*
* Arguments  : pbos     is a pointer to the task's bottom of stack.  If the configuration constant
*                       OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from high
*                       memory to low memory).  'pbos' will thus point to the lowest (valid) memory
*                       location of the stack.  If OS_STK_GROWTH is set to 0, 'pbos' will point to the
*                       highest memory location of the stack and the stack will grow with increasing
*                       memory locations.  'pbos' MUST point to a valid 'free' data item.
*
*              size     is the number of 'stack elements' to clear.
*
*              opt      contains additional information (or options) about the behavior of the task.  The
*                       LOWER 8-bits are reserved by uC/OS-II while the upper 8 bits can be application
*                       specific.  See OS_TASK_OPT_??? in uCOS-II.H.
*
* Returns    : none
*********************************************************************************************************
*/
#if OS_TASK_CREATE_EXT_EN > 0
void  OS_TaskStkClr (OS_STK *pbos, INT32U size, INT16U opt)
{
    if ((opt & OS_TASK_OPT_STK_CHK) != 0x0000) {       /* See if stack checking has been enabled       */
        if ((opt & OS_TASK_OPT_STK_CLR) != 0x0000) {   /* See if stack needs to be cleared             */
#if OS_STK_GROWTH == 1                     
            while (size > 0) {                         /* Stack grows from HIGH to LOW memory          */
                size--;
                *pbos++ = (OS_STK)0;                   /* Clear from bottom of stack and up!           */
            }
#else
            while (size > 0) {                         /* Stack grows from LOW to HIGH memory          */
                size--;
                *pbos-- = (OS_STK)0;                   /* Clear from bottom of stack and down          */
            }
#endif
        }
    }
}

#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品剧情v国产在线观看在线| 色妞www精品视频| 国产最新精品精品你懂的| 精品一区二区三区免费视频| 免费观看在线色综合| 九九国产精品视频| 91在线云播放| 日韩西西人体444www| 国产清纯白嫩初高生在线观看91| 亚洲欧洲日韩综合一区二区| 婷婷久久综合九色综合绿巨人 | 色老汉一区二区三区| 日韩欧美亚洲另类制服综合在线| 久久久久久久电影| 丝袜诱惑制服诱惑色一区在线观看| 久久er99热精品一区二区| 色综合天天天天做夜夜夜夜做| 欧美一二三区精品| 亚洲免费三区一区二区| 国产一区二三区| 在线电影国产精品| 亚洲免费av高清| 成人免费看片app下载| 91精品视频网| 亚洲最新在线观看| 9久草视频在线视频精品| 欧美精品一区二区三区很污很色的 | 99视频有精品| 日本一区二区成人| 国产成人免费av在线| 91精品国产91久久久久久一区二区 | 国产一区二区女| 欧美一区二区三区播放老司机| 亚洲三级在线免费观看| 成人小视频免费在线观看| 久久久久国产成人精品亚洲午夜| 美日韩一级片在线观看| 欧美人与性动xxxx| 日韩精品免费视频人成| 欧美日韩在线直播| 午夜精品久久久久久| 欧美日韩精品欧美日韩精品一 | 欧美不卡一二三| 免费观看久久久4p| 337p粉嫩大胆色噜噜噜噜亚洲| 精品一区二区在线播放| 久久综合色鬼综合色| 国产福利精品导航| 国产精品成人免费在线| 色综合色综合色综合| 亚洲国产另类av| 欧美va天堂va视频va在线| 国产综合成人久久大片91| 亚洲欧洲三级电影| 91精品国产色综合久久ai换脸 | 成人激情黄色小说| 亚洲一区免费在线观看| 欧美白人最猛性xxxxx69交| 国产福利一区在线观看| 亚洲国产欧美在线人成| 亚洲精品在线免费播放| 色先锋aa成人| 国产精品亚洲а∨天堂免在线| 国产精品国模大尺度视频| 欧美片在线播放| 国产激情一区二区三区四区| 一区二区在线观看免费视频播放| 欧美日韩国产不卡| 99视频精品在线| 国产麻豆精品视频| 午夜精品影院在线观看| 国产精品成人一区二区艾草 | 国产精品国产a| 日韩欧美国产综合一区| 91免费看`日韩一区二区| 九九久久精品视频| 日本欧美肥老太交大片| 亚洲午夜久久久久| 亚洲人成小说网站色在线| 精品国产一区二区三区四区四 | 人人狠狠综合久久亚洲| 一区二区三区四区在线免费观看| 国产亚洲欧美日韩在线一区| 在线电影国产精品| 欧美色图片你懂的| 91美女片黄在线| 91在线porny国产在线看| 国产高清久久久| 国产一区二区三区久久久| 精品影院一区二区久久久| 午夜欧美视频在线观看| 亚洲一区二区三区三| 一个色在线综合| 亚洲免费观看高清完整版在线| 中文幕一区二区三区久久蜜桃| 久久女同互慰一区二区三区| 26uuu欧美| 国产日韩欧美制服另类| 国产精品视频yy9299一区| 中文字幕一区日韩精品欧美| 亚洲欧洲成人自拍| 亚洲成人精品影院| 久久99在线观看| 国产suv一区二区三区88区| 成人少妇影院yyyy| 欧美自拍偷拍一区| 欧美一区二区视频在线观看| 欧美成人精品福利| 成人免费一区二区三区在线观看| 亚洲精品视频自拍| 日日夜夜精品视频免费| 国产资源在线一区| 91精品91久久久中77777| 亚洲精品欧美激情| 国内精品久久久久影院一蜜桃| 成人综合婷婷国产精品久久免费| 91激情五月电影| 久久亚洲综合色| 亚洲一级在线观看| 日韩欧美不卡一区| 一区二区免费视频| 国产自产高清不卡| 欧美日韩一区二区三区四区| 久久蜜桃av一区精品变态类天堂| 自拍偷自拍亚洲精品播放| 看片的网站亚洲| 欧美另类久久久品| 国产精品福利av| 韩国精品主播一区二区在线观看 | 色婷婷久久综合| 日本一区二区高清| 精品一区二区在线视频| 欧美精品一卡两卡| 亚洲激情校园春色| 97精品国产露脸对白| 中文字幕第一区二区| 国内国产精品久久| 欧美一区日韩一区| 亚洲二区在线观看| 欧洲一区二区三区在线| 日韩一区中文字幕| 91麻豆精品在线观看| 亚洲视频一区二区免费在线观看| 成人一区二区三区| 国产性做久久久久久| 国产一区三区三区| 久久精品视频在线看| 国产一区视频导航| 国产午夜精品久久| 丁香啪啪综合成人亚洲小说| 久久青草国产手机看片福利盒子| 国产精一品亚洲二区在线视频| 精品日韩在线一区| 精品一区二区成人精品| 久久久久九九视频| 成人av网站在线| 成人av在线播放网站| 亚洲女同ⅹxx女同tv| 日本道精品一区二区三区| 日韩精品电影在线| 国产亚洲综合av| 91污片在线观看| 日韩精品午夜视频| 国产日韩精品一区| 色婷婷久久综合| 精品一区二区三区在线视频| 国产调教视频一区| 97久久超碰国产精品| 无码av免费一区二区三区试看 | 亚洲欧洲日韩在线| 91精品在线观看入口| 国产成人在线网站| 亚洲综合无码一区二区| 欧美成人猛片aaaaaaa| 91亚洲国产成人精品一区二三 | 国产欧美一区二区三区沐欲| 91成人在线精品| 大胆欧美人体老妇| 美女视频一区二区| 亚洲香蕉伊在人在线观| 中文字幕不卡在线| 91精品国产高清一区二区三区蜜臀| 国产.欧美.日韩| 国产一区在线观看视频| 亚洲图片自拍偷拍| 国产精品初高中害羞小美女文 | 亚洲精品菠萝久久久久久久| 久久精品夜色噜噜亚洲aⅴ| 欧美人体做爰大胆视频| 91黄色免费网站| 91女人视频在线观看| 成人av在线一区二区三区| 国产精品一区二区久激情瑜伽| 天天综合日日夜夜精品| 亚洲男同性视频| 中文字幕亚洲综合久久菠萝蜜| 久久精品亚洲乱码伦伦中文| 精品sm捆绑视频| 久久亚洲私人国产精品va媚药| 制服丝袜中文字幕亚洲|