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

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

?? os_task.c

?? 基于44B0的uCOS程序
?? 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一区二区三区免费野_久草精品视频
色婷婷综合久久久中文字幕| 亚洲一线二线三线视频| 黑人巨大精品欧美一区| 欧美xfplay| 国产成人免费在线| 亚洲同性gay激情无套| 99视频精品全部免费在线| 国产精品嫩草影院av蜜臀| 94色蜜桃网一区二区三区| 亚洲六月丁香色婷婷综合久久| 色婷婷av一区二区三区软件| 亚洲国产精品精华液网站| 337p亚洲精品色噜噜| 精品在线亚洲视频| 国产精品不卡在线| 91.麻豆视频| 国产白丝网站精品污在线入口| 亚洲欧洲成人自拍| 欧美日韩在线播放一区| 国内成+人亚洲+欧美+综合在线| 欧美国产综合一区二区| 色欧美片视频在线观看在线视频| 天天色天天操综合| 国产视频一区二区在线| 色婷婷综合久久久中文字幕| 久久99精品久久久久婷婷| 国产精品高潮呻吟久久| 欧美久久久一区| av不卡在线播放| 玖玖九九国产精品| 18欧美乱大交hd1984| 欧美一区二区三区不卡| 94色蜜桃网一区二区三区| 美腿丝袜亚洲一区| 亚洲男人的天堂在线aⅴ视频| 在线电影国产精品| 成人国产精品视频| 六月婷婷色综合| 亚洲综合一区二区| 国产欧美精品一区aⅴ影院 | 成人免费的视频| 调教+趴+乳夹+国产+精品| 国产精品女主播av| 精品国产百合女同互慰| 欧美视频中文字幕| eeuss影院一区二区三区| 韩国成人福利片在线播放| 亚洲高清免费一级二级三级| 国产精品免费久久久久| 日韩欧美国产综合| 欧美怡红院视频| 色综合中文字幕| 成人午夜av在线| 国内久久精品视频| 日本欧美肥老太交大片| 一区二区三区中文字幕在线观看| 国产日韩欧美制服另类| 精品日韩在线一区| 日韩一区二区免费在线观看| 欧美日韩中文另类| 日本精品视频一区二区三区| 成人黄色软件下载| 粗大黑人巨茎大战欧美成人| 久久精品国产色蜜蜜麻豆| 五月天欧美精品| 首页综合国产亚洲丝袜| 亚洲午夜电影网| 亚洲一区视频在线观看视频| 亚洲啪啪综合av一区二区三区| 欧美国产成人在线| 中文字幕欧美国产| 国产欧美一二三区| 国产目拍亚洲精品99久久精品| 久久亚洲捆绑美女| 久久久99精品久久| 国产人成亚洲第一网站在线播放| 久久尤物电影视频在线观看| www一区二区| 久久综合九色综合97婷婷女人| 精品美女一区二区| 精品国产免费一区二区三区四区| 日韩欧美一区在线| 亚洲精品在线电影| 欧美精品一区二| 国产日产精品1区| 国产精品视频九色porn| 国产精品第13页| 国产精品二三区| 亚洲精品自拍动漫在线| 亚洲午夜免费视频| 琪琪一区二区三区| 国产综合色产在线精品| 国产·精品毛片| 91视频观看视频| 欧美午夜视频网站| 91精品国产aⅴ一区二区| 欧美白人最猛性xxxxx69交| 国产午夜精品一区二区三区视频 | 亚洲精品成a人| 午夜精品一区二区三区免费视频| 日韩专区欧美专区| 国产麻豆91精品| 91视频xxxx| 欧美一区二区三区四区五区| 欧美α欧美αv大片| 国产精品天天摸av网| 亚洲激情自拍偷拍| 久久精品国产免费看久久精品| 国产精品一区二区在线观看不卡 | 日本一区二区免费在线| 亚洲视频图片小说| 奇米影视一区二区三区小说| 国产成人高清在线| 欧美在线免费视屏| 精品国产凹凸成av人导航| 国产精品卡一卡二卡三| 日韩二区三区在线观看| 丰满亚洲少妇av| 欧美日韩国产片| 国产欧美一区二区在线观看| 亚洲一区二区精品视频| 国产在线麻豆精品观看| 欧洲av在线精品| 日本一区二区成人| 奇米一区二区三区| 色婷婷精品大视频在线蜜桃视频| 精品电影一区二区三区| 一区二区三区**美女毛片| 国产大陆a不卡| 欧美精品日韩一本| 中文字幕欧美一| 国内久久精品视频| 欧美日韩高清一区二区三区| 久久亚洲精品小早川怜子| 午夜精品久久久久| 91性感美女视频| 久久久不卡影院| 麻豆国产精品一区二区三区| 91麻豆精品一区二区三区| 26uuu色噜噜精品一区二区| 亚洲一区二区三区激情| 91蜜桃网址入口| 国产欧美综合色| 韩国精品主播一区二区在线观看 | 日韩精品一区二区三区swag| 亚洲综合免费观看高清完整版 | 亚洲欧美中日韩| 国产乱码一区二区三区| 日韩一区和二区| 午夜不卡av免费| 欧洲亚洲国产日韩| 亚洲欧洲日韩女同| 成人黄色软件下载| 亚洲国产精品v| 国产91丝袜在线18| 国产视频一区二区在线观看| 韩国女主播一区| 久久这里都是精品| 极品尤物av久久免费看| 欧美大片一区二区三区| 视频在线观看国产精品| 欧美日韩日日摸| 天堂午夜影视日韩欧美一区二区| 欧美性猛片aaaaaaa做受| 亚洲视频一区二区在线观看| 99久久综合精品| 亚洲啪啪综合av一区二区三区| 99久久er热在这里只有精品66| 欧美激情一区在线| 成人国产视频在线观看| 最新热久久免费视频| 日本韩国欧美国产| 一区二区三区国产精品| 在线视频亚洲一区| 一区二区三区四区高清精品免费观看| 色综合天天做天天爱| 亚洲精品视频一区二区| 欧美性猛交xxxxxxxx| 婷婷亚洲久悠悠色悠在线播放| 欧美日韩日本视频| 久久av资源网| 国产午夜一区二区三区| av在线不卡网| 一片黄亚洲嫩模| 91麻豆精品国产91久久久久| 青青草精品视频| 久久久99免费| 99国产欧美久久久精品| 亚洲一区二区四区蜜桃| 这里是久久伊人| 国产一区二区网址| 国产精品久久夜| 欧美午夜片在线看| 精品一区二区三区免费播放| 国产亚洲人成网站| 在线日韩av片| 精品一区二区三区的国产在线播放| 久久欧美中文字幕| 91在线视频播放| 美女视频免费一区|