1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
26
27
28
29
37
38
39
40
41
42
43
44
49
52
53
58
65
66
71
78
79
84
91
92
97
104
105
110
113
114
119
122
123
128
131
132
137
141
142
147
148
149
154
155
156
157
158
159
162
163
168
172
173
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
198
/* ... */
#include "main.h"
#include "stm32f4xx_it.h"
#include "math.h"
Includes
extern PCD_HandleTypeDef hpcd;
extern USBD_HandleTypeDef USBD_Device;
extern ADC_HandleTypeDef AdcHandle;
extern uint32_t ADCConvertedValue;
extern uint32_t ADC_Prev_ConvertedValue;
extern uint8_t SendBuffer[2];
Private variables
/* ... */
void NMI_Handler(void)
{
}{ ... }
/* ... */
void HardFault_Handler(void)
{
while (1)
{
}while (1) { ... }
}{ ... }
/* ... */
void MemManage_Handler(void)
{
while (1)
{
}while (1) { ... }
}{ ... }
/* ... */
void BusFault_Handler(void)
{
while (1)
{
}while (1) { ... }
}{ ... }
/* ... */
void UsageFault_Handler(void)
{
while (1)
{
}while (1) { ... }
}{ ... }
/* ... */
void SVC_Handler(void)
{
}{ ... }
/* ... */
void DebugMon_Handler(void)
{
}{ ... }
/* ... */
void PendSV_Handler(void)
{
}{ ... }
/* ... */
void SysTick_Handler(void)
{
HAL_IncTick();
}{ ... }
...
...
/* ... */
#ifdef USE_USB_FS
void OTG_FS_IRQHandler(void)
#else
void OTG_HS_IRQHandler(void)
#endif
{
HAL_PCD_IRQHandler(&hpcd);
...}
/* ... */
void EXTI15_10_IRQHandler(void)
{
HAL_GPIO_EXTI_IRQHandler(KEY_BUTTON_PIN);
}{ ... }
/* ... */
void ADCx_DMA_IRQHandler(void)
{
HAL_DMA_IRQHandler(AdcHandle.DMA_Handle);
SendBuffer[0] = ADC_REPORT_ID;
if(abs((ADCConvertedValue >>4) - (ADC_Prev_ConvertedValue >>4)) > 4)
{
SendBuffer[1] = (uint8_t)(ADCConvertedValue >>4);
USBD_CUSTOM_HID_SendReport (&USBD_Device, SendBuffer, 2);
ADC_Prev_ConvertedValue = ADCConvertedValue;
}if (abs((ADCConvertedValue >>4) - (ADC_Prev_ConvertedValue >>4)) > 4) { ... }
}{ ... }
/* ... */
/* ... */