|
@@ -95,29 +95,29 @@ static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t
|
95
|
95
|
#ifndef WIRING // Wiring pre-defines signal handlers so don't define any if compiling for the Wiring platform
|
96
|
96
|
|
97
|
97
|
// Interrupt handlers for Arduino
|
98
|
|
- #if ENABLED(_useTimer1)
|
|
98
|
+ #ifdef _useTimer1
|
99
|
99
|
SIGNAL(TIMER1_COMPA_vect) { handle_interrupts(_timer1, &TCNT1, &OCR1A); }
|
100
|
100
|
#endif
|
101
|
101
|
|
102
|
|
- #if ENABLED(_useTimer3)
|
|
102
|
+ #ifdef _useTimer3
|
103
|
103
|
SIGNAL(TIMER3_COMPA_vect) { handle_interrupts(_timer3, &TCNT3, &OCR3A); }
|
104
|
104
|
#endif
|
105
|
105
|
|
106
|
|
- #if ENABLED(_useTimer4)
|
|
106
|
+ #ifdef _useTimer4
|
107
|
107
|
SIGNAL(TIMER4_COMPA_vect) { handle_interrupts(_timer4, &TCNT4, &OCR4A); }
|
108
|
108
|
#endif
|
109
|
109
|
|
110
|
|
- #if ENABLED(_useTimer5)
|
|
110
|
+ #ifdef _useTimer5
|
111
|
111
|
SIGNAL(TIMER5_COMPA_vect) { handle_interrupts(_timer5, &TCNT5, &OCR5A); }
|
112
|
112
|
#endif
|
113
|
113
|
|
114
|
114
|
#else // WIRING
|
115
|
115
|
|
116
|
116
|
// Interrupt handlers for Wiring
|
117
|
|
- #if ENABLED(_useTimer1)
|
|
117
|
+ #ifdef _useTimer1
|
118
|
118
|
void Timer1Service() { handle_interrupts(_timer1, &TCNT1, &OCR1A); }
|
119
|
119
|
#endif
|
120
|
|
- #if ENABLED(_useTimer3)
|
|
120
|
+ #ifdef _useTimer3
|
121
|
121
|
void Timer3Service() { handle_interrupts(_timer3, &TCNT3, &OCR3A); }
|
122
|
122
|
#endif
|
123
|
123
|
|
|
@@ -126,7 +126,7 @@ static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t
|
126
|
126
|
/****************** end of static functions ******************************/
|
127
|
127
|
|
128
|
128
|
void initISR(timer16_Sequence_t timer) {
|
129
|
|
- #if ENABLED(_useTimer1)
|
|
129
|
+ #ifdef _useTimer1
|
130
|
130
|
if (timer == _timer1) {
|
131
|
131
|
TCCR1A = 0; // normal counting mode
|
132
|
132
|
TCCR1B = _BV(CS11); // set prescaler of 8
|
|
@@ -145,7 +145,7 @@ void initISR(timer16_Sequence_t timer) {
|
145
|
145
|
}
|
146
|
146
|
#endif
|
147
|
147
|
|
148
|
|
- #if ENABLED(_useTimer3)
|
|
148
|
+ #ifdef _useTimer3
|
149
|
149
|
if (timer == _timer3) {
|
150
|
150
|
TCCR3A = 0; // normal counting mode
|
151
|
151
|
TCCR3B = _BV(CS31); // set prescaler of 8
|
|
@@ -163,7 +163,7 @@ void initISR(timer16_Sequence_t timer) {
|
163
|
163
|
}
|
164
|
164
|
#endif
|
165
|
165
|
|
166
|
|
- #if ENABLED(_useTimer4)
|
|
166
|
+ #ifdef _useTimer4
|
167
|
167
|
if (timer == _timer4) {
|
168
|
168
|
TCCR4A = 0; // normal counting mode
|
169
|
169
|
TCCR4B = _BV(CS41); // set prescaler of 8
|
|
@@ -173,7 +173,7 @@ void initISR(timer16_Sequence_t timer) {
|
173
|
173
|
}
|
174
|
174
|
#endif
|
175
|
175
|
|
176
|
|
- #if ENABLED(_useTimer5)
|
|
176
|
+ #ifdef _useTimer5
|
177
|
177
|
if (timer == _timer5) {
|
178
|
178
|
TCCR5A = 0; // normal counting mode
|
179
|
179
|
TCCR5B = _BV(CS51); // set prescaler of 8
|