/******************************************************************************
* File:    isr.h
* Purpose: Define interrupt service routines referenced by the vector table.
* Note: Only "vectors.c" should include this header file.
******************************************************************************/

#ifndef __ISR_H
#define __ISR_H 1

//#define USE_FLEXCAN1
//#define USE_FLEXCAN0

// Vector definition for FlexCAN0 OR'ed Message buffer

#ifdef  USE_FLEXCAN0
  #undef	VECTOR_045	
  #undef        VECTOR_046
  #undef	VECTOR_047	
  #undef        VECTOR_048
  #undef	VECTOR_049	
  #undef        VECTOR_050
  #undef        VECTOR_051
  #undef        VECTOR_052

  #define	VECTOR_045	FlexCAN_MB_ISR		// FlexCAN0 MB Interrupt Service Routine
  #define	VECTOR_046	FlexCAN_BusOff_ISR	// FlexCAN0 Bus Off Interrupt Service Routine
  #define	VECTOR_047	FlexCAN_Error_ISR       // FlexCAN0 Error Interrupt Service Routine
  #define	VECTOR_048	FlexCAN_TxWarning_ISR	// FlexCAN0 Transmit Warning Interrupt Service Routine
  #define	VECTOR_049	FlexCAN_RxWarning_ISR	// FlexCAN0 Receive Warning Interrupt Service Routine
  #define	VECTOR_050	FlexCAN_Wakeup_ISR	// FlexCAN0 Wakeup Interrupt Service Routine
  #define	VECTOR_051	FlexCAN_IMEU_ISR	// FlexCAN0 Individual Matching Elements Update Interrupt Service Routine
  #define	VECTOR_052	FlexCAN_LostRx_ISR	// FlexCAN0 Lost Receive Interrupt Service Routine

#elif (defined(USE_FLEXCAN1))
  #undef	VECTOR_053	
  #undef	VECTOR_054	
  #undef	VECTOR_055	
  #undef	VECTOR_056	
  #undef	VECTOR_057	
  #undef	VECTOR_058	
  #undef	VECTOR_059	
  #undef	VECTOR_060	

  #define	VECTOR_053	FlexCAN_MB_ISR		// FlexCAN1 MB Interrupt Service Routine
  #define	VECTOR_054	FlexCAN_BusOff_ISR	// FlexCAN1 Bus Off Interrupt Service Routine
  #define	VECTOR_055	FlexCAN_Error_ISR       // FlexCAN1 Error Interrupt Service Routine
  #define	VECTOR_056	FlexCAN_TxWarning_ISR	// FlexCAN1 Transmit Warning Interrupt Service Routine
  #define	VECTOR_057	FlexCAN_RxWarning_ISR	// FlexCAN1 Receive Warning Interrupt Service Routine
  #define	VECTOR_058	FlexCAN_Wakeup_ISR	// FlexCAN1 Wakeup Interrupt Service Routine
  #define	VECTOR_059	FlexCAN_IMEU_ISR	// FlexCAN1 Individual Matching Elements Update Interrupt Service Routine
  #define	VECTOR_060	FlexCAN_LostRx_ISR	// FlexCAN1 Lost Receive Interrupt Service Routine

#endif


#undef  VECTOR_073   // as it was previously defined in vectors.h
#undef  VECTOR_074   // as it was previously defined in vectors.h
#undef  VECTOR_088   // as it was previously defined in vectors.h

                                     // address     vector irq    perihperal
#define VECTOR_073      adc0_isr     // 0x0000_0124 73     57     ADC0
#define VECTOR_074      adc1_isr     // 0x0000_0128 74     58     ADC1
#define VECTOR_088      pdb_isr      // 0x0000_0160 88     72     PDB

#undef VECTOR_081
#define VECTOR_081 cmt_isrv

#undef  VECTOR_082
#define VECTOR_082 int_rtc

#undef  VECTOR_084
#define VECTOR_084 int_pit0


#undef  VECTOR_099
#define VECTOR_099 TSI_isr

#undef  VECTOR_105
#define VECTOR_105 irq_isr

// ISR(s) are defined in your project directory.
extern void     int_pit0(void);
extern void     int_rtc(void);
extern void     adc0_isr(void);                                // ISR for ADC0
extern void     adc1_isr(void);                                // ISR for ADC1
extern void     pdb_isr(void);                                 // ISR for PDB
extern void	FlexCAN_MB_ISR(void);
extern void	FlexCAN_BusOff_ISR(void);
extern void	FlexCAN_Error_ISR(void);
extern void	FlexCAN_TxWarning_ISR(void);
extern void	FlexCAN_RxWarning_ISR(void);
extern void	FlexCAN_Wakeup_ISR(void);
extern void	FlexCAN_IMEU_ISR(void);
extern void	FlexCAN_LostRx_ISR(void);
extern void     TSI_isr(void);
extern void     irq_isr(void);
extern void cmt_isrv(void);
#endif  //__ISR_H

/* End of "isr.h" */
