#include <time.h>
#include <pthread.h>
#include <rtl_ipc.h>
#include <semaphore.h>
#include <rtl_barrier.h>
#include <rtl_printf.h>
#include <rtl_conf.h>
#include <unistd.h>
#include <arch/cas.h>
#include "examples.h"

#if TERMINAL_EXAMPLE

static unsigned long valor11=0x0;


pthread_t thread11;

unsigned long context_mprot_prueba;

extern unsigned long mprot_prueba;

void *task11(void *arg)
{
  int fd;
  int aux=0;
  char str1 [] = "This is the RT-TERMINAL\nTHIS component uses VT100 ESC commands.\x1B[3;0H\x1B[34;47mYou\x1B[31;44mcan\x1B[36;41mchange\x1B[30;42measily\x1B[34;47mthe\x1B[32;40mcolors\x1B[10;10H\x1B[34;43mOr you can move by the screen";
  
  
  fd = open("/dev/i386_terminal",0);
//  rtl_printf(str1);
  while(1)
  {
   write(fd,"Probando RT_TTY\n",16);
   rtl_printf(" El handler %d, valor %d \n",fd,aux);
   aux++;
   usleep(3000000);
//   mprot_prueba = 4;
  };
  close(fd);
  return 0;
};





#endif
