/*
  tmTimerTest, Copyright  (c) by Lukas Ruf,
  Swiss Federal Institute of Technology,
  Computer Engineering and Networks Laboratory.
 
  TOPSY -- A Teachable Operating System.
           Implementation of a tiny and simple
           micro kernel for teaching purposes.
 
  For further information, please visit http://www.tik.ee.ethz.ch/~topsy
 
  This software is provided under the terms of the GNU General Public Licence.
 
  A full copy of the GNU GPL is provided in the file COPYING found in the 
  development root of Topsy.
*/
/*
	File:                  $Source: /home/ruf/cvs_Topsy/cvs/Topsy/User/tmTimerTest.c,v $
 	Author(s):             Lukas Ruf
 	Affiliation:           ETH Zuerich, TIK
 	Version:               $Revision: 2922 $
 	Creation Date:         2001/02/13
 	Last Date of Change:   $Date: 2007-03-19 17:48:52 +0100 (Mon, 19 Mär 2007) $      by: $Author: baderma $
*/

#include "../Topsy/Syscall.h"
#include "UserSupport.h"
#include "TMTimerNG.h"

void tmTimerTest()
{
  ThreadId console, from;
  unsigned long timerId;
  Message reply, msg;

  ioOpen(IO_CONSOLE, &console);
  ioInit(console);
  display(console, "Timer to be set\n");


  if ( tmSetTimer(100 /* 1000ms */, &timerId) != TM_TIMERSETOK)
  {
    display(console, "Setting the Timer failed");
  }
  else
  {
    display(console, "timer Set\n");

    from = ANY;
    if (tmMsgRecv(&from, ANYMSGTYPE, &reply, INFINITY) == TM_MSGRECVOK)
    {
      display(console, "Whow, we received a message\n");
    }
  }

  tmExit();
}
