34
34
35
35
static volatile voidFuncPtr intFunc [EXTERNAL_NUM_INTERRUPTS ];
36
36
37
- //#define DISABLE PORT_ISC_INTDISABLE_gc
38
- //#define CHANGE PORT_ISC_BOTHEDGES_gc
39
- //#define RISING PORT_ISC_RISING_gc
40
- //#define FALLING PORT_ISC_FALLING_gc
41
- //#define LOW_LEVEL PORT_ISC_LEVEL_gc
42
-
43
-
44
- void attachInterrupt (uint8_t interruptNum , void (* userFunc )(void ), PinStatus mode ) {
37
+ void attachInterrupt (uint8_t pin , void (* userFunc )(void ), PinStatus mode ) {
45
38
46
39
/* Get bit position and check pin validity */
47
40
uint8_t bit_pos = digitalPinToBitPosition (pin );
@@ -51,7 +44,7 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), PinStatus mod
51
44
uint8_t interruptNum = digitalPinToInterrupt (pin );
52
45
53
46
/* Check interrupt number and apply function pointer to correct array index */
54
- if (( interruptNum < EXTERNAL_NUM_INTERRUPTS ) && ( interruptNum > NOT_AN_INTERRUPT ) ) {
47
+ if (interruptNum < EXTERNAL_NUM_INTERRUPTS ) {
55
48
intFunc [interruptNum ] = userFunc ;
56
49
57
50
// Configure the interrupt mode (trigger on low input, any change, rising
@@ -91,7 +84,7 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), PinStatus mod
91
84
}
92
85
}
93
86
94
- void detachInterrupt (uint8_t interruptNum ) {
87
+ void detachInterrupt (uint8_t pin ) {
95
88
/* Get bit position and check pin validity */
96
89
uint8_t bit_pos = digitalPinToBitPosition (pin );
97
90
if (bit_pos == NOT_A_PIN ) return ;
0 commit comments