
/* #######################################################################
   ###                                                                 ###
   ### Edited for MOT/BBS; 07-Feb-92 (Ed2)                             ###
   ###                                                                 ###
   ### Revision History:                                               ###
   ### Rev 0  - 05-Nov-91 Module Creation David C. Hughes Jr.          ###
   ###                                                                 ###
   ####################################################################### */

#include "amp.h"        /* include system global definitions */

extern unsigned short clk_ticks;    /* 8.33 mS clock tick register */
extern unsigned short sec_ticks;    /* 1 second clock tick register */
extern unsigned short timerd; 
extern struct drv_template drv_status;     /* driver status bit vectors */

/* #####################################################
   ### IRQ_SVC Routine.  External Interrupt Service. ###
   ##################################################### */
NOLOCAL
INTERRUPT
void irq_svc()
{
}

/* #######################################################################
   ### SPI_SVC Routine.  Syncronous Peripheral [SPI] interrupt service ###
   ####################################################################### */
NOLOCAL
INTERRUPT
void spi_svc()
{
}

/* #######################################################################
   ### SCI_SVC Routine. Asyncronous serial COM [SCI] interrupt service ###
   ####################################################################### */
NOLOCAL
INTERRUPT
void sci_svc()
{
}

/* ##############################################################
   ### PAI_SVC Routine. Pulse Input service interrupt service ###
   ############################################################## */
NOLOCAL
INTERRUPT
void pai_svc()
{
}

/* #####################################################################
   ### TIMER1_SVC Routine.  Output Compare timer 1 interrupt service ###
   ##################################################################### */
NOLOCAL
INTERRUPT
void timer1_svc()
{
   if (HC11.TFLG1 & 0x80)   /* timer1 output compare request [OC1F] valid? */
   {
      HC11.TOC1 += 2500;    /* advance output compare to next 5 ms event */
      if (timerd)                /* general purpose delay timer */
           --timerd;             /* decrement toward terminal count */
      if (++clk_ticks == 200)
      {
         clk_ticks = 0;
         drv_status.SEC_BOUNDRY = TRUE;      
         if (++sec_ticks == 60)
         {
             sec_ticks = 0;
             drv_status.MIN_BOUNDRY = TRUE;      
         }
      }
   }
}
