www.pudn.com > EZ-USB HID Keyboard.zip > tmr2.c


//----------------------------------------------------------------------------- 
//  File:    tmr2.c 
//  Contents:  ISR for timer2, used to write characters to the lcd 
//            EZUSB FX LCDIO firmware 
//  Copyright (c) 2001 Cypress Semiconductor All rights reserved 
//----------------------------------------------------------------------------- 
#include "ezusb.h" 
#include "ezregs.h" 
#include "Fx.h" 
 
extern BOOL tmr_kd; 
 
void tmr2_isr( void ) interrupt 5 using 1 
{ // fires every Xmsec ( where X=10, in this example )... 
  static BYTE loopcnt = 0x00; 
   
  if( loopcnt++ > 3 ) 
  { // 10msec * 3 = 30msec event timer 
    TR2 = 0;                    // ...stop timer2 ticking 
    loopcnt = 0x00;             // (re)start forground timer event 
  } 
  else 
  { 
     
  } 
   
  TF2 = 0;          // T2CON.7 must be cleared by software 
}