/** ###################################################################
**     THIS COMPONENT MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**     Filename    : timer1.c
**     Project     : ProcessorExpert
**     Processor   : MC56F84789VLL
**     Component   : TimerInt
**     Version     : Component 02.159, Driver 02.05, CPU db: 3.50.001
**     Compiler    : Metrowerks DSP C Compiler
**     Date/Time   : 2012-07-05, 12:27, # CodeGen: 7
**     Abstract    :
**         This component "TimerInt" implements a periodic interrupt.
**         When the component and its events are enabled, the "OnInterrupt"
**         event is called periodically with the period that you specify.
**         TimerInt supports also changing the period in runtime.
**         The source of periodic interrupt can be timer compare or reload
**         register or timer-overflow interrupt (of free running counter).
**     Settings    :
**         Timer name                  : shareTmr
**
**         Initialization:
**              Timer                  : Enabled
**              Events                 : Enabled
**     Contents    :
**         No public methods
**
**     Copyright : 1997 - 2012 Freescale Semiconductor, Inc. All Rights Reserved.
**     
**     http      : www.freescale.com
**     mail      : support@freescale.com
** ###################################################################*/

/* MODULE timer1. */

#include "Events.h"
#include "timer1.h"

static word Cnt;                       /* RTIShared interrupt counter */


/* Internal method prototypes */

/*
** ===================================================================
**     Method      :  timer1_Init (component TimerInt)
**
**     Description :
**         Initializes the associated peripheral(s) and the beans 
**         internal variables. The method is called automatically as a 
**         part of the application initialization code.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void timer1_Init(void)
{
  Cnt = 0U;                            /* RTIShared interrupt counter */
}

/*
** ===================================================================
**     Method      :  timer1_Interrupt (component TimerInt)
**
**     Description :
**         The method services the interrupt of the selected peripheral(s)
**         and eventually invokes the beans event(s).
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
void timer1_Interrupt(void)
{
    Cnt++;                             /* Increment RTIShared counter */
    if (Cnt == 0xC8U) {                /* Is it now the event period time? */
      Cnt = 0U;                        /* Reset RTIShared counter */
      timer1_OnInterrupt();            /* Invoke user event */
    }
}

/* END timer1. */

/*
** ###################################################################
**
**     This file was created by Processor Expert 5.3 [05.01]
**     for the Freescale 56800 series of microcontrollers.
**
** ###################################################################
*/
