|
@@ -52,7 +52,7 @@ static volatile int8_t Channel[_Nbr_16timers]; // counter for the s
|
52
|
52
|
// ------------------------
|
53
|
53
|
/// Interrupt handler for the TC0 channel 1.
|
54
|
54
|
// ------------------------
|
55
|
|
-void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel);
|
|
55
|
+void Servo_Handler(const timer16_Sequence_t, Tc*, const uint8_t);
|
56
|
56
|
|
57
|
57
|
#ifdef _useTimer1
|
58
|
58
|
void HANDLER_FOR_TIMER1() { Servo_Handler(_timer1, TC_FOR_TIMER1, CHANNEL_FOR_TIMER1); }
|
|
@@ -70,7 +70,7 @@ void Servo_Handler(timer16_Sequence_t timer, Tc *pTc, uint8_t channel);
|
70
|
70
|
void HANDLER_FOR_TIMER5() { Servo_Handler(_timer5, TC_FOR_TIMER5, CHANNEL_FOR_TIMER5); }
|
71
|
71
|
#endif
|
72
|
72
|
|
73
|
|
-void Servo_Handler(timer16_Sequence_t timer, Tc *tc, uint8_t channel) {
|
|
73
|
+void Servo_Handler(const timer16_Sequence_t timer, Tc *tc, const uint8_t channel) {
|
74
|
74
|
// clear interrupt
|
75
|
75
|
tc->TC_CHANNEL[channel].TC_SR;
|
76
|
76
|
if (Channel[timer] < 0)
|
|
@@ -113,26 +113,21 @@ static void _initISR(Tc *tc, uint32_t channel, uint32_t id, IRQn_Type irqn) {
|
113
|
113
|
TC_Start(tc, channel);
|
114
|
114
|
}
|
115
|
115
|
|
116
|
|
-void initISR(timer16_Sequence_t timer) {
|
|
116
|
+void initISR(const timer16_Sequence_t timer) {
|
117
|
117
|
#ifdef _useTimer1
|
118
|
|
- if (timer == _timer1)
|
119
|
|
- _initISR(TC_FOR_TIMER1, CHANNEL_FOR_TIMER1, ID_TC_FOR_TIMER1, IRQn_FOR_TIMER1);
|
|
118
|
+ if (timer == _timer1) _initISR(TC_FOR_TIMER1, CHANNEL_FOR_TIMER1, ID_TC_FOR_TIMER1, IRQn_FOR_TIMER1);
|
120
|
119
|
#endif
|
121
|
120
|
#ifdef _useTimer2
|
122
|
|
- if (timer == _timer2)
|
123
|
|
- _initISR(TC_FOR_TIMER2, CHANNEL_FOR_TIMER2, ID_TC_FOR_TIMER2, IRQn_FOR_TIMER2);
|
|
121
|
+ if (timer == _timer2) _initISR(TC_FOR_TIMER2, CHANNEL_FOR_TIMER2, ID_TC_FOR_TIMER2, IRQn_FOR_TIMER2);
|
124
|
122
|
#endif
|
125
|
123
|
#ifdef _useTimer3
|
126
|
|
- if (timer == _timer3)
|
127
|
|
- _initISR(TC_FOR_TIMER3, CHANNEL_FOR_TIMER3, ID_TC_FOR_TIMER3, IRQn_FOR_TIMER3);
|
|
124
|
+ if (timer == _timer3) _initISR(TC_FOR_TIMER3, CHANNEL_FOR_TIMER3, ID_TC_FOR_TIMER3, IRQn_FOR_TIMER3);
|
128
|
125
|
#endif
|
129
|
126
|
#ifdef _useTimer4
|
130
|
|
- if (timer == _timer4)
|
131
|
|
- _initISR(TC_FOR_TIMER4, CHANNEL_FOR_TIMER4, ID_TC_FOR_TIMER4, IRQn_FOR_TIMER4);
|
|
127
|
+ if (timer == _timer4) _initISR(TC_FOR_TIMER4, CHANNEL_FOR_TIMER4, ID_TC_FOR_TIMER4, IRQn_FOR_TIMER4);
|
132
|
128
|
#endif
|
133
|
129
|
#ifdef _useTimer5
|
134
|
|
- if (timer == _timer5)
|
135
|
|
- _initISR(TC_FOR_TIMER5, CHANNEL_FOR_TIMER5, ID_TC_FOR_TIMER5, IRQn_FOR_TIMER5);
|
|
130
|
+ if (timer == _timer5) _initISR(TC_FOR_TIMER5, CHANNEL_FOR_TIMER5, ID_TC_FOR_TIMER5, IRQn_FOR_TIMER5);
|
136
|
131
|
#endif
|
137
|
132
|
}
|
138
|
133
|
|