/*
** ###################################################################
**
**     Filename  : Events.C
**
**     Project   : projRT1
** 
**     Processor : MC68HC908AZ60MFU
**
**     Beantype  : Events
**
**     Version   : Driver 01.00
**
**     Compiler  : Metrowerks HC08 C Compiler V-5.0.13
**
**     Date/Time : 2.4.2002, 8:38
**
**     Abstract  :
**
**         This is user's event module.
**         Put your event handler code here.
**
**     Settings  :
**
**
**     Contents  :
**
**         Slower_OnInterrupt - void Slower_OnInterrupt(void);
**         Faster_OnInterrupt - void Faster_OnInterrupt(void);
**         TI1_OnInterrupt   - void TI1_OnInterrupt(void);
**
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2002
**
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
**
** ###################################################################
*/
/* MODULE Events */

#pragma MESSAGE DISABLE C1420 /* WARNING C1420: Result of function-call is ignored */


/*Including used modules for compilling procedure*/
#include "Cpu.h"
#include "Events.h"
#include "TI1.h"
#include "Faster.h"
#include "Slower.h"
#include "Byte1.h"

/*Include shared modules, which are used for whole project*/
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"

/*
** ===================================================================
**     Event       :  Slower_OnInterrupt (module Events)
**
**     From bean   :  Slower [ExtInt]
**     Description :
**         This event is called when the active signal edge/level
**         occurs.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void Slower_OnInterrupt(void)
{
  TI1_SetPeriodMode(2);
}


/*
** ===================================================================
**     Event       :  Faster_OnInterrupt (module Events)
**
**     From bean   :  Faster [ExtInt]
**     Description :
**         This event is called when the active signal edge/level
**         occurs.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void Faster_OnInterrupt(void)
{
  TI1_SetPeriodMode(1);
}


/*
** ===================================================================
**     Event       :  TI1_OnInterrupt (module Events)
**
**     From bean   :  TI1 [TimerInt]
**     Description :
**         When a timer interrupt occurs this event is called (only
**         when the bean is enabled - "Enable" and the events are
**         enabled - "EnableEvent").
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void TI1_OnInterrupt(void)
{

  extern unsigned char ctr8;

  ctr8++;
  
  if (ctr8 % 5 == 0) TI1_SetPeriodMode(0);

}


/* END Events */

/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 02.84 for 
**     the Motorola HC08 series of microcontrollers.
**
** ###################################################################
*/
