1 #include "p33fxxxx.h"
2 #include "controlMCUSlugsMKII.h"
3 #include "controlMCUSlugsMKII_private.h"
4
5 volatile uint16_T ic2up;
6 volatile uint16_T ic3up;
7 volatile uint16_T ic4up;
8 volatile uint16_T ic5up;
9 volatile uint16_T ic8up;
10 void __attribute__((__interrupt__)) _IC2Interrupt(void)
11 {
12 static uint16_T IC2TMR;
13 uint16_T tmp;
14 uint16_T calcul;
15 while (IC2CONbits.ICBNE == 1)
16 tmp = IC2BUF;
17 if ((IC2CON & 1)==1)
18 {
19 IC2CON = (IC2CON & 0xfffe);
20 } else
21 {
22 IC2CON = (IC2CON | 0x0001);
23 calcul = tmp - IC2TMR;
24 ic2up = calcul;
25 }
26
27 IC2TMR = tmp;
28 _IC2IF = 0;
29 }
30
31 void __attribute__((__interrupt__)) _IC3Interrupt(void)
32 {
33 static uint16_T IC3TMR;
34 uint16_T tmp;
35 uint16_T calcul;
36 while (IC3CONbits.ICBNE == 1)
37 tmp = IC3BUF;
38 if ((IC3CON & 1)==1)
39 {
40 IC3CON = (IC3CON & 0xfffe);
41 } else
42 {
43 IC3CON = (IC3CON | 0x0001);
44 calcul = tmp - IC3TMR;
45 ic3up = calcul;
46 }
47
48 IC3TMR = tmp;
49 _IC3IF = 0;
50 }
51
52 void __attribute__((__interrupt__)) _IC4Interrupt(void)
53 {
54 static uint16_T IC4TMR;
55 uint16_T tmp;
56 uint16_T calcul;
57 while (IC4CONbits.ICBNE == 1)
58 tmp = IC4BUF;
59 if ((IC4CON & 1)==1)
60 {
61 IC4CON = (IC4CON & 0xfffe);
62 } else
63 {
64 IC4CON = (IC4CON | 0x0001);
65 calcul = tmp - IC4TMR;
66 ic4up = calcul;
67 }
68
69 IC4TMR = tmp;
70 _IC4IF = 0;
71 }
72
73 void __attribute__((__interrupt__)) _IC5Interrupt(void)
74 {
75 static uint16_T IC5TMR;
76 uint16_T tmp;
77 uint16_T calcul;
78 while (IC5CONbits.ICBNE == 1)
79 tmp = IC5BUF;
80 if ((IC5CON & 1)==1)
81 {
82 IC5CON = (IC5CON & 0xfffe);
83 } else
84 {
85 IC5CON = (IC5CON | 0x0001);
86 calcul = tmp - IC5TMR;
87 ic5up = calcul;
88 }
89
90 IC5TMR = tmp;
91 _IC5IF = 0;
92 }
93
94 void __attribute__((__interrupt__)) _IC8Interrupt(void)
95 {
96 static uint16_T IC8TMR;
97 uint16_T tmp;
98 uint16_T calcul;
99 while (IC8CONbits.ICBNE == 1)
100 tmp = IC8BUF;
101 if ((IC8CON & 1)==1)
102 {
103 IC8CON = (IC8CON & 0xfffe);
104 } else
105 {
106 IC8CON = (IC8CON | 0x0001);
107 calcul = tmp - IC8TMR;
108 ic8up = calcul;
109 }
110
111 IC8TMR = tmp;
112 _IC8IF = 0;
113 }
|