// sysInit.c

#include <912d60.h>
#include <stdio.h>
#include "kernel.h"



// TASK PROTOTYPES
int task1(void);
int task2(void);




int sysInit(void) {

	 // LOCAL VARIABLES
	 int id;
	 
	 
	 /* must create all the tasks without interrupt, because this task
	 	will die when it finishes.   */
	 INTR_OFF();
	 
	 
	 // set up the serial port
	 setbaud(BAUD38K);	 	  // actually running at 19K baud due to xtal speed
	 
	 // any additional user setup goes here
	 //----------------------------------------
	 //|                                      |
	 //----------------------------------------
		
		
		
	 // create task1	
	 if (create_task("dummy", &task1, 18, IDLE, 0) < 0)
	 	puts("task1 failure");
	 
	 
	 // create task2	
	 if (create_task("timer", &task2, 0, STOPPED, 255) < 0)
	 	puts("task2 failure");
		
		
	 
	 // remove the sysInit task from memory
	 set_task_state(get_task_id(), STOPPED);
	 remove_task(get_task_id());
	 
	 
	 INTR_ON();
	 
	 return 0;

}

