/*
 * Water_Cannon.c
 *
 *  Created on: 2024年1月3日
 *      Author: Administrator
 */

#include "MSP/msp_Water_Cannon.h"

	uint8_t Vel_buff[8];
void GF_MSP_Wate_Cannon_Contronl_1(uint32_t Motor_ID_1 ,int32_t Clean_Swi, int32_t Scan_Hor1_Ver2,int32_t Rise_down_XX, int32_t Turn_Left_Right_YY, int32_t Hz_Adjust)
{

	Vel_buff[0]=(uint8_t)(Clean_Swi);
	Vel_buff[1]=(uint8_t)(Scan_Hor1_Ver2);

	if(Rise_down_XX>=0)
	{
		Vel_buff[2]=(uint8_t)(Rise_down_XX);
		Vel_buff[3]=0x00;
	}
	else if(Rise_down_XX<0)
	{
		Vel_buff[2]=0x00;
		Vel_buff[3]=(uint8_t)(fabs(Rise_down_XX));
	}

	if(Turn_Left_Right_YY>=0)
	{
		Vel_buff[4]=(uint8_t)(Turn_Left_Right_YY);
		Vel_buff[5]=0x00;
	}
	else if(Turn_Left_Right_YY<0)
	{
		Vel_buff[4]=0x00;
		Vel_buff[5]=(uint8_t)(fabs(Turn_Left_Right_YY));
	}

	Vel_buff[6]=(uint8_t)(Hz_Adjust);

	int Length_date_1=8;
	GF_BSP_FDCAN_Senddata(1,Motor_ID_1,Length_date_1,Vel_buff);
}


//void GF_MSP_Wate_Cannon_Contronl(uint32_t Motor_ID_1 ,uint8_t Vel_buff[])
//{
//	int Length_date_1=8;
//	//FDCANfunction(Motor_ID_1, Length_date_1,Vel_buff);
//	GF_BSP_FDCAN_Senddata(1,Motor_ID_1,Length_date_1,Vel_buff);
//}

