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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? os_task.c

?? ARM7開(kāi)發(fā)全部源代碼經(jīng)典.rar
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
/*$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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品丝袜黑色高跟| 亚洲日本丝袜连裤袜办公室| 久久精品人人做人人综合| 国产精品天美传媒| 亚洲va欧美va国产va天堂影院| 婷婷开心激情综合| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美日本韩国一区二区三区视频| 精品欧美久久久| 午夜精品福利一区二区三区蜜桃| 9i看片成人免费高清| 久久在线观看免费| 久久国产精品99精品国产| 欧美日韩国产一级二级| 亚洲欧美福利一区二区| 国产mv日韩mv欧美| 精品国产1区二区| 日韩**一区毛片| 欧洲日韩一区二区三区| 中文字幕精品—区二区四季| 韩国女主播一区| 精品久久久久久最新网址| 天堂成人免费av电影一区| 欧美在线视频全部完| 亚洲日穴在线视频| 91浏览器在线视频| 国产精品理伦片| 不卡一区在线观看| 国产精品网站导航| 99免费精品在线观看| 成人免费在线视频| 91免费看视频| 亚洲综合另类小说| 欧美日韩中文国产| 天天综合色天天综合| 91精品欧美福利在线观看| 日本美女一区二区三区| 欧美一区二区视频观看视频| 日本在线不卡视频| 精品国产乱码久久久久久免费| 麻豆精品蜜桃视频网站| 久久综合精品国产一区二区三区| 捆绑调教美女网站视频一区| 久久综合久久99| 精品在线视频一区| 久久精品人人做人人综合| 国产宾馆实践打屁股91| 亚洲视频精选在线| 欧美日韩国产精选| 黄色日韩三级电影| 国产精品美女一区二区在线观看| 不卡的av在线播放| 亚洲一区二区视频在线观看| 在线观看91av| 国产精品中文字幕一区二区三区| 国产欧美日韩亚州综合| 91老师片黄在线观看| 一区二区不卡在线视频 午夜欧美不卡在| 色婷婷av一区二区| 久久精品国产网站| 中文在线一区二区| 91豆麻精品91久久久久久| 免费视频最近日韩| 国产精品免费视频一区| 91精品啪在线观看国产60岁| 国产福利视频一区二区三区| 亚洲黄一区二区三区| 日韩欧美成人一区| 91视频你懂的| 激情文学综合网| 夜夜嗨av一区二区三区四季av| 91精品国产丝袜白色高跟鞋| 国产一区二区0| 一区二区激情视频| 日本一区二区三区在线不卡| 欧美亚洲综合另类| 粉嫩嫩av羞羞动漫久久久 | 日本韩国精品一区二区在线观看| 亚洲妇女屁股眼交7| 国产欧美久久久精品影院| 欧美三区免费完整视频在线观看| 国产在线不卡一卡二卡三卡四卡| 亚洲综合在线观看视频| 国产欧美一区二区精品性色| 欧美日韩国产精选| 色综合久久综合| 国产成人在线观看免费网站| 五月天中文字幕一区二区| 中文字幕日韩精品一区 | 亚洲人成亚洲人成在线观看图片| 欧美一区二区三区视频免费播放| 91在线丨porny丨国产| 国产一区二区三区黄视频| 亚洲电影一区二区三区| 亚洲视频香蕉人妖| 中文成人综合网| 久久久久久久久久久99999| 7878成人国产在线观看| 欧美亚洲国产bt| 91色视频在线| 国产激情视频一区二区三区欧美 | 亚洲人成在线播放网站岛国 | 亚洲视频在线一区| 国产精品久久久久9999吃药| 精品久久久久久久人人人人传媒| 在线免费观看日本一区| 成人黄色电影在线 | 国产三级精品三级在线专区| 日韩欧美激情四射| 欧美一区二区啪啪| 欧美一级久久久| 欧美久久高跟鞋激| 欧美精品黑人性xxxx| 欧美巨大另类极品videosbest | 成人午夜视频网站| 高清av一区二区| 成人av高清在线| 成人av先锋影音| 91蜜桃免费观看视频| 91麻豆免费看片| 精品视频资源站| 欧美一区二区三区免费大片| 欧美一区二区三区免费在线看| 日韩一区二区在线免费观看| 日韩欧美成人一区二区| 国产亚洲1区2区3区| 欧美激情在线一区二区| 亚洲丝袜自拍清纯另类| 亚洲小说欧美激情另类| 日韩不卡一区二区三区| 久久超碰97人人做人人爱| 国产一区二区不卡老阿姨| 成人免费av在线| 色久优优欧美色久优优| 欧美日韩激情一区二区三区| 日韩欧美的一区二区| 国产女人水真多18毛片18精品视频| 欧美激情中文不卡| 夜夜揉揉日日人人青青一国产精品| 亚洲午夜激情av| 久草中文综合在线| 97精品国产97久久久久久久久久久久| 91麻豆免费看| 精品国产一区二区三区忘忧草| 久久久久久免费毛片精品| 中文字幕一区二区三区在线观看 | 国产精品一线二线三线精华| 白白色亚洲国产精品| 欧美久久久久久久久久| 国产欧美日韩激情| 日韩黄色免费电影| 成人免费高清在线观看| 欧美日韩国产一区二区三区地区| wwwwww.欧美系列| 亚洲综合免费观看高清在线观看| 日本不卡视频一二三区| 9久草视频在线视频精品| 欧美一区二区美女| 亚洲日本护士毛茸茸| 狠狠色丁香婷综合久久| 欧美在线不卡一区| 国产日韩精品一区二区三区 | 国产成人8x视频一区二区| 精品视频一区 二区 三区| 久久久国产综合精品女国产盗摄| 亚洲综合成人在线| 国产99一区视频免费| 91精品久久久久久久91蜜桃| 中文字幕亚洲区| 国产一区二区三区在线观看免费视频| 色香蕉成人二区免费| 国产午夜精品福利| 蜜桃av一区二区| 欧美午夜电影网| 亚洲裸体在线观看| 成人黄色一级视频| 久久久久国产精品厨房| 日韩av中文字幕一区二区 | 天堂va蜜桃一区二区三区漫画版| 成年人午夜久久久| 国产午夜亚洲精品不卡| 国产在线一区二区综合免费视频| 欧美美女一区二区在线观看| 亚洲精品日日夜夜| 91丨九色丨尤物| 中文字幕中文在线不卡住| 国产成人av一区二区三区在线| 欧美成人在线直播| 久久精品国产久精国产爱| 欧美一区二区三区在线视频| 天天射综合影视| 欧美日韩成人综合天天影院| 亚洲午夜激情网站| 欧美日韩综合在线免费观看| 亚洲一级片在线观看| 欧美在线不卡一区| 亚洲第一精品在线| 91超碰这里只有精品国产| 午夜影院久久久| 91精品国产综合久久福利|