📄 untitl~1.searchresults
字号:
Os_mutex.c (source): OS_Sched(); /* Find next highest priority task ready */
Os_mutex.c (source):* OS_ERR_NOT_MUTEX_OWNER The task that did the post is NOT the owner of the MUTEX.
Os_mutex.c (source): OSTCBCur->OSTCBPrio != prio) { /* See if posting task owns the MUTEX */
Os_mutex.c (source): if (OSTCBCur->OSTCBPrio == pip) { /* Did we have to raise current task's priority? */
Os_mutex.c (source): if (pevent->OSEventGrp != 0x00) { /* Any task waiting for the mutex? */
Os_mutex.c (source): prio = OS_EventTaskRdy(pevent, (void *)0, OS_STAT_MUTEX);
Os_mutex.c (source): OS_Sched(); /* Find highest priority task ready to run */
Os_q.c (source):* OSQAccept() does not suspend the calling task if a message is not available.
Os_q.c (source):* Description: This function deletes a message queue and readies all tasks pending on the queue.
Os_q.c (source):* opt == OS_DEL_NO_PEND Delete the queue ONLY if no task pending
Os_q.c (source):* opt == OS_DEL_ALWAYS Deletes the queue even if tasks are waiting.
Os_q.c (source):* In this case, all the tasks pending will be readied.
Os_q.c (source):* OS_ERR_TASK_WAITING One or more tasks were waiting on the queue
Os_q.c (source):* Note(s) : 1) This function must be used with care. Tasks that would normally expect the presence of
Os_q.c (source):* time is directly proportional to the number of tasks waiting on the queue.
Os_q.c (source):* 4) Because ALL tasks pending on the queue will be readied, you MUST be careful in
Os_q.c (source): BOOLEAN tasks_waiting;
Os_q.c (source): if (pevent->OSEventGrp != 0x00) { /* See if any tasks waiting on queue */
Os_q.c (source): tasks_waiting = TRUE; /* Yes */
Os_q.c (source): tasks_waiting = FALSE; /* No */
Os_q.c (source): case OS_DEL_NO_PEND: /* Delete queue only if no task waiting */
Os_q.c (source): if (tasks_waiting == FALSE) {
Os_q.c (source): *err = OS_ERR_TASK_WAITING;
Os_q.c (source): while (pevent->OSEventGrp != 0x00) { /* Ready ALL tasks waiting for queue */
Os_q.c (source): OS_EventTaskRdy(pevent, (void *)0, OS_STAT_Q);
Os_q.c (source): if (tasks_waiting == TRUE) { /* Reschedule only if task(s) were waiting */
Os_q.c (source): OS_Sched(); /* Find highest priority task ready to run */
Os_q.c (source):* timeout is an optional timeout period (in clock ticks). If non-zero, your task will
Os_q.c (source):* specified by this argument. If you specify 0, however, your task will wait
Os_q.c (source):* OS_NO_ERR The call was successful and your task received a
Os_q.c (source): OSTCBCur->OSTCBStat |= OS_STAT_Q; /* Task will have to pend for a message to be posted */
Os_q.c (source): OS_EventTaskWait(pevent); /* Suspend task until event or timeout occurs */
Os_q.c (source): OS_Sched(); /* Find next highest priority task ready to run */
Os_q.c (source): if (pevent->OSEventGrp != 0x00) { /* See if any task pending on queue */
Os_q.c (source): OS_EventTaskRdy(pevent, msg, OS_STAT_Q); /* Ready highest priority task waiting on event */
Os_q.c (source): OS_Sched(); /* Find highest priority task ready to run */
Os_q.c (source): if (pevent->OSEventGrp != 0x00) { /* See if any task pending on queue */
Os_q.c (source): OS_EventTaskRdy(pevent, msg, OS_STAT_Q); /* Ready highest priority task waiting on event */
Os_q.c (source): OS_Sched(); /* Find highest priority task ready to run */
Os_q.c (source):* capability to broadcast a message to ALL tasks waiting on the message queue.
Os_q.c (source):* OS_POST_OPT_NONE POST to a single waiting task
Os_q.c (source):* OS_POST_OPT_BROADCAST POST to ALL tasks that are waiting on the queue
Os_q.c (source):* identical to OSQPost() but will broadcast 'msg' to ALL waiting tasks
Os_q.c (source):* OSQPostFront() except that will broadcast 'msg' to ALL waiting tasks
Os_q.c (source):* interrupt disable time is proportional to the number of tasks waiting on the queue.
Os_q.c (source): if (pevent->OSEventGrp != 0x00) { /* See if any task pending on queue */
Os_q.c (source): if ((opt & OS_POST_OPT_BROADCAST) != 0x00) { /* Do we need to post msg to ALL waiting tasks ? */
Os_q.c (source): while (pevent->OSEventGrp != 0x00) { /* Yes, Post to ALL tasks waiting on queue */
Os_q.c (source): OS_EventTaskRdy(pevent, msg, OS_STAT_Q);
Os_q.c (source): OS_EventTaskRdy(pevent, msg, OS_STAT_Q); /* No, Post to HPT waiting on queue */
Os_q.c (source): OS_Sched(); /* Find highest priority task ready to run */
Os_sem.c (source):* occurred. Unlike OSSemPend(), OSSemAccept() does not suspend the calling task if the
Os_sem.c (source):* Description: This function deletes a semaphore and readies all tasks pending on the semaphore.
Os_sem.c (source):* opt == OS_DEL_NO_PEND Delete semaphore ONLY if no task pending
Os_sem.c (source):* opt == OS_DEL_ALWAYS Deletes the semaphore even if tasks are waiting.
Os_sem.c (source):* In this case, all the tasks pending will be readied.
Os_sem.c (source):* OS_ERR_TASK_WAITING One or more tasks were waiting on the semaphore
Os_sem.c (source):* Note(s) : 1) This function must be used with care. Tasks that would normally expect the presence of
Os_sem.c (source):* time is directly proportional to the number of tasks waiting on the semaphore.
Os_sem.c (source):* 4) Because ALL tasks pending on the semaphore will be readied, you MUST be careful in
Os_sem.c (source): BOOLEAN tasks_waiting;
Os_sem.c (source): if (pevent->OSEventGrp != 0x00) { /* See if any tasks waiting on semaphore */
Os_sem.c (source): tasks_waiting = TRUE; /* Yes */
Os_sem.c (source): tasks_waiting = FALSE; /* No */
Os_sem.c (source): case OS_DEL_NO_PEND: /* Delete semaphore only if no task waiting */
Os_sem.c (source): if (tasks_waiting == FALSE) {
Os_sem.c (source): *err = OS_ERR_TASK_WAITING;
Os_sem.c (source): while (pevent->OSEventGrp != 0x00) { /* Ready ALL tasks waiting for semaphore */
Os_sem.c (source): OS_EventTaskRdy(pevent, (void *)0, OS_STAT_SEM);
Os_sem.c (source): if (tasks_waiting == TRUE) { /* Reschedule only if task(s) were waiting */
Os_sem.c (source): OS_Sched(); /* Find highest priority task ready to run */
Os_sem.c (source):* timeout is an optional timeout period (in clock ticks). If non-zero, your task will
Os_sem.c (source):* If you specify 0, however, your task will wait forever at the specified
Os_sem.c (source):* OS_NO_ERR The call was successful and your task owns the resource
Os_sem.c (source): OS_EventTaskWait(pevent); /* Suspend task until event or timeout occurs */
Os_sem.c (source): OS_Sched(); /* Find next highest priority task ready */
Os_sem.c (source): if (pevent->OSEventGrp != 0x00) { /* See if any task waiting for semaphore */
Os_sem.c (source): OS_EventTaskRdy(pevent, (void *)0, OS_STAT_SEM); /* Ready highest prio task waiting on event */
Os_sem.c (source): OS_Sched(); /* Find highest priority task ready to run */
Os_task.c (source):* TASK MANAGEMENT
Os_task.c (source):* File : OS_TASK.C
Os_task.c (source):* CHANGE PRIORITY OF A TASK
Os_task.c (source):* Description: This function allows you to change the priority of a task dynamically. Note that the new
Os_task.c (source):* OS_PRIO_ERR there is no task with the specified OLD priority (i.e. the OLD task does
Os_task.c (source):#if OS_TASK_CHANGE_PRIO_EN > 0
Os_task.c (source):INT8U OSTaskChangePrio (INT8U oldprio, INT8U newprio)
Os_task.c (source): if (ptcb != (OS_TCB *)0) { /* Task to change must exist */
Os_task.c (source): if ((OSRdyTbl[ptcb->OSTCBY] & ptcb->OSTCBBitX) != 0x00) { /* If task is ready make it not */
Os_task.c (source): ptcb->OSTCBPrio = newprio; /* Set new task priority */
Os_task.c (source): OS_Sched(); /* Run highest priority task ready */
Os_task.c (source): return (OS_PRIO_ERR); /* Task to change didn't exist */
Os_task.c (source):* CREATE A TASK
Os_task.c (source):* Description: This function is used to have uC/OS-II manage the execution of a task. Tasks can either
Os_task.c (source):* be created prior to the start of multitasking or by a running task. A task cannot be
Os_task.c (source):* Arguments : task is a pointer to the task's code
Os_task.c (source):* the task when the task first executes. Where the task is concerned it thinks
Os_task.c (source):* void Task (void *pdata)
Os_task.c (source):* Task code;
Os_task.c (source):* ptos is a pointer to the task's top of stack. If the configuration constant
Os_task.c (source):* prio is the task's priority. A unique priority MUST be assigned to each task and the
Os_task.c (source):* OS_PRIO_EXIT if the task priority already exist
Os_task.c (source):* (each task MUST have a unique priority).
Os_task.c (source):#if OS_TASK_CREATE_EN > 0
Os_task.c (source):INT8U OSTaskCreate (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT8U prio)
Os_task.c (source): if (OSTCBPrioTbl[prio] == (OS_TCB *)0) { /* Make sure task doesn't already exist at this priority */
Os_task.c (source): /* ... the same thing until task is created. */
Os_task.c (source): psp = (OS_STK *)OSTaskStkInit(task, pdata, ptos, 0); /* Initialize the task's stack */
Os_task.c (source): OSTaskCtr++; /* Increment the #tasks counter */
Os_task.c (source): if (OSRunning == TRUE) { /* Find highest priority task if multitasking has started */
Os_task.c (source):* CREATE A TASK (Extended Version)
Os_task.c (source):* Description: This function is used to have uC/OS-II manage the execution of a task. Tasks can either
Os_task.c (source):* be created prior to the start of multitasking or by a running task. A task cannot be
Os_task.c (source):* created by an ISR. This function is similar to OSTaskCreate() except that it allows
Os_task.c (source):* additional information about a task to be specified.
Os_task.c (source):* Arguments : task is a pointer to the task's code
Os_task.c (source):* the task when the task first executes. Where the task is concerned it thinks
Os_task.c (source):* void Task (void *pdata)
Os_task.c (source):* Task code;
Os_task.c (source):* ptos is a pointer to the task's top of stack. If the configuration constant
Os_task.c (source):* prio is the task's priority. A unique priority MUST be assigned to each task and the
Os_task.c (source):* id is the task's ID (0..65535)
Os_task.c (source):* pbos is a pointer to the task's bottom of stack. If the configuration constant
Os_task.c (source):* during a context switch, the time each task takes to execute, the number of times
Os_task.c (source):* the task has been switched-in, etc.
Os_task.c (source):* opt contains additional information (or options) about the behavior of the task. The
Os_task.c (source):* specific. See OS_TASK_OPT_??? in uCOS-II.H.
Os_task.c (source):* OS_PRIO_EXIT if the task priority already exist
Os_task.c (source):* (each task MUST have a unique priority).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -