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

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

?? os_task.c

?? ARM7的一些試驗程序
?? 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一区二区三区免费野_久草精品视频
一区二区三区四区蜜桃| 香蕉久久夜色精品国产使用方法| 欧美日韩一级视频| 国产精品小仙女| 五月天亚洲精品| 国产欧美精品一区二区色综合| 欧美视频日韩视频在线观看| 国产**成人网毛片九色 | 欧美专区日韩专区| 国产成人精品免费看| 毛片av中文字幕一区二区| 亚洲精品亚洲人成人网在线播放| 亚洲精品一区二区三区99| 欧美高清www午色夜在线视频| 99久久精品免费| 国产.精品.日韩.另类.中文.在线.播放 | 国产乱对白刺激视频不卡| 天堂在线亚洲视频| 亚洲激情综合网| 欧美国产成人精品| 久久综合九色综合欧美就去吻| 欧美日韩在线电影| 色综合天天做天天爱| 成人在线综合网站| 国产精品69久久久久水密桃| 狠狠色丁香久久婷婷综合_中| 日韩精品亚洲一区二区三区免费| 亚洲精品视频在线观看网站| 亚洲天堂网中文字| 亚洲国产精华液网站w| 久久久www成人免费毛片麻豆 | 国产精品进线69影院| 久久久精品日韩欧美| 欧美成人免费网站| 欧美成人猛片aaaaaaa| 日韩视频免费直播| 日韩欧美一区在线观看| 日韩免费看的电影| 精品久久五月天| 亚洲欧美日韩在线播放| 国产精品三级电影| 国产精品拍天天在线| 国产精品三级av| 中文字幕在线观看不卡| 亚洲欧洲99久久| 亚洲免费高清视频在线| 亚洲欧美国产三级| 亚洲一区二区三区不卡国产欧美| 一区二区三区日韩在线观看| 亚洲国产日韩精品| 美女www一区二区| 国产专区欧美精品| 成人激情开心网| 色狠狠色狠狠综合| 欧美日韩国产高清一区二区三区 | 日韩精品电影一区亚洲| 免费人成在线不卡| 国产美女视频一区| 波多野结衣亚洲| 欧美中文字幕一二三区视频| 欧美久久高跟鞋激| 久久久久久久电影| 自拍av一区二区三区| 亚洲成人福利片| 国产在线视频一区二区| 成人app在线观看| 91久久久免费一区二区| 欧美日韩欧美一区二区| 日韩欧美精品在线视频| 国产精品狼人久久影院观看方式| 亚洲精品视频在线| 精品一区二区三区在线播放| 成人午夜视频网站| 欧美理论片在线| 久久久久久**毛片大全| 国产精品久久久久影院色老大| 亚洲精品国产精华液| 老司机精品视频在线| 色综合一区二区三区| 日韩网站在线看片你懂的| 欧美国产日韩精品免费观看| 亚洲大片精品永久免费| 国产98色在线|日韩| 欧美天堂一区二区三区| 久久久久久久久久久久久女国产乱 | 一区二区三区精密机械公司| 久久机这里只有精品| 色婷婷一区二区| 日韩美女在线视频 | 国产精品萝li| 美女视频免费一区| 91色乱码一区二区三区| 精品奇米国产一区二区三区| 亚洲美女免费视频| 国产一区二区三区在线观看免费| 在线影院国内精品| 国产精品欧美久久久久无广告| 日日噜噜夜夜狠狠视频欧美人| 99久久伊人精品| 精品人伦一区二区色婷婷| 夜夜嗨av一区二区三区中文字幕| 国产综合色在线视频区| 欧美日韩视频在线第一区| 国产精品丝袜黑色高跟| 久久99精品国产| 欧美日韩国产综合视频在线观看| 国产精品嫩草影院com| 另类成人小视频在线| 欧美日韩一二三| 亚洲猫色日本管| 成人一级片网址| 精品久久五月天| 日韩激情一二三区| 欧美日韩成人综合天天影院| 亚洲视频香蕉人妖| 成人av免费在线观看| 久久综合久久99| 精品午夜一区二区三区在线观看| 欧美体内she精视频| 国产精品成人在线观看| 懂色av一区二区夜夜嗨| 精品久久久久一区| 日本亚洲最大的色成网站www| 色一情一乱一乱一91av| 中文字幕一区免费在线观看| 成人性生交大片免费看中文网站| 日韩女优视频免费观看| 日韩av中文字幕一区二区三区| 欧美三级电影在线看| 亚洲一区二区三区中文字幕在线| 91欧美一区二区| 中文字幕综合网| 91亚洲午夜精品久久久久久| 国产精品久久久久一区二区三区共| 粉嫩高潮美女一区二区三区| 久久综合国产精品| 国产福利精品一区| 久久久久久久精| 成人黄色网址在线观看| 日本一区二区电影| 成人avav影音| 亚洲精品中文在线| 欧美日韩在线精品一区二区三区激情 | 欧美视频一二三区| 视频在线在亚洲| 欧美va亚洲va| 国产精品一二三四五| 久久九九99视频| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 另类小说欧美激情| 久久久影视传媒| 成人av网站免费| 一卡二卡欧美日韩| 6080午夜不卡| 精品无人码麻豆乱码1区2区 | 亚洲成人手机在线| 欧美一级片在线看| 韩国精品主播一区二区在线观看 | 一区二区高清免费观看影视大全| 欧美日韩亚洲丝袜制服| 另类专区欧美蜜桃臀第一页| 国产日韩精品一区二区浪潮av| 99精品视频中文字幕| 亚洲图片欧美色图| 日韩欧美中文字幕公布| 国产福利一区二区三区| 亚洲精选一二三| 日韩一区二区三区av| 国产成人av电影在线| 夜夜精品浪潮av一区二区三区| 91精品国产高清一区二区三区| 极品美女销魂一区二区三区| 亚洲欧美综合色| 欧美一区二区精美| 岛国精品一区二区| 亚洲高清视频在线| 久久久激情视频| 欧美日韩激情一区二区三区| 激情偷乱视频一区二区三区| 亚洲日本在线a| 日韩欧美精品三级| 99精品欧美一区二区蜜桃免费| 日韩国产成人精品| √…a在线天堂一区| 日韩一区和二区| 91视频一区二区| 国产在线国偷精品免费看| 亚洲国产综合色| 中文幕一区二区三区久久蜜桃| 欧美日精品一区视频| 成人在线视频一区二区| 全部av―极品视觉盛宴亚洲| 国产精品久久久久久久浪潮网站 | 久久久久久免费| 欧美日韩激情一区二区三区| 波多野结衣在线aⅴ中文字幕不卡| 丝瓜av网站精品一区二区| 国产精品久久久久久久久免费丝袜| 91精品国产91久久久久久一区二区| 日韩欧美在线一区二区三区|