#include <ararm.h>
#include <LPC21xx.H> 

void task1 (void) __task;
void task2 (void) __task;

OS_TID tsk1,tsk2;

void main (void)
{
IODIR0 	= 0xFF;

os_sys_init (task1);
}


void task1 (void)	__task
{

tsk1 	= os_tsk_self();

tsk2 	= os_tsk_create(task2,0);

while(1)
{
IOCLR0 	= 0xFF; 

os_evt_wait_or(0x0001,0xffff);
os_dly_wait(5);
}
}

void task2 (void)	__task
{
unsigned char counter = 0;

while(1)
{
IOSET0 	=  0xFF;
if(counter++>0xA)
{
os_evt_set(0x0001,tsk1);
counter = 0;
}
os_dly_wait(5);
}
}

