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

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

?? os_task.c

?? ucos ii 2.83的完整版,包含接口程序
?? 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区日韩视频| 色偷偷成人一区二区三区91| 欧美精品一区在线观看| 久久国产精品一区二区| 欧美mv和日韩mv国产网站| 极品少妇xxxx精品少妇偷拍| 久久精品一区蜜桃臀影院| 成人高清视频免费观看| 一区二区三区美女视频| 欧美高清性hdvideosex| 狠狠狠色丁香婷婷综合久久五月| 久久亚洲精品国产精品紫薇| 99精品国产99久久久久久白柏| 亚洲精品视频在线观看网站| 欧美日韩国产成人在线免费| 老司机午夜精品99久久| 国产亚洲一二三区| 日本久久电影网| 免费精品99久久国产综合精品| 久久精品人人做人人综合 | 国产天堂亚洲国产碰碰| 成人av片在线观看| 婷婷久久综合九色国产成人 | 欧美日韩精品专区| 精品午夜久久福利影院| 亚洲欧洲制服丝袜| 欧美成人一区二区三区在线观看| 成人黄色小视频| 五月开心婷婷久久| 亚洲美女在线一区| 在线播放欧美女士性生活| 国产高清无密码一区二区三区| 亚洲欧美另类久久久精品2019| 欧美一区二区在线不卡| 99麻豆久久久国产精品免费优播| 一区二区三区蜜桃| 国产喷白浆一区二区三区| 精品视频999| 成人激情免费网站| 蜜臀av性久久久久av蜜臀妖精| 国产精品久99| 2023国产精品| 91精品一区二区三区久久久久久| 99re热视频这里只精品| 国产一区二区不卡| 日韩**一区毛片| 一个色在线综合| 国产精品不卡在线| 久久久91精品国产一区二区三区| 91精品福利在线一区二区三区 | 成人禁用看黄a在线| 免费在线观看视频一区| 一区二区成人在线观看| 国产精品久久久久影院老司| 久久久久久久综合日本| 欧美成人免费网站| 欧美福利一区二区| 欧美亚洲国产一区二区三区va | 欧美日韩不卡一区二区| 欧美日韩不卡在线| 色老头久久综合| 菠萝蜜视频在线观看一区| 韩国理伦片一区二区三区在线播放 | 91蜜桃在线免费视频| 国产成人午夜视频| 精品亚洲porn| 另类欧美日韩国产在线| 免费久久99精品国产| 日韩黄色小视频| 婷婷综合五月天| 日韩精品亚洲一区| 喷白浆一区二区| 美国毛片一区二区| 狠狠色综合色综合网络| 精品在线观看免费| 国产一区二区精品久久91| 精品一区二区三区的国产在线播放| 热久久国产精品| 久久99久久精品| 国产一区二区中文字幕| 国产成人在线视频免费播放| 国产成人综合网| 99re成人在线| 欧美影院午夜播放| 在线不卡的av| 26uuu精品一区二区在线观看| 精品美女被调教视频大全网站| 久久天堂av综合合色蜜桃网| 亚洲精品在线电影| 中文一区一区三区高中清不卡| 日韩理论片在线| 亚洲欧美另类小说| 视频一区国产视频| 免费成人美女在线观看| 国产成人精品一区二| 色诱视频网站一区| 91精品国产91热久久久做人人| 日韩久久久久久| 欧美激情一区不卡| 艳妇臀荡乳欲伦亚洲一区| 免费高清在线一区| 成人激情小说网站| 欧美日本精品一区二区三区| 精品国产污污免费网站入口| 国产精品护士白丝一区av| 亚洲一级在线观看| 国产曰批免费观看久久久| 91视频国产资源| 日韩一区二区三区观看| 国产女人18毛片水真多成人如厕| 亚洲欧美一区二区久久| 美脚の诱脚舐め脚责91| 国产精品一区二区在线播放| 日本韩国欧美国产| 欧美不卡激情三级在线观看| 国产精品久久久久久久久晋中| 亚洲午夜羞羞片| 国产成人免费视| 这里只有精品电影| 中文字幕不卡在线观看| 性感美女极品91精品| 成人在线一区二区三区| 日韩亚洲欧美在线观看| 亚洲欧美韩国综合色| 久草中文综合在线| 欧洲视频一区二区| 欧美国产精品v| 秋霞国产午夜精品免费视频| 一本大道综合伊人精品热热 | 日日夜夜精品视频天天综合网| 国产露脸91国语对白| 欧美日韩中文字幕一区| 成人欧美一区二区三区黑人麻豆| 蜜臀99久久精品久久久久久软件| 91老师片黄在线观看| 久久综合色播五月| 秋霞电影一区二区| 欧美日韩三级一区二区| 国产精品大尺度| 国产成人综合亚洲网站| 欧美成人精品1314www| 亚洲国产精品天堂| 91毛片在线观看| 久久久精品综合| 麻豆91在线看| 欧美高清视频不卡网| 亚洲精品免费在线播放| 成人一级视频在线观看| 亚洲精品一区二区三区99| 日韩**一区毛片| 欧美日韩精品电影| 一区二区三区四区高清精品免费观看| 国产成人综合自拍| 国产午夜精品一区二区| 激情综合五月婷婷| 日韩欧美高清在线| 蜜臀va亚洲va欧美va天堂| 制服丝袜中文字幕一区| 亚洲国产成人av好男人在线观看| 99riav久久精品riav| ...av二区三区久久精品| 国产aⅴ精品一区二区三区色成熟| 日韩免费电影一区| 极品美女销魂一区二区三区 | 91精品国产欧美日韩| 三级亚洲高清视频| 欧美一区二区精品在线| 丝袜国产日韩另类美女| 欧美日韩国产系列| 亚洲二区视频在线| 制服丝袜亚洲色图| 裸体一区二区三区| 精品电影一区二区| 国产乱子伦一区二区三区国色天香| 久久噜噜亚洲综合| 高清国产午夜精品久久久久久| 中文一区二区完整视频在线观看| 国产精品88av| 日韩毛片高清在线播放| 日本高清视频一区二区| 亚洲一级电影视频| 91精品国产色综合久久ai换脸| 久久国产精品色婷婷| 欧美极品少妇xxxxⅹ高跟鞋 | 午夜视频一区二区| 欧美人xxxx| 国产一区二区三区精品视频| 国产精品久久久久久久第一福利 | www激情久久| 成人午夜短视频| 一二三区精品福利视频| 91精品国产高清一区二区三区蜜臀| 麻豆免费看一区二区三区| 久久午夜色播影院免费高清| 91在线观看一区二区| 亚洲图片一区二区| 久久免费国产精品| 色诱视频网站一区| 久久精品国产99国产| 成人免费在线观看入口|