Metrologic Optimus S Programming Manual page 237

"c" programming guide
Table of Contents

Advertisement

Return
If successful, it returns OS_NO_ERR.
If the requested priority already exists, it returns OS_PRIO_EXIST.
See Also
OSTaskDel
OSTaskDel
Purpose
To delete a task.
Syntax
unsigned char OSTaskDel (unsigned char prio);
where, prio is the task priority. A unique priority number must be assigned to
each task; the lower the number, the higher the priority.
err = OSTaskDel (10);
Example
Description
This function allows user application to delete a task by specifying the priority
number of the task. The calling task can be deleted by specifying its own
priority number. The deleted task is returned to the dormant state. The deleted
task may be created to make the deleted task active again. Note that an ISR
cannot delete a task. This function will verify that you are not attempting to
delete the µC/OS's idle task.
Return
If successful, it returns OS_NO_ERR.
If the task to be deleted does not exist, it returns OS_TASK_DEL_ERR.
If the task to be deleted is an idle task, it returns OS_TASK_DEL_IDLE.
See Also
OSTaskCreate
OSTimeDly
To allow a task to delay itself for a number of clock ticks.
Purpose
Syntax
void OSTimeDly (unsigned long ticks);
where, ticks is the number of clock ticks to delay the current task; delay time in
units of 5 ms.
OSTimeDly (10);
Example
Description
This function allows a task to delay itself for a number of clock ticks.
Rescheduling always occurs when the number of clock ticks is greater than
zero. Valid delays range from 1 to 65535 ticks. Calling this function with a
delay of 0 results in no delay, and thus the function returns to the caller. Note
that this function cannot be called from an ISR.
Return
None
Chapter 5 Real-Time Kernel
/* delete a task with priority 10 */
/* delay task for 50 ms */
231

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents