CCD2.c
906 Bytes
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
#include "includes.h"
#include "hardware.h"
#include "all_value.h"
u8 USART5_RX_BUF[Length_Usart5_RX];
u8 USART5_RX_CNT=0;
//u8 TIM4_Usart5Nums;
#if WeightEn==0
void UART5_IRQHandler(void)//串口5中断服务程序
{
u8 res;
OSIntEnter();
if(USART_GetITStatus(UART5, USART_IT_RXNE) != RESET)
{
res=USART_ReceiveData(UART5);
if(USART5_RX_CNT<Length_Usart5_RX)
{
USART5_RX_BUF[USART5_RX_CNT]=res; //记录接收到的值
if(USART5_RX_BUF[0]==0xAA){ CCD_M[1].Tim4_Usart56Nums=0;USART5_RX_CNT++;}//接收数据增加1
}
}
USART_ClearITPendingBit(UART5,USART_IT_RXNE);
OSIntExit();
}
#endif
void CCD2_Pro(void)//上视觉程序
{
#if WeightEn==0
if(VaIndexDW_R(&F_AgvContr,11))//有上视觉
{ CCD_Data_Analysis(1,USART5_RX_BUF);//
if (CCD_M[1].Tim4_Usart56Nums>30)VaIndexW_W(&NodeOnLine,10,0);else VaIndexW_W(&NodeOnLine,10,1);
}
#endif
}