forked from tomminnich3141/multicopter_flexio
/
Events.c
200 lines (187 loc) · 6.65 KB
/
Events.c
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/* ###################################################################
** Filename : Events.c
** Project : flexio_qc01
** Processor : MK82FN256VLL15
** Component : Events
** Version : Driver 01.00
** Compiler : GNU C Compiler
** Date/Time : 2016-04-16, 12:34, # CodeGen: 0
** Abstract :
** This is user's event module.
** Put your event handler code here.
** Settings :
** Contents :
** No public methods
**
** ###################################################################*/
/*!
** @file Events.c
** @version 01.00
** @brief
** This is user's event module.
** Put your event handler code here.
*/
/*!
** @addtogroup Events_module Events module documentation
** @{
*/
/* MODULE Events */
#include "Cpu.h"
#include "Events.h"
#ifdef __cplusplus
extern "C" {
#endif
/* User includes (#include below this line is not maintained by Processor Expert) */
extern uint8_t sec_tick_byte;
extern uint8_t servo_tick_byte;
extern uint32_t total_time_seconds;
#ifdef pitTimer1_IDX
/*
** ===================================================================
** Interrupt handler : PIT0CH0_IRQHandler
**
** Description :
** User interrupt service routine.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void PIT0CH0_IRQHandler(void)
{
/* Clear interrupt flag.*/
PIT_HAL_ClearIntFlag(g_pitBase[pitTimer1_IDX], pitTimer1_CHANNEL);
/* Write your code here ... */
total_time_seconds++;
sec_tick_byte = true;
}
#else
/* This IRQ handler is not used by pitTimer1 component. The purpose may be
* that the component has been removed or disabled. It is recommended to
* remove this handler because Processor Expert cannot modify it according to
* possible new request (e.g. in case that another component uses this
* interrupt vector). */
#warning This IRQ handler is not used by pitTimer1 component.\
It is recommended to remove this because Processor Expert cannot\
modify it according to possible new request.
#endif
#ifdef flexibleIO1_IDX
/*
** ===================================================================
** Interrupt handler : FLEXIO0_IRQHandler
**
** Description :
** User interrupt service routine.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void FLEXIO0_IRQHandler(void)
{
FLEXIO_DRV_IRQHandler(flexibleIO1_IDX);
/* Write your code here ... */
}
#else
/* This IRQ handler is not used by flexibleIO1 component. The purpose may be
* that the component has been removed or disabled. It is recommended to
* remove this handler because Processor Expert cannot modify it according to
* possible new request (e.g. in case that another component uses this
* interrupt vector). */
#warning This IRQ handler is not used by flexibleIO1 component.\
It is recommended to remove this because Processor Expert cannot\
modify it according to possible new request.
#endif
#ifdef flexTimer1_IDX
/*
** ===================================================================
** Interrupt handler : FTM0_IRQHandler
**
** Description :
** User interrupt service routine.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void FTM0_IRQHandler(void)
{
FTM_DRV_IRQHandler(flexTimer1_IDX);
/* Write your code here ... */
}
#else
/* This IRQ handler is not used by flexTimer1 component. The purpose may be
* that the component has been removed or disabled. It is recommended to
* remove this handler because Processor Expert cannot modify it according to
* possible new request (e.g. in case that another component uses this
* interrupt vector). */
#warning This IRQ handler is not used by flexTimer1 component.\
It is recommended to remove this because Processor Expert cannot\
modify it according to possible new request.
#endif
#ifdef tpmTmr1_IDX
/*
** ===================================================================
** Interrupt handler : TPM1_IRQHandler
**
** Description :
** User interrupt service routine.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void TPM1_IRQHandler(void)
{
TPM_DRV_IRQHandler(tpmTmr1_IDX);
/* Write your code here ... */
}
#else
/* This IRQ handler is not used by tpmTmr1 component. The purpose may be
* that the component has been removed or disabled. It is recommended to
* remove this handler because Processor Expert cannot modify it according to
* possible new request (e.g. in case that another component uses this
* interrupt vector). */
#warning This IRQ handler is not used by tpmTmr1 component.\
It is recommended to remove this because Processor Expert cannot\
modify it according to possible new request.
#endif
#ifdef servo_loop_timer_IDX
/*
** ===================================================================
** Interrupt handler : PIT0CH1_IRQHandler
**
** Description :
** User interrupt service routine.
** Parameters : None
** Returns : Nothing
** ===================================================================
*/
void PIT0CH1_IRQHandler(void)
{
/* Clear interrupt flag.*/
PIT_HAL_ClearIntFlag(g_pitBase[servo_loop_timer_IDX], servo_loop_timer_CHANNEL);
/* Write your code here ... */
servo_tick_byte = true;
}
#else
/* This IRQ handler is not used by servo_loop_timer component. The purpose may be
* that the component has been removed or disabled. It is recommended to
* remove this handler because Processor Expert cannot modify it according to
* possible new request (e.g. in case that another component uses this
* interrupt vector). */
#warning This IRQ handler is not used by servo_loop_timer component.\
It is recommended to remove this because Processor Expert cannot\
modify it according to possible new request.
#endif
/* END Events */
#ifdef __cplusplus
} /* extern "C" */
#endif
/*!
** @}
*/
/*
** ###################################################################
**
** This file was created by Processor Expert 10.5 [05.21]
** for the Freescale Kinetis series of microcontrollers.
**
** ###################################################################
*/