interrupt.c
3.39 KB
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
#include "includes.h"
#include "hardware.h"
#include "all_value.h"
//u8 handnum_t=0;
///******************************************************************
//定时器中断服务程序
//*******************************************************************/
////定时器3中断服务函数
void TIM3_IRQHandler(void)
{
if(TIM_GetITStatus(TIM3,TIM_IT_Update)==SET)
{
if (TIM3_Mode1Nums<65535)TIM3_Mode1Nums++;
if (TIM3_CanSend1Nums<255)TIM3_CanSend1Nums++;
if (Tim3_XCNums[0]<255)Tim3_XCNums[0]++;
}
TIM_ClearITPendingBit(TIM3,TIM_IT_Update);
}
////定时器4中断服务函数
void TIM4_IRQHandler(void)
{
if(TIM_GetITStatus(TIM4,TIM_IT_Update)==SET)
{
u8 i;
if (TIM4_Flash1Nums<255)TIM4_Flash1Nums++;
if (TIM4_Flash2Nums<255)TIM4_Flash2Nums++;
if (TIM4_Flash3Nums<255)TIM4_Flash3Nums++;
if (TIM4_Flash4Nums<255)TIM4_Flash4Nums++;
if (TIM4_CanSend1Nums<255)TIM4_CanSend1Nums++;
if (TIM4_Usart2Nums<255)TIM4_Usart2Nums++;
if (TIM4_USART5_SendNums<255)TIM4_USART5_SendNums++;
if (CCD_M[0].Tim4_Usart56Nums<255)CCD_M[0].Tim4_Usart56Nums++;
if (CCD_M[1].Tim4_Usart56Nums<255)CCD_M[1].Tim4_Usart56Nums++;
if (TIM4_TouchSendNums<255)TIM4_TouchSendNums++;
if (Tim4_Music1Nums<255)Tim4_Music1Nums++;
if (Tim4_Slam1Nums<255)Tim4_Slam1Nums++;
if (Tim4_Slam2Nums<255)Tim4_Slam2Nums++;
if (TLaRadarDelay_Time4Nums<255)TLaRadarDelay_Time4Nums++;
if (Tim4_AccDccNums<65535)Tim4_AccDccNums++;
if (TIM4_WaitConUpNums<255)TIM4_WaitConUpNums++;
if (TIM4_WaitConDownNums<255)TIM4_WaitConDownNums++;
for(i=0;i<MaxMotNums;i++)
{
if (Motor[i].MToPc.Tim4_NodeProNums<255)Motor[i].MToPc.Tim4_NodeProNums++;
if (Motor[i].MToPc.Tim4_AxisDelayNum<255)Motor[i].MToPc.Tim4_AxisDelayNum++;
}
}
TIM_ClearITPendingBit(TIM4,TIM_IT_Update);
}
////定时器5中断服务函数
void TIM5_IRQHandler(void)
{
if(TIM_GetITStatus(TIM5,TIM_IT_Update)==SET)
{
if (Tim5_Hand1Nums<255)Tim5_Hand1Nums++;
if (TIM5_FanNums<255)TIM5_FanNums++;
if (TIM5_ElectrifyNums<255)TIM5_ElectrifyNums++;
if (AGV.Charge_Time5Nums<255)AGV.Charge_Time5Nums++;
if (AGV.AllAct_Time5Nums<255)AGV.AllAct_Time5Nums++;
if (MotorStopMiss_Time5Nums<255)MotorStopMiss_Time5Nums++;
if (AGV.Rotation_Time5Nums<255)AGV.Rotation_Time5Nums++;
if (Tim5_Slam3Nums<255)Tim5_Slam3Nums++;
if (Tim5_PDNums<255)Tim5_PDNums++;
// if (TLaRadarMiss_Time5Nums<255)TLaRadarMiss_Time5Nums++;
if (Tim5_TCP1Nums<255)Tim5_TCP1Nums++;
if (Tim5_Music2Nums<255)Tim5_Music2Nums++;
if (Tim5_SystemTimeNums<65535)Tim5_SystemTimeNums++;
if (Tim5_Battery1Nums<255)Tim5_Battery1Nums++;
}
TIM_ClearITPendingBit(TIM5,TIM_IT_Update);
}
////定时器7中断服务函数
void TIM7_IRQHandler(void)
{
if(TIM_GetITStatus(TIM7,TIM_IT_Update)==SET)
{
// u8 i;
if (Tim7_NotKeyNums<255)Tim7_NotKeyNums++;
if (AGV.Line_Time7Nums<255)AGV.Line_Time7Nums++;
if (Tim7_TaskDelayNums<255)Tim7_TaskDelayNums++;
if (AGV.Time7_NotActNums<255)AGV.Time7_NotActNums++;
}
TIM_ClearITPendingBit(TIM7,TIM_IT_Update);
}
/*************************CAN中断服务程序*****************************************/
#if CAN1_RX0_INT_ENABLE //使能RX0中断
//中断服务函数
void CAN1_RX0_IRQHandler(void)
{
CanRxMsg RxMessage;
OSIntEnter();
memset(&RxMessage,0,sizeof(RxMessage));
CAN_Receive(CAN1, 0, &RxMessage);
AxisData_Analysis(&RxMessage);
BatteryData_Ananlysis(&RxMessage);
MusicData_Analysis(&RxMessage);
SlamPos_Ananlysis(&RxMessage);
OSIntExit();
}
#endif