CCD2.c 906 Bytes
#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	

}