Keil™, An ARM® Company

RTX51 Tiny User's Guide

os_create_task

Summary 
#include <rtx51tny.h>

char os_create_task (
  unsigned char task_id);     /* ID of task to start */
Description 

The os_create_task function starts task number task_id. The task is marked as ready and begins execution at the next available opportunity.

Note

    This function is part of the RTX51 Tiny Real-Time Operating System which is included only with the PK51 Professional Developer's Kit.
Return Value The os_create_task function returns a value of 0 if the task was successfully started. A value of -1 is returned if the task could not be started, if the task is already running, or if no task was defined using the specified task_id.
See Also os_delete_task
Example 
#include <rtx51tny.h>
#include <stdio.h>           /* for printf */

void new_task (void) _task_ 2
{
.
.
.
}


void tst_os_create_task (void) _task_ 0
{
.
.
.
if (os_create_task (2))
  {
  printf ("Couldn't start task 2\n");
  }
.
.
.
}