// Include files we must have
#include "mqx.h"
#include <fio.h>

// Task prototypes
void hello_task(uint_32);
void world_task(uint_32);

// Our start task list
const TASK_TEMPLATE_STRUCT  MQX_template_list[] = 
{  
  /* Task Index,   Function,   Stack,  Priority, Name,     Attributes,          Param, Time Slice */
  { 5,          world_task, 1000,   9,        "world",  MQX_AUTO_START_TASK, 0,     0 },
  { 6,          hello_task, 1000,   8,        "hello",  0,                   0,     0 },
  { 0 }
};

// Definition of task "world"
//
void world_task( uint_32 initial_data )
{
  _task_id hello_task_id = _task_create(0, 6, 0);
  
  if (hello_task_id == MQX_NULL_TASK_ID)
  {
    printf ("\n Could not create hello_task\n");
  }
  else 
  {
    printf(" World \n");
  }
  
  _task_block();
}

// Definition of task "hello"
//
void hello_task ( uint_32 initial_data )
{
   printf("\n Hello ");
   _task_block();
}
