-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterrupts.h
executable file
·94 lines (86 loc) · 3.15 KB
/
interrupts.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*******************************************************************************
*
* TITLE: interrupts.h
*
* VERSION: 0.3 (Beta)
*
* DATE: 03-Jan-2008
*
* AUTHOR: R. Kevin Watson
*
* COMMENTS: This file contains template interrupt initialization & handling
* code for the IFI FRC robot controller.
*
* This version is compatible with Microchip C18 3.0+ only.
*
* This file best viewed with tabs set to four.
*
* You are free to use this source code for any non-commercial
* use. Please do not make copies of this source code, modified
* or un-modified, publicly available on the internet or elsewhere
* without permission. Thanks.
*
* Copyright ©2004-2008 R. Kevin Watson. All rights are reserved.
*
********************************************************************************
*
* CHANGE LOG:
*
* DATE REV DESCRIPTION
* ----------- --- ----------------------------------------------------------
* 22-Dec-2003 0.1 RKW Original
* 25-Feb-2004 0.2 RKW - Added the ability to clear the interrupt flag before
* enabling the interrupt.
* 03-Jan-2008 0.3 RKW - Renamed all ISRs for consistancy across all
* modules of the new robot controller code.
*
*******************************************************************************/
#ifndef _interrupts_h
#define _interrupts_h
// Remove the comment slashes from one or more of the following lines to
// enable the respective external interrupt(s). By doing so, you only
// enable the code within interrupts.c to become part of your software
// build. For your software to be fully functional, you must also enable
// the interrupt(s) in ifi_frc.h.
// #define ENABLE_INT_1_ISR // Used by encoder 1 do not enable here
//#define ENABLE_INT_2_ISR // Used by op sensor at bottom of arm
//#define ENABLE_INT_3_ISR // Used by ball switch
//#define ENABLE_INT_4_ISR
// #define ENABLE_INT_5_ISR
// #define ENABLE_INT_6_ISR
//
// If you modify stuff below this line, you'll break the software.
//
// #define ENABLE_INT_3_6_ISR if external interrupt 3, 4, 5 or 6 is enabled
#ifdef ENABLE_INT_3_ISR
#ifndef ENABLE_INT_3_6_ISR
#define ENABLE_INT_3_6_ISR
#endif
#endif
#ifdef ENABLE_INT_4_ISR
#ifndef ENABLE_INT_3_6_ISR
#define ENABLE_INT_3_6_ISR
#endif
#endif
#ifdef ENABLE_INT_5_ISR
#ifndef ENABLE_INT_3_6_ISR
#define ENABLE_INT_3_6_ISR
#endif
#endif
#ifdef ENABLE_INT_6_ISR
#ifndef ENABLE_INT_3_6_ISR
#define ENABLE_INT_3_6_ISR
#endif
#endif
// function prototypes
void Initialize_Int_1(void); // initializes interrupt 1
void Initialize_Int_2(void); // initializes interrupt 2
void Initialize_Int_3_6(void); // initializes interrupts 3 through 6
void Int_1_ISR(void); // external interrupt 1 service routine
void Int_2_ISR(void); // external interrupt 2 service routine
void Int_3_ISR(unsigned char); // external interrupt 3 service routine
void Int_4_ISR(unsigned char); // external interrupt 4 service routine
void Int_5_ISR(unsigned char); // external interrupt 5 service routine
void Int_6_ISR(unsigned char); // external interrupt 6 service routine
#endif